blob: bb01911ee8369f0d991e964ce956981c52203627 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080027import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080028import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080029import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080030import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080031import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080032import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080033import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080034import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080035import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080036import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080038import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080039import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080040import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070041import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080042import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080043import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080044import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080045import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
46import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070047import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
48import "frameworks/base/core/proto/android/stats/enums.proto";
49import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070050import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070051import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080052import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070053import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000054import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080055import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080056import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080057import "frameworks/base/core/proto/android/telephony/enums.proto";
58import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080059import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010060import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070061import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080062
Yao Chend54f9dd2017-10-17 17:37:48 +000063/**
Stefan Lafonae2df012017-11-14 09:17:21 -080064 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000065 * raw stats log events from the Android system, also known as "atoms."
66 *
67 * This field contains a single oneof with all of the available messages.
68 * The stats-log-api-gen tool runs as part of the Android build and
69 * generates the android.util.StatsLog class, which contains the constants
70 * and methods that Android uses to log.
71 *
Stefan Lafonae2df012017-11-14 09:17:21 -080072 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000073 * Instead, statsd on Android constructs these messages synthetically,
74 * in the format defined here and in stats_log.proto.
75 */
Stefan Lafonae2df012017-11-14 09:17:21 -080076message Atom {
77 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070078 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070079 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
80 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070081 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070082 BleScanResultReceived ble_scan_result_received = 4;
83 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080084 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070085 SyncStateChanged sync_state_changed = 7;
86 ScheduledJobStateChanged scheduled_job_state_changed = 8;
87 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070088 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080089 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
90 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
91 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070092 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
93 MemoryFactorStateChanged memory_factor_state_changed = 15;
94 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
95 CachedKillReported cached_kill_reported = 17;
96 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070097 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080098 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
99 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
100 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -0700101 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800102 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -0700103 CameraStateChanged camera_state_changed = 25;
104 FlashlightStateChanged flashlight_state_changed = 26;
105 UidProcessStateChanged uid_process_state_changed = 27;
106 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
107 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700108 BatteryLevelChanged battery_level_changed = 30;
109 ChargingStateChanged charging_state_changed = 31;
110 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700111 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800112 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700113 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
114 KernelWakeupReported kernel_wakeup_reported = 36;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800115 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
116 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
117 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Bookatze5885242017-10-24 20:10:31 -0700118 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700119 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700120 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700121 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900122 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700123 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800124 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000125 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800126 AppStartOccurred app_start_occurred = 48;
127 AppStartCanceled app_start_canceled = 49;
128 AppStartFullyDrawn app_start_fully_drawn = 50;
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800129 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Chenjie Yu52cacc62017-12-08 18:11:45 -0800130 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800131 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800132 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800133 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800134 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800135 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000136 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800137 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800138 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800139 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800140 KeyguardStateChanged keyguard_state_changed = 62;
141 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
142 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800143 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800144 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800145 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
146 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800147 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700148 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800149 SpeakerImpedanceReported speaker_impedance_reported = 71;
150 HardwareFailed hardware_failed = 72;
151 PhysicalDropDetected physical_drop_detected = 73;
152 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800153 MobileConnectionStateChanged mobile_connection_state_changed = 75;
154 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700155 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800156 AppCrashOccurred app_crash_occurred = 78;
157 ANROccurred anr_occurred = 79;
158 WTFOccurred wtf_occurred = 80;
159 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700160 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800161 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700162 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700163 DeferredJobStatsReported deferred_job_stats_reported = 85;
Tej Singha72344992019-04-17 18:55:08 -0700164 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Kevin Chyn1741a072019-01-17 11:54:40 -0800165 BiometricAcquired biometric_acquired = 87;
166 BiometricAuthenticated biometric_authenticated = 88;
167 BiometricErrorOccurred biometric_error_occurred = 89;
Will Brockmanfbaa7912019-10-24 15:15:09 -0400168 UiEventReported ui_event_reported = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700169 BatteryHealthSnapshot battery_health_snapshot = 91;
170 SlowIo slow_io = 92;
171 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700172 PhoneServiceStateChanged phone_service_state_changed = 94;
173 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100174 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700175 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700176 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700177 // TODO: service state change is very noisy shortly after boot, as well
178 // as at other transitions - coming out of doze, device plugged in, etc.
179 // Consider removing this if it becomes a problem
180 ServiceStateChanged service_state_changed = 99;
181 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800182 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800183 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000184 DevicePolicyEvent device_policy_event = 103;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800185 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
186 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
187 105 [(module) = "docsui"];
188 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
189 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
190 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
191 108 [(module) = "docsui"];
192 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
193 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
194 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
195 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Bookatzda1798c2018-12-13 14:16:00 -0800196 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
197 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f62018-12-06 11:01:38 +0000198 AppCompacted app_compacted = 115;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800199 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800200 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800201 117 [(module) = "docsui"];
202 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
203 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
204 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
205 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Christian Brunschenf86039e2018-12-21 12:26:14 +0000206 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000207 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800208 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800209 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800210 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
211 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000212 AppDowngraded app_downgraded = 128;
213 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
214 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800215 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
216 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800217 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800218 NfcErrorOccurred nfc_error_occurred = 134;
219 NfcStateChanged nfc_state_changed = 135;
220 NfcBeamOccurred nfc_beam_occurred = 136;
221 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
222 NfcTagOccurred nfc_tag_occurred = 138;
223 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
224 SeStateChanged se_state_changed = 140;
225 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800226 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800227 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800228 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800229 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800230 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800231 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800232 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500233 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800234 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800235 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
236 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
237 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
238 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
239 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
240 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
241 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
242 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
243 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800244 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
245 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
Jack Heaea26982019-04-04 11:19:48 -0700246 BluetoothDeviceInfoReported bluetooth_device_info_reported = 162;
Jack He1021a612019-01-20 21:22:46 -0800247 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
248 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
249 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
250 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
251 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800252 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800253 ProcessStartTime process_start_time = 169;
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700254 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800255 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800256 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800257 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500258 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800259 AssistGestureStageReported assist_gesture_stage_reported = 174;
260 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
261 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800262 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000263 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800264 StyleUIChanged style_ui_changed = 179 [(module) = "style"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700265 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800266 180 [(module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000267 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800268 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000269 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700270 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700271 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
272 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700273 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Ben Blount763a5d52019-04-10 11:48:58 -0700274 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800275 188 [(module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700276 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800277 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800278 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800279 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
280 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
281 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
282 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
283 MediametricsCodecReported mediametrics_codec_reported = 195;
284 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
285 MediametricsExtractorReported mediametrics_extractor_reported = 197;
286 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
287 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
288 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700289 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Yuncheol Heod1a85d22019-05-08 17:13:42 -0700290 CarPowerStateChanged car_power_state_changed = 203;
291 GarageModeInfo garage_mode_info = 204;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800292 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Adam He420947c2019-01-23 15:59:09 -0800293 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
294 ContentCaptureServiceEvents content_capture_service_events = 207;
295 ContentCaptureSessionEvents content_capture_session_events = 208;
296 ContentCaptureFlushed content_capture_flushed = 209;
Hongyi Zhang700137e2019-05-23 21:19:36 -0700297 LocationManagerApiUsageReported location_manager_api_usage_reported = 210;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100298 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800299 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100300 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800301 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100302 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800303 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100304 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800305 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100306 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800307 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100308 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800309 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100310 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800311 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100312 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800313 218 [(module) = "permissioncontroller"];
314 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
315 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
316 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
317 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -0700318 ExclusionRectStateChanged exclusion_rect_state_changed = 223;
319 BackGesture back_gesture_reported_reported = 224;
Tianjie Xu167c3db2019-07-22 14:25:14 -0700320 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
321 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Emilian Peev6729f372019-08-29 09:14:09 -0700322 CameraActionEvent camera_action_event = 227;
atrost01a20932019-08-28 15:40:37 +0100323 AppCompatibilityChangeReported app_compatibility_change_reported =
324 228 [(allow_from_any_uid) = true];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800325 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Mark Tabrya824a642019-11-05 12:26:12 -0800326 VmsClientConnectionStateChanged vms_client_connection_state_changed = 230;
Blake Kragten212edc72019-10-15 13:26:50 -0700327 GpsLocationStatusReported gps_location_status_reported = 231;
328 GpsTimeToFirstFixReported gps_time_to_first_fix_reported = 232;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800329 MediaProviderScanEvent media_provider_scan_event = 233 [(module) = "mediaprovider"];
330 MediaProviderDeletionEvent media_provider_deletion_event = 234 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700331 MediaProviderPermissionEvent media_provider_permission_event =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800332 235 [(module) = "mediaprovider"];
333 MediaProviderSchemaChange media_provider_schema_change = 236 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700334 MediaProviderIdleMaintenance media_provider_idle_maintenance =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800335 237 [(module) = "mediaprovider"];
Kenny Root4eacaaa2020-01-08 20:48:13 -0800336 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238;
Keun young Park3e033cb2019-12-18 11:27:35 -0800337 BootTimeEventDuration boot_time_event_duration_reported = 239;
338 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported = 240;
339 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
340 BootTimeEventErrorCode boot_time_event_error_code_reported = 242;
Yao Chend54f9dd2017-10-17 17:37:48 +0000341 }
David Chenc8a43242017-10-17 16:23:28 -0700342
David Chen6e3e6cb2018-01-03 16:14:06 -0800343 // Pulled events will start at field 10000.
Stan Iliev637ba5e2019-08-16 13:43:08 -0400344 // Next: 10069
David Chenc8a43242017-10-17 16:23:28 -0700345 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800346 WifiBytesTransfer wifi_bytes_transfer = 10000;
347 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
348 MobileBytesTransfer mobile_bytes_transfer = 10002;
349 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800350 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800351 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800352 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800353 CpuTimePerFreq cpu_time_per_freq = 10008;
354 CpuTimePerUid cpu_time_per_uid = 10009;
355 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800356 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800357 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800358 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800359 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800360 SystemElapsedRealtime system_elapsed_realtime = 10014;
361 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800362 CpuActiveTime cpu_active_time = 10016;
363 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000364 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800365 RemainingBatteryCapacity remaining_battery_capacity = 10019;
366 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800367 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100368 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100369 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100370 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000371 DiskStats disk_stats = 10025;
372 DirectoryUsage directory_usage = 10026;
373 AppSize app_size = 10027;
374 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700375 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700376 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800377 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700378 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700379 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800380 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700381 ProcessCpuTime process_cpu_time = 10035;
Misha Wagner5a51e002018-10-03 15:04:09 +0100382 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700383 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800384 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
385 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
386 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000387 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800388 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800389 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800390 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000391 DebugElapsedClock debug_elapsed_clock = 10046;
392 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800393 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800394 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800395 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800396 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000397 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000398 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800399 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
400 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000401 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000402 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700403 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700404 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200405 AppOps app_ops = 10060;
Rafal Slawik77987ed2019-06-17 12:28:23 +0100406 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
Alec Mourie088e762019-07-02 13:10:55 -0700407 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
408 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Rafal Slawik7efcefb2019-09-20 11:16:20 +0100409 ProcessMemorySnapshot process_memory_snapshot = 10064;
Mark Tabrya824a642019-11-05 12:26:12 -0800410 VmsClientStats vms_client_stats = 10065;
Chris Wrencdea3b72019-11-22 16:58:17 -0500411 NotificationRemoteViews notification_remote_views = 10066;
Stanislav Zholninccb82e42019-11-29 18:59:49 +0000412 DangerousPermissionStateSampled dangerous_permission_state_sampled = 10067;
Stan Iliev637ba5e2019-08-16 13:43:08 -0400413 GraphicsStats graphics_stats = 10068;
David Chenc8a43242017-10-17 16:23:28 -0700414 }
yroa1fe77c2018-02-26 14:22:54 -0800415
Bookatz76aafcf2018-09-17 16:17:10 -0700416 // DO NOT USE field numbers above 100,000 in AOSP.
417 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
418 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100419
420 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700421}
422
Yao Chend54f9dd2017-10-17 17:37:48 +0000423/**
Yangster-mac20877162017-12-22 17:19:39 -0800424 * This proto represents a node of an attribution chain.
425 * Note: All attribution chains are represented as a repeated field of type
426 * AttributionNode. It is understood that in such arrays, the order is that
427 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000428 */
Yangster-mac20877162017-12-22 17:19:39 -0800429message AttributionNode {
430 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800431 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800432
Yangster-mac20877162017-12-22 17:19:39 -0800433 // The (optional) string tag for an element in the attribution chain. If the
434 // element has no tag, it is encoded as an empty string.
435 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700436}
437
Yangster-mac48b3d622018-08-18 12:38:11 -0700438message KeyValuePair {
439 optional int32 key = 1;
440 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700441 int32 value_int = 2;
442 int64 value_long = 3;
443 string value_str = 4;
444 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700445 }
446}
447
448message KeyValuePairsAtom {
449 optional int32 uid = 1;
450 repeated KeyValuePair pairs = 2;
451}
452
Yao Chend54f9dd2017-10-17 17:37:48 +0000453/*
454 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800455 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000456 *
457 * RULES:
458 * - The field ids for each atom must start at 1, and count upwards by 1.
459 * Skipping field ids is not allowed.
460 * - These form an API, so renaming, renumbering or removing fields is
461 * not allowed between android releases. (This is not currently enforced,
462 * but there will be a tool to enforce this restriction).
463 * - The types must be built-in protocol buffer types, namely, no sub-messages
464 * are allowed (yet). The bytes type is also not allowed.
465 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800466 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000467 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800468 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000469 * - A field that is a uid should be a string field, tagged with the [xxx]
470 * annotation. The generated code on android will be represented by UIDs,
471 * and those UIDs will be translated in xxx to those strings.
472 *
473 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700474 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000475 * - If there is a UID, it goes first. Think in an object-oriented fashion.
476 * *****************************************************************************
477 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700478
Yao Chend54f9dd2017-10-17 17:37:48 +0000479/**
Tej Singha72344992019-04-17 18:55:08 -0700480 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700481 * Logs when the Thermal service HAL notifies the throttling start/stop events.
482 *
483 * Logged from:
484 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
485 */
486message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700487 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700488 optional android.os.TemperatureTypeEnum sensor_type = 1;
489
Maggie White442b6312019-04-05 16:26:44 -0700490 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700491 enum State {
492 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700493 START = 1; // START indicated that throttling was triggered.
494 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700495 }
Yangster-mace16189a2018-08-26 12:20:16 -0700496 optional State state = 2;
497
498 optional float temperature = 3;
499}
500
501/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000502 * Logs when the screen state changes.
503 *
504 * Logged from:
505 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
506 */
507message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800508 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700509 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700510}
Yao Chend54f9dd2017-10-17 17:37:48 +0000511
512/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700513 * Logs that the process state of the uid, as determined by ActivityManager
514 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000515 *
516 * Logged from:
517 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
518 */
Bookatzc1a050a2017-10-10 15:49:28 -0700519message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700520 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000521
Bookatzdb026a22018-01-10 19:01:56 -0800522 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700523 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000524}
525
526/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700527 * Logs process state change of a process, as per the activity manager.
528 *
529 * Logged from:
530 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
531 */
532message ProcessStateChanged {
533 optional int32 uid = 1;
534 optional string process_name = 2;
535 optional string package_name = 3;
536 // TODO: remove this when validation is done
537 optional int64 version = 5;
538 // The state, from frameworks/base/core/proto/android/app/enums.proto.
539 optional android.app.ProcessStateEnum state = 4;
540}
541
542/**
543 * Logs when ActivityManagerService sleep state is changed.
544 *
545 * Logged from:
546 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
547 */
548message ActivityManagerSleepStateChanged {
549 // TODO: import frameworks proto
550 enum State {
551 UNKNOWN = 0;
552 ASLEEP = 1;
553 AWAKE = 2;
554 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700555 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700556}
557
558/**
559 * Logs when system memory state changes.
560 *
561 * Logged from:
562 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
563 */
564message MemoryFactorStateChanged {
565 // TODO: import frameworks proto
566 enum State {
567 MEMORY_UNKNOWN = 0;
568 NORMAL = 1; // normal.
569 MODERATE = 2; // moderate memory pressure.
570 LOW = 3; // low memory.
571 CRITICAL = 4; // critical memory.
572
573 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700574 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700575}
576
577/**
578 * Logs when app is using too much cpu, according to ActivityManagerService.
579 *
580 * Logged from:
581 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
582 */
583message ExcessiveCpuUsageReported {
584 optional int32 uid = 1;
585 optional string process_name = 2;
586 optional string package_name = 3;
587 // package version. TODO: remove this when validation is done
588 optional int64 version = 4;
589}
590
591/**
592 * Logs when a cached process is killed, along with its pss.
593 *
594 * Logged from:
595 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
596 */
597message CachedKillReported {
598 optional int32 uid = 1;
599 optional string process_name = 2;
600 optional string package_name = 3;
601 // TODO: remove this when validation is done
602 optional int64 version = 5;
603 optional int64 pss = 4;
604}
605
606/**
607 * Logs when memory stats of a process is reported.
608 *
609 * Logged from:
610 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
611 */
612message ProcessMemoryStatReported {
613 optional int32 uid = 1;
614 optional string process_name = 2;
615 optional string package_name = 3;
616 //TODO: remove this when validation is done
617 optional int64 version = 9;
618 optional int64 pss = 4;
619 optional int64 uss = 5;
620 optional int64 rss = 6;
621 enum Type {
622 ADD_PSS_INTERNAL_SINGLE = 0;
623 ADD_PSS_INTERNAL_ALL_MEM = 1;
624 ADD_PSS_INTERNAL_ALL_POLL = 2;
625 ADD_PSS_EXTERNAL = 3;
626 ADD_PSS_EXTERNAL_SLOW = 4;
627 }
628 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800629 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700630}
631
632/**
Bookatzc1a050a2017-10-10 15:49:28 -0700633 * Logs that a process started, finished, crashed, or ANRed.
634 *
635 * Logged from:
636 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
637 */
638message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700639 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700640
David Chen0b5c90c2018-01-25 16:51:49 -0800641 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800642 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700643
Bookatzddccf0a2017-11-28 16:48:14 -0800644 // What lifecycle state the process changed to.
645 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800646 enum State {
647 FINISHED = 0;
648 STARTED = 1;
649 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800650 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800651 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700652}
653
Bookatzc1a050a2017-10-10 15:49:28 -0700654/**
655 * Logs when the ble scan state changes.
656 *
657 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700658 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700659 */
660message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800661 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700662
663 enum State {
664 OFF = 0;
665 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700666 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
667 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700668 }
669 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700670
Bookatze5ec0b42018-03-26 13:34:56 -0700671 // Does the scan have a filter.
672 optional bool is_filtered = 3;
673 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
674 optional bool is_first_match = 4;
675 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
676 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700677}
678
679/**
680 * Logs reporting of a ble scan finding results.
681 *
682 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700683 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700684 */
Bookatzae6738e2018-09-13 11:38:56 -0700685// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700686message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800687 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700688
689 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800690 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700691}
692
693/**
694 * Logs when a sensor state changes.
695 *
696 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700697 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700698 */
699message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800700 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700701
Bookatzc1a050a2017-10-10 15:49:28 -0700702 // The id (int) of the sensor.
703 optional int32 sensor_id = 2;
704
705 enum State {
706 OFF = 0;
707 ON = 1;
708 }
709 optional State state = 3;
710}
711
Bookatzc1a050a2017-10-10 15:49:28 -0700712/**
713 * Logs when GPS state changes.
714 *
715 * Logged from:
716 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
717 */
718message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800719 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700720
721 enum State {
722 OFF = 0;
723 ON = 1;
724 }
725 optional State state = 2;
726}
727
Bookatz48d362e2018-11-06 15:49:08 -0800728/**
729 * Logs when GPS signal quality.
730 *
731 * Logged from:
732 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
733 */
734message GpsSignalQualityChanged {
735 optional android.server.location.GpsSignalQualityEnum level = 1;
736}
737
Blake Kragten212edc72019-10-15 13:26:50 -0700738/**
739 * Gps location status report
740 *
741 * Logged from:
742 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
743 */
744message GpsLocationStatusReported {
745 // Boolean stating if location was acquired
746 optional bool location_success = 1;
747}
748
749/**
750 * Gps log time to first fix report
751 *
752 * Logged from:
753 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
754 */
755message GpsTimeToFirstFixReported {
756 // int32 reporting the time to first fix in milliseconds
757 optional int32 time_to_first_fix_millis = 1;
758}
Bookatzc1a050a2017-10-10 15:49:28 -0700759
760/**
761 * Logs when a sync manager sync state changes.
762 *
763 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700764 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700765 */
766message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800767 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700768
David Chen0b5c90c2018-01-25 16:51:49 -0800769 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800770 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700771
772 enum State {
773 OFF = 0;
774 ON = 1;
775 }
776 optional State state = 3;
777}
778
Yangster-mac96353002018-09-05 11:18:55 -0700779/*
780 * Deferred job stats.
781 *
782 * Logged from:
783 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
784*/
785message DeferredJobStatsReported {
786 repeated AttributionNode attribution_node = 1;
787
788 // Number of jobs deferred.
789 optional int32 num_jobs_deferred = 2;
790
791 // Time since the last job runs.
792 optional int64 time_since_last_job_millis = 3;
793}
794
Bookatzc1a050a2017-10-10 15:49:28 -0700795/**
796 * Logs when a job scheduler job state changes.
797 *
798 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700799 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700800 */
801message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800802 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700803
804 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800805 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700806
807 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800808 FINISHED = 0;
809 STARTED = 1;
810 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700811 }
812 optional State state = 3;
813
Tej Singh33a412b2018-03-16 18:43:59 -0700814 // The reason a job has stopped.
815 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700816 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700817 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100818
819 // The standby bucket of the app that scheduled the job. These match the framework constants
820 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
821 // already assigned 0.
822 enum Bucket {
823 UNKNOWN = -1;
824 ACTIVE = 0;
825 WORKING_SET = 1;
826 FREQUENT = 2;
827 RARE = 3;
828 NEVER = 4;
829 }
830 optional Bucket standby_bucket = 5 [default = UNKNOWN];
831
832 // The job id (as assigned by the app).
833 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700834}
835
836/**
837 * Logs when the audio state changes.
838 *
839 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700840 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700841 */
842message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800843 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700844
845 enum State {
846 OFF = 0;
847 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700848 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
849 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700850 }
851 optional State state = 2;
852}
853
854/**
855 * Logs when the video codec state changes.
856 *
857 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700858 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700859 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800860message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800861 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700862
863 enum State {
864 OFF = 0;
865 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700866 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
867 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700868 }
869 optional State state = 2;
870}
871
872/**
873 * Logs when the flashlight state changes.
874 *
875 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700876 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700877 */
878message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800879 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700880
881 enum State {
882 OFF = 0;
883 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700884 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
885 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700886 }
887 optional State state = 2;
888}
889
890/**
891 * Logs when the camera state changes.
892 *
893 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700894 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700895 */
896message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800897 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700898
899 enum State {
900 OFF = 0;
901 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700902 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
903 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700904 }
905 optional State state = 2;
906}
907
908/**
909 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000910 *
911 * Logged from:
912 * TODO
913 */
Bookatzd6746242017-10-24 18:39:35 -0700914message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -0800915 repeated AttributionNode attribution_node = 1
916 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +0000917
Bookatz1a1b0462018-01-12 11:47:03 -0800918 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
919 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristineed615642020-01-02 12:53:41 -0800920 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY];
921 ;
Bookatzc1a050a2017-10-10 15:49:28 -0700922
923 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristineed615642020-01-02 12:53:41 -0800924 optional string tag = 3 [(state_field_option).option = PRIMARY];
Bookatzc1a050a2017-10-10 15:49:28 -0700925
926 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800927 RELEASE = 0;
928 ACQUIRE = 1;
929 CHANGE_RELEASE = 2;
930 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700931 }
tsaichristineed615642020-01-02 12:53:41 -0800932 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Bookatzc1a050a2017-10-10 15:49:28 -0700933}
934
935/**
Bookatzc1a050a2017-10-10 15:49:28 -0700936 * Logs when a partial wakelock is considered 'long' (over 1 min).
937 *
938 * Logged from:
939 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
940 */
941message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800942 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700943
Yao Chend54f9dd2017-10-17 17:37:48 +0000944 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
945 optional string tag = 2;
946
Bookatzc1a050a2017-10-10 15:49:28 -0700947 // TODO: I have no idea what this is.
948 optional string history_tag = 3;
949
950 enum State {
951 OFF = 0;
952 ON = 1;
953 }
954 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000955}
956
Bookatzc1a050a2017-10-10 15:49:28 -0700957/**
Bookatza66083f2018-09-20 17:24:00 -0700958 * Logs when the device is interactive, according to the PowerManager Notifier.
959 *
960 * Logged from:
961 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
962 */
963message InteractiveStateChanged {
964 enum State {
965 OFF = 0;
966 ON = 1;
967 }
968 optional State state = 1;
969}
970
971/**
Bookatzc1a050a2017-10-10 15:49:28 -0700972 * Logs Battery Saver state change.
973 *
974 * Logged from:
975 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
976 */
977message BatterySaverModeStateChanged {
978 enum State {
979 OFF = 0;
980 ON = 1;
981 }
982 optional State state = 1;
983}
984
985/**
986 * Logs Doze mode state change.
987 *
988 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800989 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700990 */
991message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800992 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800993}
994
995
996/**
997 * Logs state change of Doze mode including maintenance windows.
998 *
999 * Logged from:
1000 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1001 */
1002message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001003 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001004}
1005
1006/**
1007 * Logs screen brightness level.
1008 *
1009 * Logged from:
1010 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1011 */
1012message ScreenBrightnessChanged {
1013 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1014 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001015}
1016
1017/**
1018 * Logs battery level (percent full, from 0 to 100).
1019 *
1020 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001021 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001022 */
1023message BatteryLevelChanged {
1024 // Battery level. Should be in [0, 100].
1025 optional int32 battery_level = 1;
1026}
1027
1028/**
1029 * Logs change in charging status of the device.
1030 *
1031 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001032 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001033 */
1034message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001035 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1036 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001037}
1038
1039/**
1040 * Logs whether the device is plugged in, and what power source it is using.
1041 *
1042 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001043 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001044 */
1045message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001046 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1047 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001048}
1049
Bookatz8c6571b2017-10-24 15:04:41 -07001050/**
1051 * Logs when an app's wakeup alarm fires.
1052 *
1053 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001054 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001055 */
1056message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001057 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001058
1059 // Name of the wakeup alarm.
1060 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001061
1062 // Name of source package (for historical reasons, since BatteryStats tracked it).
1063 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001064
1065 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1066 enum Bucket {
1067 UNKNOWN = 0;
1068 EXEMPTED = 5;
1069 ACTIVE = 10;
1070 WORKING_SET = 20;
1071 FREQUENT = 30;
1072 RARE = 40;
1073 NEVER = 50;
1074 }
1075 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1076 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001077}
1078
1079/**
1080 * Logs when an an app causes the mobile radio to change state.
1081 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1082 *
1083 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001084 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001085 */
1086message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001087 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001088
Bookatz1a1b0462018-01-12 11:47:03 -08001089 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1090 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001091}
1092
1093/**
1094 * Logs when an an app causes the wifi radio to change state.
1095 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1096 *
1097 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001098 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001099 */
1100message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001101 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001102
Bookatz1a1b0462018-01-12 11:47:03 -08001103 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1104 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001105}
1106
1107/**
1108 * Logs kernel wakeup reasons and aborts.
1109 *
1110 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001111 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001112 */
1113message KernelWakeupReported {
1114 // Name of the kernel wakeup reason (or abort).
1115 optional string wakeup_reason_name = 1;
1116
1117 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001118 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001119}
1120
1121/**
Bookatzda1798c2018-12-13 14:16:00 -08001122 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001123 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001124 *
1125 * Logged from:
1126 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1127 */
1128message WifiEnabledStateChanged {
1129 enum State {
1130 OFF = 0;
1131 ON = 1;
1132 }
1133 optional State state = 1;
1134}
1135
1136/**
1137 * 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 -08001138 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1139 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001140 *
1141 * Logged from:
1142 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1143 */
1144message WifiRunningStateChanged {
1145 repeated AttributionNode attribution_node = 1;
1146
1147 enum State {
1148 OFF = 0;
1149 ON = 1;
1150 }
1151 optional State state = 2;
1152}
1153
1154/**
Bookatze5885242017-10-24 20:10:31 -07001155 * Logs wifi locks held by an app.
1156 *
1157 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001158 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001159 */
1160message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001161 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001162
1163 enum State {
1164 OFF = 0;
1165 ON = 1;
1166 }
1167 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001168
1169 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1170 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001171}
1172
1173/**
1174 * Logs wifi signal strength changes.
1175 *
1176 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001177 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001178 */
1179message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001180 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1181 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001182}
1183
1184/**
1185 * Logs wifi scans performed by an app.
1186 *
1187 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001188 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001189 */
1190message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001191 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001192
1193 enum State {
1194 OFF = 0;
1195 ON = 1;
1196 }
1197 optional State state = 2;
1198}
1199
1200/**
Tej Singh4503e102018-01-04 14:35:01 -08001201 * Logs wifi multicast locks held by an app
1202 *
1203 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001204 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001205 */
1206message WifiMulticastLockStateChanged {
1207 repeated AttributionNode attribution_node = 1;
1208
1209 enum State {
1210 OFF = 0;
1211 ON = 1;
1212 }
1213 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001214
1215 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001216}
1217
1218/**
Tej Singh1ea42892018-01-19 09:27:00 -08001219 * Logs shutdown reason and duration on next boot.
1220 *
1221 * Logged from:
1222 * frameworks/base/core/java/com/android/server/BootReceiver.java
1223 */
1224message ShutdownSequenceReported {
1225 // True if shutdown is for a reboot. Default: false if we do not know.
1226 optional bool reboot = 1;
1227
1228 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1229 optional string reason = 2;
1230
1231 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1232 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001233 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001234
1235 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001236 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001237}
1238
Tej Singh6483ea42018-01-25 17:45:49 -08001239
1240/**
1241 * Logs boot reason and duration.
1242 *
1243 * Logged from:
1244 * system/core/bootstat/bootstat.cpp
1245 */
1246message BootSequenceReported {
1247 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1248 // Default: "<EMPTY>" if not available.
1249 optional string bootloader_reason = 1;
1250
1251 // Reason for system boot. Eg. bootloader, reboot,userrequested
1252 // Default: "<EMPTY>" if not available.
1253 optional string system_reason = 2;
1254
1255 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001256 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001257
1258 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001259 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001260
1261 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001262 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001263
1264 // Time since last boot in ms. Default: 0 if not available.
1265 optional int64 time_since_last_boot = 6;
1266}
1267
Tej Singhc477d9c2018-02-05 18:31:39 -08001268
1269/**
1270 * Logs call state and disconnect cause (if applicable).
1271 *
1272 * Logged from:
1273 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1274 */
1275message CallStateChanged {
1276 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1277 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1278 optional android.telecom.CallStateEnum call_state = 1;
1279
1280 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1281 // This value is only applicable when the call_state is DISCONNECTED, and
1282 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1283 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1284 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1285
1286 // True if the call is self-managed, which are apps that use the
1287 // telecom infrastructure to make their own calls.
1288 optional bool self_managed = 3;
1289
1290 // True if call is external. External calls are calls on connected Wear
1291 // devices but show up in Telecom so the user can pull them onto the device.
1292 optional bool external_call = 4;
1293}
1294
Tej Singh1ea42892018-01-19 09:27:00 -08001295/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001296 * Logs keyguard state. The keyguard is the lock screen.
1297 *
1298 * Logged from:
1299 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1300 */
1301message KeyguardStateChanged {
1302 enum State {
1303 UNKNOWN = 0;
1304 // The keyguard is hidden when the phone is unlocked.
1305 HIDDEN = 1;
1306 // The keyguard is shown when the phone is locked (screen turns off).
1307 SHOWN= 2;
1308 // The keyguard is occluded when something is overlaying the keyguard.
1309 // Eg. Opening the camera while on the lock screen.
1310 OCCLUDED = 3;
1311 }
1312 optional State state = 1;
1313}
1314
1315/**
1316 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1317 * prompts the user to enter a password (pattern, pin, etc).
1318 *
1319 * Logged from:
1320 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1321 */
1322
1323message KeyguardBouncerStateChanged {
1324 enum State {
1325 UNKNOWN = 0;
1326 // Bouncer is hidden, either as a result of successfully entering the
1327 // password, screen timing out, or user going back to lock screen.
1328 HIDDEN = 1;
1329 // This is when the user is being prompted to enter the password.
1330 SHOWN = 2;
1331 }
1332 optional State state = 1;
1333}
1334
1335/**
1336 * Logs the result of entering a password into the keyguard bouncer.
1337 *
1338 * Logged from:
1339 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1340 */
1341message KeyguardBouncerPasswordEntered {
1342 enum BouncerResult {
1343 UNKNOWN = 0;
1344 // The password entered was incorrect.
1345 FAILURE = 1;
1346 // The password entered was correct.
1347 SUCCESS = 2;
1348 }
1349 optional BouncerResult result = 1;
1350}
1351
Tej Singha883b372018-02-15 11:30:01 -08001352/*
1353 * Logs changes to the configuration of the device. The configuration is defined
1354 * in frameworks/base/core/java/android/content/res/Configuration.java
1355 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1356 * Please go there to interpret the possible values each field can be.
1357 *
1358 * Logged from:
1359 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1360 */
1361message ResourceConfigurationChanged {
1362 // Bit mask of color capabilities of the screen.
1363 // Contains information about the color gamut and hdr mode of the screen.
1364 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001365 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001366
1367 // The target screen density being rendered to.
1368 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001369 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001370
1371 // Current user preference for the scaling factor for fonts,
1372 // relative to the base density scaling.
1373 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001374 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001375
1376 // Flag indicating whether the hard keyboard is hidden.
1377 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001378 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001379
1380 // The type of keyboard attached to the device.
1381 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1382 optional int32 keyboard = 5;
1383
1384 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1385 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001386 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001387
1388 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1389 // 0 if undefined.
1390 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1391 optional int32 mcc = 7;
1392
1393 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1394 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1395 // MNC_ZERO symbol defined in Configuration.java.
1396 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1397 optional int32 mnc = 8;
1398
1399 // The kind of navigation available on the device.
1400 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1401 optional int32 navigation = 9;
1402
1403 // Flag indicating whether the navigation is available.
1404 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001405 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001406
1407 // Overall orientation of the screen.
1408 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1409 optional int32 orientation = 11;
1410
1411 // The current height of the available screen space, in dp units.
1412 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001413 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001414
1415 // Bit mask of overall layout of the screen.
1416 // Contains information about screen size, whether the screen is wider/taller
1417 // than normal, whether the screen layout is right-tl-left or left-to-right,
1418 // and whether the screen has a rounded shape.
1419 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001420 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001421
1422 // Current width of the available screen space, in dp units.
1423 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001424 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001425
1426 // The smallest screen size an application will see in normal operation.
1427 // This is the smallest value of both screenWidthDp and screenHeightDp
1428 // in portrait and landscape.
1429 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001430 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001431
1432 // The type of touch screen attached to the device.
1433 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1434 optional int32 touchscreen = 16;
1435
1436 // Bit mask of the ui mode.
1437 // Contains information about the overall ui mode of the device.
1438 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1439 // Also contains information about whether the device is in night mode.
1440 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001441 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001442}
1443
Tej Singheee317b2018-03-07 19:28:05 -08001444
1445/**
1446 * Logs changes in the connection state of the mobile radio.
1447 *
1448 * Logged from:
1449 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1450 */
1451message MobileConnectionStateChanged {
1452 // States are from the state machine DataConnection.java.
1453 enum State {
1454 UNKNOWN = 0;
1455 // The connection is inactive, or disconnected.
1456 INACTIVE = 1;
1457 // The connection is being activated, or connecting.
1458 ACTIVATING = 2;
1459 // The connection is active, or connected.
1460 ACTIVE = 3;
1461 // The connection is disconnecting.
1462 DISCONNECTING = 4;
1463 // The connection is disconnecting after creating a connection.
1464 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1465 }
1466 optional State state = 1;
1467 // For multi-sim phones, this distinguishes between the sim cards.
1468 optional int32 sim_slot_index = 2;
1469 // Used to identify the connection. Starts at 0 and increments by 1 for
1470 // every new network created. Resets whenever the device reboots.
1471 optional int32 data_connection_id = 3;
1472 // A bitmask for the capabilities of this connection.
1473 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1474 // Default value (if we have no information): 0
1475 optional int64 capabilities = 4;
1476 // If this connection has internet.
1477 // This just checks if the DEFAULT bit of capabilities is set.
1478 optional bool has_internet = 5;
1479}
1480
1481/**
1482 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1483 *
1484 * Logged from:
1485 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1486 */
1487message MobileRadioTechnologyChanged {
1488 optional android.telephony.NetworkTypeEnum state = 1;
1489 // For multi-sim phones, this distinguishes between the sim cards.
1490 optional int32 sim_slot_index = 2;
1491}
1492
Andrew Chantb56388b2018-03-22 21:07:33 -07001493/**
1494 * Logs the VID and PID of any connected USB devices.
1495 *
1496 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1497 *
1498 * Logged by Vendor.
1499 */
1500message UsbDeviceAttached {
1501 optional int32 vid = 1;
1502 optional int32 pid = 2;
1503 optional bool has_audio = 3;
1504 optional bool has_hid = 4;
1505 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001506 enum State {
1507 STATE_DISCONNECTED = 0;
1508 STATE_CONNECTED = 1;
1509 }
1510 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001511 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001512}
1513
Tej Singheee317b2018-03-07 19:28:05 -08001514
Tej Singhdd7bd352018-02-09 19:33:15 -08001515/**
Tej Singh5d991e12018-03-09 19:48:11 -08001516 * Logs when Bluetooth is enabled and disabled.
1517 *
1518 * Logged from:
1519 * services/core/java/com/android/server/BluetoothManagerService.java
1520 */
1521message BluetoothEnabledStateChanged {
1522 repeated AttributionNode attribution_node = 1;
1523 // Whether or not bluetooth is enabled on the device.
1524 enum State {
1525 UNKNOWN = 0;
1526 ENABLED = 1;
1527 DISABLED = 2;
1528 }
1529 optional State state = 2;
1530 // The reason for being enabled/disabled.
1531 // Eg. Airplane mode, crash, application request.
1532 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1533 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001534 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001535}
1536
1537/**
Jack Hed9837c82019-01-09 01:19:13 -08001538 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001539 *
1540 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001541 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1542 *
1543 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001544 */
1545message BluetoothConnectionStateChanged {
1546 // The state of the connection.
1547 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1548 optional android.bluetooth.ConnectionStateEnum state = 1;
1549 // An identifier that can be used to match connect and disconnect events.
1550 // Currently is last two bytes of a hash of a device level ID and
1551 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001552 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001553 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001554 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1555 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001556 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001557 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001558 // An identifier that can be used to match events for this device.
1559 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1560 // Salt: Randomly generated 256 bit value
1561 // Hash algorithm: HMAC-SHA256
1562 // Size: 32 byte
1563 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001564 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001565}
1566
1567/**
1568 * Logs when a Bluetooth device connects and disconnects over ACL
1569 *
1570 * Logged from:
1571 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1572 *
1573 * Next Tag: 3
1574 */
1575message BluetoothAclConnectionStateChanged {
1576 // An identifier that can be used to match events for this device.
1577 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1578 // Salt: Randomly generated 256 bit value
1579 // Hash algorithm: HMAC-SHA256
1580 // Size: 32 byte
1581 // Default: null or empty if the device identifier is not known
1582 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1583 // The state of the connection.
1584 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1585 optional android.bluetooth.ConnectionStateEnum state = 2;
1586}
1587
1588/**
1589 * Logs when a Bluetooth device connects and disconnects over SCO
1590 *
1591 * Logged from:
1592 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1593 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1594 *
1595 * Next Tag: 4
1596 */
1597message BluetoothScoConnectionStateChanged {
1598 // An identifier that can be used to match events for this device.
1599 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1600 // Salt: Randomly generated 256 bit value
1601 // Hash algorithm: HMAC-SHA256
1602 // Size: 32 byte
1603 // Default: null or empty if the device identifier is not known
1604 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1605 // The state of the connection.
1606 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1607 optional android.bluetooth.ConnectionStateEnum state = 2;
1608 // Codec used for this SCO connection
1609 // Default: UNKNOWN
1610 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001611}
1612
Jack Hec27040a2019-01-09 20:54:41 -08001613/**
1614 * Logged when active device of a profile changes
1615 *
1616 * Logged from:
1617 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1618 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1619 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1620 */
1621message BluetoothActiveDeviceChanged {
1622 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1623 // From android.bluetooth.BluetoothProfile
1624 optional int32 bt_profile = 1;
1625 // An identifier that can be used to match events for this new active device.
1626 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1627 // Salt: Randomly generated 256 bit value
1628 // Hash algorithm: HMAC-SHA256
1629 // Size: 32 byte
1630 // Default: null or empty if there is no active device for this profile
1631 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1632}
1633
Jack Heab86dbd22018-12-18 15:43:27 -08001634// Logs when there is an event affecting Bluetooth device's link layer connection.
1635// - This event is triggered when there is a related HCI command or event
1636// - Users of this metrics can deduce Bluetooth device's connection state from these events
1637// - HCI commands are logged before the command is sent, after receiving command status, and after
1638// receiving command complete
1639// - HCI events are logged when they arrive
1640//
1641// Low level log from system/bt
1642//
1643// Bluetooth classic commands:
1644// - CMD_CREATE_CONNECTION
1645// - CMD_DISCONNECT
1646// - CMD_CREATE_CONNECTION_CANCEL
1647// - CMD_ACCEPT_CONNECTION_REQUEST
1648// - CMD_REJECT_CONNECTION_REQUEST
1649// - CMD_SETUP_ESCO_CONNECTION
1650// - CMD_ACCEPT_ESCO_CONNECTION
1651// - CMD_REJECT_ESCO_CONNECTION
1652// - CMD_ENH_SETUP_ESCO_CONNECTION
1653// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1654//
1655// Bluetooth low energy commands:
1656// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1657// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1658// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1659// - CMD_BLE_CLEAR_WHITE_LIST
1660// - CMD_BLE_ADD_WHITE_LIST
1661// - CMD_BLE_REMOVE_WHITE_LIST
1662//
1663// Bluetooth classic events:
1664// - EVT_CONNECTION_COMP
1665// - EVT_CONNECTION_REQUEST
1666// - EVT_DISCONNECTION_COMP
1667// - EVT_ESCO_CONNECTION_COMP
1668// - EVT_ESCO_CONNECTION_CHANGED
1669//
1670// Bluetooth low energy meta events:
1671// - BLE_EVT_CONN_COMPLETE_EVT
1672// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1673//
1674// Next tag: 10
1675message BluetoothLinkLayerConnectionEvent {
1676 // An identifier that can be used to match events for this device.
1677 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1678 // Salt: Randomly generated 256 bit value
1679 // Hash algorithm: HMAC-SHA256
1680 // Size: 32 byte
1681 // Default: null or empty if the device identifier is not known
1682 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1683 // Connection handle of this connection if available
1684 // Range: 0x0000 - 0x0EFF (12 bits)
1685 // Default: 0xFFFF if the handle is unknown
1686 optional int32 connection_handle = 2;
1687 // Direction of the link
1688 // Default: DIRECTION_UNKNOWN
1689 optional android.bluetooth.DirectionEnum direction = 3;
1690 // Type of this link
1691 // Default: LINK_TYPE_UNKNOWN
1692 optional android.bluetooth.LinkTypeEnum type = 4;
1693
1694 // Reason metadata for this link layer connection event, rules for interpretation:
1695 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1696 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1697 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1698 // set and valid, ignore hci_ble_event
1699
1700 // HCI command associated with this event
1701 // Default: CMD_UNKNOWN
1702 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1703 // HCI event associated with this event
1704 // Default: EVT_UNKNOWN
1705 optional android.bluetooth.hci.EventEnum hci_event = 6;
1706 // HCI BLE meta event associated with this event
1707 // Default: BLE_EVT_UNKNOWN
1708 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1709 // HCI command status code if this is triggerred by hci_cmd
1710 // Default: STATUS_UNKNOWN
1711 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1712 // HCI reason code associated with this event
1713 // Default: STATUS_UNKNOWN
1714 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1715}
1716
Howard Roe103fe22019-01-17 16:52:16 -08001717/**
1718 * Logs when a module is rolled back by Watchdog.
1719 *
1720 * Logged from: Rollback Manager
1721 */
1722message WatchdogRollbackOccurred {
1723 enum RollbackType {
1724 UNKNOWN = 0;
1725 ROLLBACK_INITIATE = 1;
1726 ROLLBACK_SUCCESS = 2;
1727 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001728 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001729 }
1730 optional RollbackType rollback_type = 1;
1731
1732 optional string package_name = 2;
1733
1734 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001735
1736 enum RollbackReasonType {
1737 REASON_UNKNOWN = 0;
1738 REASON_NATIVE_CRASH = 1;
1739 REASON_EXPLICIT_HEALTH_CHECK = 2;
1740 REASON_APP_CRASH = 3;
1741 REASON_APP_NOT_RESPONDING = 4;
1742 }
1743 optional RollbackReasonType rollback_reason = 4;
1744
1745 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1746 // is initiated. Empty if the package is unknown.
1747 optional string failing_package_name = 5;
Howard Roe103fe22019-01-17 16:52:16 -08001748}
1749
Jack Hec27040a2019-01-09 20:54:41 -08001750/**
1751 * Logs when there is a change in Bluetooth A2DP playback state
1752 *
1753 * Logged from:
1754 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1755 */
1756message BluetoothA2dpPlaybackStateChanged {
1757 // An identifier that can be used to match events for this device.
1758 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1759 // Salt: Randomly generated 256 bit value
1760 // Hash algorithm: HMAC-SHA256
1761 // Size: 32 byte
1762 // Default: null or empty if the device identifier is not known
1763 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1764 // Current playback state
1765 // Default: PLAYBACK_STATE_UNKNOWN
1766 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1767 // Current audio coding mode
1768 // Default: AUDIO_CODING_MODE_UNKNOWN
1769 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1770}
1771
1772/**
1773 * Logs when there is a change in A2DP codec config for a particular remote device
1774 *
1775 * Logged from:
1776 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1777 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1778 */
1779message BluetoothA2dpCodecConfigChanged {
1780 // An identifier that can be used to match events for this device.
1781 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1782 // Salt: Randomly generated 256 bit value
1783 // Hash algorithm: HMAC-SHA256
1784 // Size: 32 byte
1785 // Default: null or empty if the device identifier is not known
1786 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1787 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1788 // Default SOURCE_CODEC_TYPE_INVALID
1789 optional int32 codec_type = 2;
1790 // Codec priroity, the higher the more preferred, -1 for disabled
1791 // Default: CODEC_PRIORITY_DEFAULT
1792 optional int32 codec_priority = 3;
1793 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1794 // Default: SAMPLE_RATE_NONE
1795 optional int32 sample_rate = 4;
1796 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1797 // Default: BITS_PER_SAMPLE_NONE
1798 optional int32 bits_per_sample = 5;
1799 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1800 // Default: CHANNEL_MODE_NONE
1801 optional int32 channel_mode = 6;
1802 // Codec specific values
1803 // Default 0
1804 optional int64 codec_specific_1 = 7;
1805 optional int64 codec_specific_2 = 8;
1806 optional int64 codec_specific_3 = 9;
1807 optional int64 codec_specific_4 = 10;
1808}
1809
1810/**
1811 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1812 * Each codec's capability is logged separately due to statsd restriction
1813 *
1814 * Logged from:
1815 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1816 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1817 */
1818message BluetoothA2dpCodecCapabilityChanged {
1819 // An identifier that can be used to match events for this device.
1820 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1821 // Salt: Randomly generated 256 bit value
1822 // Hash algorithm: HMAC-SHA256
1823 // Size: 32 byte
1824 // Default: null or empty if the device identifier is not known
1825 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1826 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1827 // Default SOURCE_CODEC_TYPE_INVALID
1828 optional int32 codec_type = 2;
1829 // Codec priroity, the higher the more preferred, -1 for disabled
1830 // Default: CODEC_PRIORITY_DEFAULT
1831 optional int32 codec_priority = 3;
1832 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1833 // in BluetoothCodecConfig
1834 // Default: empty and SAMPLE_RATE_NONE for individual item
1835 optional int32 sample_rate = 4;
1836 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1837 // in BluetoothCodecConfig
1838 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1839 optional int32 bits_per_sample = 5;
1840 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1841 // BluetoothCodecConfig
1842 // Default: empty and CHANNEL_MODE_NONE for individual item
1843 optional int32 channel_mode = 6;
1844 // Codec specific values
1845 // Default 0
1846 optional int64 codec_specific_1 = 7;
1847 optional int64 codec_specific_2 = 8;
1848 optional int64 codec_specific_3 = 9;
1849 optional int64 codec_specific_4 = 10;
1850}
1851
1852/**
1853 * Logs when A2DP failed to read from PCM source.
1854 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1855 *
1856 * Logged from:
1857 * system/bt
1858 */
1859message BluetoothA2dpAudioUnderrunReported {
1860 // An identifier that can be used to match events for this device.
1861 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1862 // Salt: Randomly generated 256 bit value
1863 // Hash algorithm: HMAC-SHA256
1864 // Size: 32 byte
1865 // Default: null or empty if the device identifier is not known
1866 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1867 // Encoding interval in nanoseconds
1868 // Default: 0
1869 optional int64 encoding_interval_nanos = 2;
1870 // Number of bytes of PCM data that could not be read from the source
1871 // Default: 0
1872 optional int32 num_missing_pcm_bytes = 3;
1873}
1874
1875/**
1876 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1877 * buffer queue is full and we have to drop data
1878 *
1879 * Logged from:
1880 * system/bt
1881 */
1882message BluetoothA2dpAudioOverrunReported {
1883 // An identifier that can be used to match events for this device.
1884 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1885 // Salt: Randomly generated 256 bit value
1886 // Hash algorithm: HMAC-SHA256
1887 // Size: 32 byte
1888 // Default: null or empty if the device identifier is not known
1889 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1890 // Encoding interval in nanoseconds
1891 // Default: 0
1892 optional int64 encoding_interval_nanos = 2;
1893 // Number of buffers dropped in this event
1894 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1895 // Default: 0
1896 optional int32 num_dropped_buffers = 3;
1897 // Number of encoded buffers dropped in this event
1898 // Default 0
1899 optional int32 num_dropped_encoded_frames = 4;
1900 // Number of encoded bytes dropped in this event
1901 // Default: 0
1902 optional int32 num_dropped_encoded_bytes = 5;
1903}
1904
1905/**
1906 * Logs when we receive reports regarding a device's RSSI value
1907 *
1908 * Logged from:
1909 * system/bt
1910 */
1911message BluetoothDeviceRssiReported {
1912 // An identifier that can be used to match events for this device.
1913 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1914 // Salt: Randomly generated 256 bit value
1915 // Hash algorithm: HMAC-SHA256
1916 // Size: 32 byte
1917 // Default: null or empty if the device identifier is not known
1918 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1919 // Connection handle of this connection if available
1920 // Range: 0x0000 - 0x0EFF (12 bits)
1921 // Default: 0xFFFF if the handle is unknown
1922 optional int32 connection_handle = 2;
1923 // HCI command status code if this is triggerred by hci_cmd
1924 // Default: STATUS_UNKNOWN
1925 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1926 // BR/EDR
1927 // Range: -128 ≤ N ≤ 127 (signed integer)
1928 // Units: dB
1929 // LE:
1930 // Range: -127 to 20, 127 (signed integer)
1931 // Units: dBm
1932 // Invalid when an out of range value is reported
1933 optional int32 rssi = 4;
1934}
1935
1936/**
1937 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1938 *
1939 * Logged from:
1940 * system/bt
1941 */
1942message BluetoothDeviceFailedContactCounterReported {
1943 // An identifier that can be used to match events for this device.
1944 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1945 // Salt: Randomly generated 256 bit value
1946 // Hash algorithm: HMAC-SHA256
1947 // Size: 32 byte
1948 // Default: null or empty if the device identifier is not known
1949 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1950 // Connection handle of this connection if available
1951 // Range: 0x0000 - 0x0EFF (12 bits)
1952 // Default: 0xFFFF if the handle is unknown
1953 optional int32 connection_handle = 2;
1954 // HCI command status code if this is triggerred by hci_cmd
1955 // Default: STATUS_UNKNOWN
1956 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1957 // Number of consecutive failed contacts for a connection corresponding to the Handle
1958 // Range: uint16_t, 0-0xFFFF
1959 // Default: 0xFFFFF
1960 optional int32 failed_contact_counter = 4;
1961}
1962
1963/**
1964 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1965 *
1966 * Logged from:
1967 * system/bt
1968 */
1969message BluetoothDeviceTxPowerLevelReported {
1970 // An identifier that can be used to match events for this device.
1971 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1972 // Salt: Randomly generated 256 bit value
1973 // Hash algorithm: HMAC-SHA256
1974 // Size: 32 byte
1975 // Default: null or empty if the device identifier is not known
1976 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1977 // Connection handle of this connection if available
1978 // Range: 0x0000 - 0x0EFF (12 bits)
1979 // Default: 0xFFFF if the handle is unknown
1980 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001981 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001982 // Default: STATUS_UNKNOWN
1983 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1984 // Range: -30 ≤ N ≤ 20
1985 // Units: dBm
1986 // Invalid when an out of range value is reported
1987 optional int32 transmit_power_level = 4;
1988}
Jack Heab86dbd22018-12-18 15:43:27 -08001989
Tej Singh5d991e12018-03-09 19:48:11 -08001990/**
Jack He1021a612019-01-20 21:22:46 -08001991 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1992 * receiving an HCI command from the host
1993 *
1994 * Logged from: system/bt
1995 */
1996message BluetoothHciTimeoutReported {
1997 // HCI command associated with this event
1998 // Default: CMD_UNKNOWN
1999 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2000}
2001
2002/**
2003 * Logs when we receive Bluetooth Link Quality Report event from the controller
2004 * See Android Bluetooth HCI specification for more details
2005 *
2006 * Note: all count and bytes field are counted since last event
2007 *
2008 * Logged from: system/bt
2009 */
2010message BluetoothQualityReportReported {
2011 // Quality report ID
2012 // Original type: uint8_t
2013 // Default: BQR_ID_UNKNOWN
2014 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2015 // Packet type of the connection
2016 // Original type: uint8_t
2017 // Default: BQR_PACKET_TYPE_UNKNOWN
2018 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2019 // Connection handle of the connection
2020 // Original type: uint16_t
2021 optional int32 connection_handle = 3;
2022 // Performing Role for the connection
2023 // Original type: uint8_t
2024 optional int32 connection_role = 4;
2025 // Current Transmit Power Level for the connection. This value is the same as the controller's
2026 // response to the HCI_Read_Transmit_Power_Level HCI command
2027 // Original type: uint8_t
2028 optional int32 tx_power_level = 5;
2029 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2030 // absolute receiver signal strength value
2031 // Original type: int8_t
2032 optional int32 rssi = 6;
2033 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2034 // channels used by the link currently
2035 // Original type: uint8_t
2036 optional int32 snr = 7;
2037 // Indicates the number of unused channels in AFH_channel_map
2038 // Original type: uint8_t
2039 optional int32 unused_afh_channel_count = 8;
2040 // Indicates the number of the channels which are interfered and quality is bad but are still
2041 // selected for AFH
2042 // Original type: uint8_t
2043 optional int32 afh_select_unideal_channel_count = 9;
2044 // Current Link Supervision Timeout Setting
2045 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2046 // Original type: uint16_t
2047 optional int32 lsto = 10;
2048 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2049 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2050 // 0x01 (Piconet Clock)
2051 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2052 // Original type: uint32_t
2053 optional int64 connection_piconet_clock = 11;
2054 // The count of retransmission
2055 // Original type: uint32_t
2056 optional int64 retransmission_count = 12;
2057 // The count of no RX
2058 // Original type: uint32_t
2059 optional int64 no_rx_count = 13;
2060 // The count of NAK (Negative Acknowledge)
2061 // Original type: uint32_t
2062 optional int64 nak_count = 14;
2063 // Controller timestamp of last TX ACK
2064 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2065 // Original type: uint32_t
2066 optional int64 last_tx_ack_timestamp = 15;
2067 // The count of Flow-off (STOP)
2068 // Original type: uint32_t
2069 optional int64 flow_off_count = 16;
2070 // Controller timestamp of last Flow-on (GO)
2071 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2072 // Original type: uint32_t
2073 optional int64 last_flow_on_timestamp = 17;
2074 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2075 // Original type: uint32_t
2076 optional int64 buffer_overflow_bytes = 18;
2077 // Buffer underflow count (in byte) since last event
2078 // Original type: uint32_t
2079 optional int64 buffer_underflow_bytes = 19;
2080}
2081
2082/**
2083 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2084 *
2085 * Notes:
2086 * - Each event can be partially filled as we might learn different pieces of device
2087 * information at different time
2088 * - Multiple device info events can be combined to give more complete picture
2089 * - When multiple device info events tries to describe the same information, the
2090 * later one wins
2091 *
2092 * Logged from:
2093 * packages/apps/Bluetooth
2094 */
Jack Heaea26982019-04-04 11:19:48 -07002095message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002096 // An identifier that can be used to match events for this device.
2097 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2098 // Salt: Randomly generated 256 bit value
2099 // Hash algorithm: HMAC-SHA256
2100 // Size: 32 byte
2101 // Default: null or empty if the device identifier is not known
2102 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2103 // Where is this device info obtained from
2104 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2105 // Name of the data source
2106 // For EXTERNAL: package name of the data source
2107 // For INTERNAL: null for general case, component name otherwise
2108 optional string source_name = 3;
2109 // Name of the manufacturer of this device
2110 optional string manufacturer = 4;
2111 // Model of this device
2112 optional string model = 5;
2113 // Hardware version of this device
2114 optional string hardware_version = 6;
2115 // Software version of this device
2116 optional string software_version = 7;
2117}
2118
2119/**
2120 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2121 * device, as documented by the Bluetooth Core HCI specification
2122 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2123 * Vol 2, Part E, Page 1118
2124 *
2125 * Logged from:
2126 * system/bt
2127 */
2128message BluetoothRemoteVersionInfoReported {
2129 // Connection handle of the connection
2130 // Original type: uint16_t
2131 optional int32 connection_handle = 1;
2132 // HCI command status code
2133 // Default: STATUS_UNKNOWN
2134 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2135 // 1 byte Version of current LMP in the remote controller
2136 optional int32 lmp_version = 3;
2137 // 2 bytes LMP manufacturer code of the remote controller
2138 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2139 optional int32 lmp_manufacturer_code = 4;
2140 // 4 bytes subversion of the LMP in the remote controller
2141 optional int32 lmp_subversion = 5;
2142}
2143
2144/**
2145 * Logs when certain Bluetooth SDP attributes are discovered
2146 * Constant definitions are from:
2147 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2148 *
2149 * Current logged attributes:
2150 * - BluetoothProfileDescriptorList
2151 * - Supported Features Bitmask
2152 *
2153 * Logged from:
2154 * system/bt
2155 */
2156message BluetoothSdpAttributeReported {
2157 // An identifier that can be used to match events for this device.
2158 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2159 // Salt: Randomly generated 256 bit value
2160 // Hash algorithm: HMAC-SHA256
2161 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2162 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2163 // Original type: uint16_t
2164 optional int32 protocol_uuid = 2;
2165 // Short form UUIDs used to identify Bluetooth SDP attribute types
2166 // Original type: uint16_t
2167 optional int32 attribute_id = 3;
2168 // Attribute value for the particular attribute
2169 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2170}
2171
2172/**
2173 * Logs when bond state of a Bluetooth device changes
2174 *
2175 * Logged from:
2176 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2177 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2178 */
2179message BluetoothBondStateChanged {
2180 // An identifier that can be used to match events for this device.
2181 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2182 // Salt: Randomly generated 256 bit value
2183 // Hash algorithm: HMAC-SHA256
2184 // Size: 32 byte
2185 // Default: null or empty if the device identifier is not known
2186 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2187 // Preferred transport type to remote dual mode device
2188 // Default: TRANSPORT_AUTO means no preference
2189 optional android.bluetooth.TransportTypeEnum transport = 2;
2190 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2191 // Default: UNKNOWN
2192 optional android.bluetooth.DeviceTypeEnum type = 3;
2193 // Current bond state (NONE, BONDING, BONDED)
2194 // Default: BOND_STATE_UNKNOWN
2195 optional android.bluetooth.BondStateEnum bond_state = 4;
2196 // Bonding sub state
2197 // Default: BOND_SUB_STATE_UNKNOWN
2198 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2199 // Unbond Reason
2200 // Default: UNBOND_REASON_UNKNOWN
2201 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2202}
2203
2204/**
2205 * Logs there is an event related Bluetooth classic pairing
2206 *
2207 * Logged from:
2208 * system/bt
2209 */
2210message BluetoothClassicPairingEventReported {
2211 // An identifier that can be used to match events for this device.
2212 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2213 // Salt: Randomly generated 256 bit value
2214 // Hash algorithm: HMAC-SHA256
2215 // Size: 32 byte
2216 // Default: null or empty if the device identifier is not known
2217 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2218 // Connection handle of this connection if available
2219 // Range: 0x0000 - 0x0EFF (12 bits)
2220 // Default: 0xFFFF if the handle is unknown
2221 optional int32 connection_handle = 2;
2222 // HCI command associated with this event
2223 // Default: CMD_UNKNOWN
2224 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2225 // HCI event associated with this event
2226 // Default: EVT_UNKNOWN
2227 optional android.bluetooth.hci.EventEnum hci_event = 4;
2228 // HCI command status code if this is triggerred by hci_cmd
2229 // Default: STATUS_UNKNOWN
2230 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2231 // HCI reason code associated with this event
2232 // Default: STATUS_UNKNOWN
2233 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002234 // A status value related to this specific event
2235 // Default: 0
2236 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002237}
2238
2239/**
2240 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2241 *
2242 * Logged from:
2243 * system/bt
2244 */
2245message BluetoothSmpPairingEventReported {
2246 // An identifier that can be used to match events for this device.
2247 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2248 // Salt: Randomly generated 256 bit value
2249 // Hash algorithm: HMAC-SHA256
2250 // Size: 32 byte
2251 // Default: null or empty if the device identifier is not known
2252 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2253 // SMP command sent or received over L2CAP
2254 // Default: CMD_UNKNOWN
2255 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2256 // Whether this command is sent or received
2257 // Default: DIRECTION_UNKNOWN
2258 optional android.bluetooth.DirectionEnum direction = 3;
2259 // SMP failure reason code
2260 // Default: PAIRING_FAIL_REASON_DEFAULT
2261 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2262}
2263
2264/**
Jack He815cdba2019-01-30 17:24:55 -08002265 * Logs when a Bluetooth socket’s connection state changed
2266 *
2267 * Logged from:
2268 * system/bt
2269 */
2270message BluetoothSocketConnectionStateChanged {
2271 // An identifier that can be used to match events for this device.
2272 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2273 // Salt: Randomly generated 256 bit value
2274 // Hash algorithm: HMAC-SHA256
2275 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002276 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002277 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002278 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002279 // Default 0 when unknown or don't care
2280 optional int32 port = 2;
2281 // Socket type as mentioned in
2282 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2283 // Default: SOCKET_TYPE_UNKNOWN
2284 optional android.bluetooth.SocketTypeEnum type = 3;
2285 // Socket connection state
2286 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2287 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2288 // Number of bytes sent to remote device during this connection
2289 optional int64 tx_bytes = 5;
2290 // Number of bytes received from remote device during this connection
2291 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002292 // Socket owner's UID
2293 optional int32 uid = 7 [(is_uid) = true];
2294 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2295 // |port| must be spawned by |server_port|
2296 // Default 0 when unknown or don't care
2297 optional int32 server_port = 8;
2298 // Whether this is a server listener socket
2299 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002300}
2301
2302/**
Jack He71426802019-04-02 13:32:52 -07002303 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2304 *
2305 * Logged from:
2306 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2307 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2308 *
2309 */
2310message BluetoothClassOfDeviceReported {
2311 // An identifier that can be used to match events for this device.
2312 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2313 // Salt: Randomly generated 256 bit value
2314 // Hash algorithm: HMAC-SHA256
2315 // Size: 32 byte
2316 // Default: null or empty if this is a server listener socket
2317 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2318 // Class of Device (CoD) value including both Major, Minor device class and service class
2319 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2320 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2321 // Default: 0
2322 optional int32 class_of_device = 2;
2323}
2324
2325/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002326 * Logs when something is plugged into or removed from the USB-C connector.
2327 *
2328 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002329 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002330 */
2331message UsbConnectorStateChanged {
2332 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002333 STATE_DISCONNECTED = 0;
2334 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002335 }
2336 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002337 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002338 // Last active session in ms.
2339 // 0 when the port is in connected state.
2340 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002341}
2342
2343/**
2344 * Logs the reported speaker impedance.
2345 *
2346 * Logged from:
2347 * Vendor audio implementation.
2348 */
2349message SpeakerImpedanceReported {
2350 optional int32 speaker_location = 1;
2351 optional int32 impedance = 2;
2352}
2353
2354/**
2355 * Logs the report of a failed hardware.
2356 *
2357 * Logged from:
2358 * Vendor HALs.
2359 *
2360 */
2361message HardwareFailed {
2362 enum HardwareType {
2363 HARDWARE_FAILED_UNKNOWN = 0;
2364 HARDWARE_FAILED_MICROPHONE = 1;
2365 HARDWARE_FAILED_CODEC = 2;
2366 HARDWARE_FAILED_SPEAKER = 3;
2367 HARDWARE_FAILED_FINGERPRINT = 4;
2368 }
2369 optional HardwareType hardware_type = 1;
2370
Maggie White6dcd8572019-01-31 14:11:50 -08002371 /**
2372 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002373 * the same hardware_type. The specific locations are vendor defined integers,
2374 * referring to board-specific numbering schemes.
2375 */
2376 optional int32 hardware_location = 2;
2377
Maggie White6dcd8572019-01-31 14:11:50 -08002378 /**
2379 * failure_code is specific to the HardwareType of the failed hardware.
2380 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002381 */
Maggie White6dcd8572019-01-31 14:11:50 -08002382 enum HardwareErrorCode {
2383 UNKNOWN = 0;
2384 COMPLETE = 1;
2385 SPEAKER_HIGH_Z = 2;
2386 SPEAKER_SHORT = 3;
2387 FINGERPRINT_SENSOR_BROKEN = 4;
2388 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002389 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002390 }
2391 optional int32 failure_code = 3;
2392}
2393
2394/**
2395 * Log an event when the device has been physically dropped.
2396 * Reported from the /vendor partition.
2397 */
2398message PhysicalDropDetected {
2399 // Confidence that the event was actually a drop, 0 -> 100
2400 optional int32 confidence_pctg = 1;
2401 // Peak acceleration of the drop, in 1/1000s of a g.
2402 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002403 // Duration of freefall in ms
2404 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002405}
2406
2407/**
2408 * Log bucketed battery charge cycles.
2409 *
2410 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002411 * a given charge point. For example, if 10 cycle buckets are
2412 * initialized, bucket 1 is the lowest 1/10th of the battery,
2413 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002414 *
2415 * Logged from:
2416 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2417 */
2418message ChargeCyclesReported {
2419 optional int32 cycle_bucket_1 = 1;
2420 optional int32 cycle_bucket_2 = 2;
2421 optional int32 cycle_bucket_3 = 3;
2422 optional int32 cycle_bucket_4 = 4;
2423 optional int32 cycle_bucket_5 = 5;
2424 optional int32 cycle_bucket_6 = 6;
2425 optional int32 cycle_bucket_7 = 7;
2426 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002427 optional int32 cycle_bucket_9 = 9;
2428 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002429}
2430
2431/**
Howard Roa46b6582018-09-18 16:45:02 -07002432 * Log battery health snapshot.
2433 *
2434 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2435 * are snapshotted periodically over 24hrs.
2436 */
2437message BatteryHealthSnapshot {
2438 enum BatterySnapshotType {
2439 UNKNOWN = 0;
2440 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2441 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2442 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2443 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2444 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2445 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2446 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2447 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2448 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2449 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2450 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2451 }
2452 optional BatterySnapshotType type = 1;
2453 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002454 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002455 // Voltage Battery Voltage, in microVolts.
2456 optional int32 voltage_micro_volt = 3;
2457 // Current Battery current, in microAmps.
2458 optional int32 current_micro_amps = 4;
2459 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2460 optional int32 open_circuit_micro_volt = 5;
2461 // Resistance Battery Resistance, in microOhms.
2462 optional int32 resistance_micro_ohm = 6;
2463 // Level Battery Level, as % of full.
2464 optional int32 level_percent = 7;
2465}
2466
2467/**
2468 * Log slow I/O operations on the primary storage.
2469 */
2470message SlowIo {
2471 // Classifications of IO Operations.
2472 enum IoOperation {
2473 UNKNOWN = 0;
2474 READ = 1;
2475 WRITE = 2;
2476 UNMAP = 3;
2477 SYNC = 4;
2478 }
2479 optional IoOperation operation = 1;
2480
2481 // The number of slow IO operations of this type over 24 hours.
2482 optional int32 count = 2;
2483}
2484
2485/**
2486 * Log battery caused shutdown with the last recorded voltage.
2487 */
2488message BatteryCausedShutdown {
2489 // The last recorded battery voltage prior to shutdown.
2490 optional int32 last_recorded_micro_volt = 1;
2491}
2492
2493/**
Tej Singha72344992019-04-17 18:55:08 -07002494 * Logs when ThermalService receives throttling events.
2495 *
2496 * Logged from:
2497 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2498 */
2499message ThermalThrottlingSeverityStateChanged {
2500 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2501 optional android.os.TemperatureTypeEnum sensor_type = 1;
2502
2503 // The name of the temperature source. Eg. CPU0
2504 optional string sensor_name = 2;
2505
2506 // Temperature in tenths of a degree C.
2507 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2508 optional int32 temperature_deci_celsius = 3;
2509
2510 // Relative severity of the throttling, see enum definition.
2511 optional android.os.ThrottlingSeverityEnum severity = 4;
2512}
2513
2514/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002515 * Logs the duration of a davey (jank of >=700ms) when it occurs
2516 *
2517 * Logged from:
2518 * frameworks/base/libs/hwui/JankTracker.cpp
2519 */
2520message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002521 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002522 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002523
Tej Singhbb8554a2018-01-26 11:59:14 -08002524 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002525 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002526}
2527
2528/**
Bookatze5885242017-10-24 20:10:31 -07002529 * Logs phone signal strength changes.
2530 *
2531 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002532 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002533 */
2534message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002535 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2536 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002537}
2538
Yangster4ccebea2018-10-09 17:09:02 -07002539
2540/**
2541 * Logs when the phone state, sim state or signal strength changes
2542 *
2543 * Logged from:
2544 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2545 */
2546message PhoneServiceStateChanged {
2547 optional android.telephony.ServiceStateEnum state = 1;
2548 optional android.telephony.SimStateEnum sim_state = 2;
2549 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2550}
2551
2552/**
2553 * Logs when the phone becomes on or off.
2554 *
2555 * Logged from:
2556 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2557 */
2558message PhoneStateChanged {
2559 enum State {
2560 OFF = 0;
2561 ON = 1;
2562 }
2563 optional State state = 1;
2564}
2565
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002566message BackGesture {
2567 enum BackType {
2568 DEFAULT_BACK_TYPE = 0;
2569 COMPLETED = 1;
2570 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2571 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2572 INCOMPLETE = 4;
2573 }
2574 optional BackType type = 1;
2575
2576 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2577 enum WindowHorizontalLocation {
2578 DEFAULT_LOCATION = 0;
2579 LEFT = 1;
2580 RIGHT = 2;
2581 }
2582 optional WindowHorizontalLocation x_location = 3;
2583}
2584
2585message ExclusionRectStateChanged {
2586 optional string component_name = 1; // if not available, simply packageName
2587 optional int32 requested_height = 2; // px
2588 optional int32 rejected_height = 3; // px
2589
2590 enum WindowHorizontalLocation {
2591 DEFAULT_LOCATION = 0;
2592 LEFT = 1;
2593 RIGHT = 2;
2594 }
2595 optional WindowHorizontalLocation x_location = 4;
2596 optional bool landscape = 5;
2597 optional bool splitscreen = 6;
2598 optional int32 duration_millis = 7;
2599}
2600
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002601message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002602 optional android.stats.launcher.LauncherAction action = 1;
2603 optional android.stats.launcher.LauncherState src_state = 2;
2604 optional android.stats.launcher.LauncherState dst_state = 3;
2605 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002606 optional bool is_swipe_up_enabled = 5;
2607}
2608
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002609message StyleUIChanged {
2610 optional android.stats.style.Action action = 1;
2611 optional int32 color_package_hash = 2;
2612 optional int32 font_package_hash = 3;
2613 optional int32 shape_package_hash = 4;
2614 optional int32 clock_package_hash = 5;
2615 optional int32 launcher_grid = 6;
2616 optional int32 wallpaper_category_hash = 7;
2617 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002618 optional int32 color_preference = 9;
2619 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002620}
2621
David Chenc28b2bb2017-10-24 12:52:52 -07002622/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002623 * Logs when Settings UI has changed.
2624 *
2625 * Logged from:
2626 * packages/apps/Settings
2627 */
2628message SettingsUIChanged {
2629 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002630 * Where this SettingsUIChange event comes from. For example, if
2631 * it's a PAGE_VISIBLE event, where the page is opened from.
2632 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002633 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002634
2635 /**
2636 * What the UI action is.
2637 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002638 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002639
2640 /**
2641 * Where the action is happening
2642 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002643 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002644
2645 /**
2646 * What preference changed in this event.
2647 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002648 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002649
2650 /**
2651 * The new value of the changed preference.
2652 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002653 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002654}
2655
2656/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002657 * Logs basic timing information about touch events.
2658 * Reported at most every 5 minutes while device is being interacted with.
2659 *
2660 * Logged from:
2661 * frameworks/native/services/inputflinger
2662 */
2663message TouchEventReported {
2664 /**
2665 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002666 * and the standard deviation of the time spent processing touchscreen events
2667 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002668 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002669 * On supported devices, the starting point is taken during the hard interrupt inside the
2670 * kernel touch driver. On all other devices, the starting point is taken inside
2671 * the kernel's input event subsystem upon receipt of the input event.
2672 * The ending point is taken inside InputDispatcher, just after the input event
2673 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002674 */
2675 // Minimum value
2676 optional float latency_min_micros = 1;
2677 // Maximum value
2678 optional float latency_max_micros = 2;
2679 // Average value
2680 optional float latency_mean_micros = 3;
2681 // Standard deviation
2682 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002683 // Number of touch events (input_event) in this report
2684 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002685}
2686
2687/**
Philip Quinn0eded622019-01-29 12:46:28 -08002688 * Logs gesture classification and timing information for touch events.
2689 *
2690 * Logged from:
2691 * frameworks/base/core/java/android/view/GestureDetector.java
2692 * frameworks/base/core/java/android/view/View.java
2693 */
2694message TouchGestureClassified {
2695 // The source of the classification (e.g. Java class name).
2696 optional string source = 1;
2697
2698 enum Classification {
2699 UNKNOWN_CLASSIFICATION = 0;
2700 SINGLE_TAP = 1;
2701 DOUBLE_TAP = 2;
2702 LONG_PRESS = 3;
2703 DEEP_PRESS = 4;
2704 SCROLL = 5;
2705 }
2706 // The classification of the gesture.
2707 optional Classification classification = 2;
2708
2709 // The interval from the start of a touch event stream until the
2710 // classification was made.
2711 optional int32 latency_millis = 3;
2712
2713 // The distance from the location of the first touch event to the
2714 // location of the touch event when the classification was made.
2715 optional float displacement_px = 4;
2716}
2717
2718/**
David Chenc28b2bb2017-10-24 12:52:52 -07002719 * Logs that a setting was updated.
2720 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002721 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002722 * The tag and is_default allow resetting of settings to default values based on the specified
2723 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2724 */
2725message SettingChanged {
2726 // The name of the setting.
2727 optional string setting = 1;
2728
2729 // The change being imposed on this setting. May represent a number, eg "3".
2730 optional string value = 2;
2731
2732 // The new value of this setting. For most settings, this is same as value. For some settings,
2733 // value is +X or -X where X represents an element in a set. For example, if the previous value
2734 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2735 // The +/- feature is currently only used for location_providers_allowed.
2736 optional string new_value = 3;
2737
2738 // The previous value of this setting.
2739 optional string prev_value = 4;
2740
2741 // The tag used with the is_default for resetting sets of settings. This is generally null.
2742 optional string tag = 5;
2743
Bookatz90867622018-01-31 15:05:57 -08002744 // True if this setting with tag should be resettable.
2745 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002746
David Chenbd789912018-03-16 17:19:55 -07002747 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002748 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002749
2750 enum ChangeReason {
2751 UPDATED = 1; // Updated can be an insertion or an update.
2752 DELETED = 2;
2753 }
2754 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002755}
Chenjie Yub3dda412017-10-24 13:41:59 -07002756
Chenjie Yu05013b32017-11-21 10:21:41 -08002757/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002758 * Logs activity going to foreground or background
2759 *
2760 * Logged from:
2761 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2762 */
2763message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002764 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002765 optional string pkg_name = 2;
2766 optional string class_name = 3;
2767
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002768 enum State {
2769 BACKGROUND = 0;
2770 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002771 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002772 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002773}
David Chenc8a43242017-10-17 16:23:28 -07002774
2775/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002776 * Logs when a volume entered low Storage state.
2777 * Logged from:
2778 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2779 */
2780message LowStorageStateChanged {
2781 // Volume that ran out of storage.
2782 optional string volume_description = 1;
2783
2784 enum State {
2785 UNKNOWN = 0;
2786 OFF = 1;
2787 ON = 2;
2788 }
2789 optional State state = 2;
2790}
2791
2792/**
2793 * Logs when an app is downgraded.
2794 * Logged from:
2795 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2796 */
2797message AppDowngraded {
2798 optional string package_name = 1;
2799 // Size of the package (all data) before being downgraded.
2800 optional int64 size_in_bytes_before = 2;
2801 // Size of the package (all data) after being downgraded.
2802 optional int64 size_in_bytes_after = 3;
2803
2804 optional bool aggressive = 4;
2805}
2806
2807/**
2808 * Logs when an app is optimized after being downgraded.
2809 * Logged from:
2810 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2811 */
2812message AppOptimizedAfterDowngraded {
2813 optional string package_name = 1;
2814}
2815
2816/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002817 * Logs whenever an app is installed on external storage.
2818 * Logged from:
2819 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2820 */
2821message AppInstallOnExternalStorageReported {
2822 // The type of external storage.
2823 optional android.stats.storage.ExternalStorageType storage_type = 1;
2824 // The name of the package that is installed on the sd card.
2825 optional string package_name = 2;
2826}
2827
2828/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002829 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002830 * Logged from:
2831 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2832 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002833message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002834 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002835
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002836 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002837
2838 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002839 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002840 optional string process_name = 3;
2841
2842 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002843 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002844
2845 optional string package_name = 5;
2846
2847 enum InstantApp {
2848 UNAVAILABLE = 0;
2849 FALSE = 1;
2850 TRUE = 2;
2851 }
2852 optional InstantApp is_instant_app = 6;
2853
2854 enum ForegroundState {
2855 UNKNOWN = 0;
2856 BACKGROUND = 1;
2857 FOREGROUND = 2;
2858 }
2859 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002860
2861 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002862}
David Chen9e3808c2017-11-20 17:25:34 -08002863
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002864/**
2865 * Logs when a WTF (What a Terrible Failure) happened.
2866 * Logged from:
2867 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2868 */
2869message WTFOccurred {
2870 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002871
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002872 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002873
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002874 // The name of the process.
2875 // system_server if it is not by an app
2876 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002877
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002878 // The pid if available. -1 means not available.
2879 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002880
2881 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002882}
2883
2884/**
2885 * Logs when system server reports low memory.
2886 * Logged from:
2887 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2888 */
2889message LowMemReported {
2890}
2891
2892/**
2893 * Logs when an app ANR (App Not Responding) occurs.
2894 * Logged from:
2895 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2896 */
2897message ANROccurred {
2898 optional int32 uid = 1 [(is_uid) = true];
2899
2900 optional string process_name = 2;
2901
2902 optional string short_component_name = 3;
2903
2904 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002905
2906 enum InstantApp {
2907 UNAVAILABLE = 0;
2908 FALSE = 1;
2909 TRUE = 2;
2910 }
2911 optional InstantApp is_instant_app = 5;
2912
2913 enum ForegroundState {
2914 UNKNOWN = 0;
2915 BACKGROUND = 1;
2916 FOREGROUND = 2;
2917 }
2918 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002919
2920 optional android.server.ErrorSource error_source = 7;
2921
2922 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002923}
2924
Bookatza7020bd2018-08-28 16:29:35 -07002925/**
2926 * Logs when the vibrator state changes.
2927 * Logged from:
2928 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2929 */
2930message VibratorStateChanged {
2931 repeated AttributionNode attribution_node = 1;
2932
2933 enum State {
2934 OFF = 0;
2935 ON = 1;
2936 }
2937 optional State state = 2;
2938
2939 // Duration (in milliseconds) requested to keep the vibrator on.
2940 // Only applicable for State == ON.
2941 optional int64 duration_millis = 3;
2942}
2943
David Chen0a368b22017-12-06 16:28:16 -08002944/*
2945 * Allows other apps to push events into statsd.
2946 * Logged from:
2947 * frameworks/base/core/java/android/util/StatsLog.java
2948 */
David Chen0b5c90c2018-01-25 16:51:49 -08002949message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002950 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002951 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002952
2953 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2954 optional int32 label = 2;
2955
2956 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2957 // predicates for the metrics).
2958 enum State {
2959 UNKNOWN = 0;
2960 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2961 STOP = 2;
2962 START = 3;
2963 }
2964 optional State state = 3;
2965}
2966
David Chen9e3808c2017-11-20 17:25:34 -08002967/**
Bookatz7948c872018-09-04 12:58:33 -07002968 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2969 * For example, this could be due to the user manually changing the time.
2970 *
2971 * Logged from:
2972 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2973 */
2974message WallClockTimeShifted {
2975 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2976 optional int64 wall_clock_timestamp_millis = 1;
2977}
2978
2979/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002980 * Logs when statsd detects an anomaly.
2981 *
2982 * Logged from:
2983 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2984 */
2985message AnomalyDetected {
2986 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002987 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002988
Yangster-mac94e197c2018-01-02 16:03:03 -08002989 // Id of the config whose anomaly detection alert fired.
2990 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002991
Yangster-mac94e197c2018-01-02 16:03:03 -08002992 // Id of the alert (i.e. name of the anomaly that was detected).
2993 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002994}
2995
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002996message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002997 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002998 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002999
3000 // The app package name.
3001 optional string pkg_name = 2;
3002
3003 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003004 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003005 WARM = 1;
3006 HOT = 2;
3007 COLD = 3;
3008 }
3009 // The transition type.
3010 optional TransitionType type = 3;
3011
3012 // The activity name.
3013 optional string activity_name = 4;
3014
3015 // The name of the calling app. Empty if not set.
3016 optional string calling_pkg_name = 5;
3017
3018 // Whether the app is an instant app.
3019 optional bool is_instant_app = 6;
3020
3021 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003022 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003023
Bookatz80d11a02018-01-16 10:46:35 -08003024 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003025
David Chen0b5c90c2018-01-25 16:51:49 -08003026 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003027 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003028 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003029 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003030 optional int32 bind_application_delay_millis = 11;
3031 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003032
3033 // Empty if not set.
3034 optional string launch_token = 13;
3035
Calin Juravle759fbda2018-02-20 19:52:30 +00003036 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003037 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003038
3039 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003040 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003041}
3042
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003043message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003044 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003045 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003046
3047 // The app package name.
3048 optional string pkg_name = 2;
3049
3050 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003051 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003052 WARM = 1;
3053 HOT = 2;
3054 COLD = 3;
3055 }
3056 // The transition type.
3057 optional TransitionType type = 3;
3058
3059 // The activity name.
3060 optional string activity_name = 4;
3061}
3062
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003063message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003064 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003065 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003066
3067 // The app package name.
3068 optional string pkg_name = 2;
3069
3070 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003071 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003072 WITH_BUNDLE = 1;
3073 WITHOUT_BUNDLE = 2;
3074 }
3075 // The transition type.
3076 optional TransitionType type = 3;
3077
3078 // The activity name.
3079 optional string activity_name = 4;
3080
3081 optional bool transition_process_running = 5;
3082
3083 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003084 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003085}
3086
Bookatz8fcd09a2017-12-18 13:01:10 -08003087/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003088 * Logs a picture-in-picture action
3089 * Logged from:
3090 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3091 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3092 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3093 */
3094message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003095 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003096 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003097
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003098 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003099
Chenjie Yu52cacc62017-12-08 18:11:45 -08003100 enum State {
3101 ENTERED = 1;
3102 EXPANDED_TO_FULL_SCREEN = 2;
3103 MINIMIZED = 3;
3104 DISMISSED = 4;
3105 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003106 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003107}
3108
3109/**
Chenjie Yue8904192017-12-08 19:12:57 -08003110 * Logs overlay action
3111 * Logged from:
3112 * services/core/java/com/android/server/wm/Session.java
3113 */
3114message OverlayStateChanged {
tsaichristine10978642019-09-10 14:12:49 -07003115 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003116
tsaichristine10978642019-09-10 14:12:49 -07003117 optional string package_name = 2 [(state_field_option).option = PRIMARY];
Chenjie Yue8904192017-12-08 19:12:57 -08003118
3119 optional bool using_alert_window = 3;
3120
3121 enum State {
3122 ENTERED = 1;
3123 EXITED = 2;
3124 }
tsaichristine10978642019-09-10 14:12:49 -07003125 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Chenjie Yue8904192017-12-08 19:12:57 -08003126}
3127
Chenjie Yuccfe6452018-01-30 11:33:21 -08003128/*
3129 * Logs foreground service starts and stops.
3130 * Note that this is not when a service starts or stops, but when it is
3131 * considered foreground.
3132 * Logged from
3133 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3134 */
3135message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003136 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003137 // package_name + "/" + class_name
3138 optional string short_name = 2;
3139
3140 enum State {
3141 ENTER = 1;
3142 EXIT = 2;
3143 }
3144 optional State state = 3;
3145}
3146
Chenjie Yue8904192017-12-08 19:12:57 -08003147/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003148 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3149 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3150 * attributed back to the parent (host) uid. One example is Chrome.
3151 *
3152 * Logged from:
3153 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3154 */
3155message IsolatedUidChanged {
3156 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003157 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003158 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003159 optional int32 parent_uid = 1;
3160
3161 optional int32 isolated_uid = 2;
3162
3163 // We expect an isolated uid to be removed before if it's used for another parent uid.
3164 enum Event {
3165 REMOVED = 0;
3166 CREATED = 1;
3167 }
3168 optional Event event = 3;
3169}
3170
3171/*
3172 * Logs the reception of an incoming network packet causing the main system to wake up for
3173 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3174 * and processed by WakeupController.cpp.
3175 */
3176message PacketWakeupOccurred {
3177 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3178 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003179 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003180 // The interface name on which the packet was received.
3181 optional string iface = 2;
3182 // The ethertype value of the packet.
3183 optional int32 ethertype = 3;
3184 // String representation of the destination MAC address of the packet.
3185 optional string destination_hardware_address = 4;
3186 // String representation of the source address of the packet if this was an IP packet.
3187 optional string source_ip = 5;
3188 // String representation of the destination address of the packet if this was an IP packet.
3189 optional string destination_ip = 6;
3190 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3191 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3192 // families.
3193 optional int32 ip_next_header = 7;
3194 // The source port if this was a TCP or UDP packet.
3195 optional int32 source_port = 8;
3196 // The destination port if this was a TCP or UDP packet.
3197 optional int32 destination_port = 9;
3198}
3199
3200/*
3201 * Logs the memory stats for an app on startup.
3202 * Logged from:
3203 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3204 */
3205message AppStartMemoryStateCaptured {
3206 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003207 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003208
3209 // The process name.
3210 optional string process_name = 2;
3211
3212 // The activity name.
3213 optional string activity_name = 3;
3214
3215 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003216 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003217
3218 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003219 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003220
3221 // RSS
3222 optional int64 rss_in_bytes = 6;
3223
3224 // CACHE
3225 optional int64 cache_in_bytes = 7;
3226
3227 // SWAP
3228 optional int64 swap_in_bytes = 8;
3229}
3230
3231/*
3232 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3233 * for LMK event.
3234 * Logged from:
3235 * system/core/lmkd/lmkd.c
3236 */
3237message LmkStateChanged {
3238 enum State {
3239 UNKNOWN = 0;
3240 START = 1;
3241 STOP = 2;
3242 }
3243 optional State state = 1;
3244}
3245
3246/*
3247 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3248 * Logged from:
3249 * system/core/lmkd/lmkd.c
3250 */
3251message LmkKillOccurred {
3252 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003253 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003254
3255 // The process name.
3256 optional string process_name = 2;
3257
3258 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003259 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003260
3261 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003262 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003263
3264 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003265 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003266
3267 // RSS
3268 optional int64 rss_in_bytes = 6;
3269
3270 // CACHE
3271 optional int64 cache_in_bytes = 7;
3272
3273 // SWAP
3274 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003275
3276 // The elapsed real time of start of the process.
3277 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003278
3279 // Min oom adj score considered by lmkd.
3280 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003281}
3282
Rajeev Kumar51b54602018-03-01 12:18:26 -08003283/*
3284 * Logs when the ActivityManagerService detects that an app died.
3285 *
3286 * Logged from:
3287 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3288 */
3289message AppDied {
3290 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003291 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003292}
3293
Howard Ro21a039c2018-08-06 14:55:47 -07003294/**
3295 * An atom for generic metrics logging. Available from Android Q.
3296 */
3297message GenericAtom {
3298 // The uid of the application that sent this custom atom.
3299 optional int32 uid = 1 [(is_uid) = true];
3300
3301 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003302 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003303}
3304
Tej Singhd6d6d772018-09-05 17:41:25 -07003305/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003306 * Atom for simple logging of user interaction and impression events, such as "the user touched
3307 * this button" or "this dialog was displayed".
3308 * Keep the UI event stream clean: don't use for system or background events.
3309 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
3310 */
3311message UiEventReported {
3312 // The event_id.
3313 optional int32 event_id = 1;
3314 // The event's source or target uid and package, if applicable.
3315 // For example, the package posting a notification, or the destination package of a share.
3316 optional int32 uid = 2 [(is_uid) = true];
3317 optional string package_name = 3;
3318}
3319
3320/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003321 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003322 *
3323 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003324 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003325 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003326message BiometricAcquired {
3327 // Biometric modality that was acquired.
3328 optional android.hardware.biometrics.ModalityEnum modality = 1;
3329 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3330 optional int32 user = 2;
3331 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3332 optional bool is_crypto = 3;
3333 // Action that the device is performing. Acquired messages are only expected for enroll and
3334 // authenticate. Other actions may indicate an error.
3335 optional android.hardware.biometrics.ActionEnum action = 4;
3336 // The client that this acquisition was received for.
3337 optional android.hardware.biometrics.ClientEnum client = 5;
3338 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3339 optional int32 acquire_info = 6;
3340 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3341 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003342 // Dictates if this message should trigger additional debugging.
3343 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003344}
3345
3346/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003347 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003348 *
3349 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003350 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003351 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003352message BiometricAuthenticated {
3353 // Biometric modality that was used.
3354 optional android.hardware.biometrics.ModalityEnum modality = 1;
3355 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3356 optional int32 user = 2;
3357 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3358 // storage.
3359 optional bool is_crypto = 3;
3360 // The client that this acquisition was received for.
3361 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003362 // If authentication requires user confirmation. See BiometricPrompt's
3363 // setRequireConfirmation(bool) method.
3364 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003365
Kevin Chyn1741a072019-01-17 11:54:40 -08003366 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003367 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003368 REJECTED = 1;
3369 PENDING_CONFIRMATION = 2;
3370 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003371 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003372
3373 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003374 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003375 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3376 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3377 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3378 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003379 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003380 // Dictates if this message should trigger additional debugging.
3381 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003382}
3383
3384/**
3385 * Logs when a biometric error occurs.
3386 *
3387 * Logged from:
3388 * frameworks/base/services/core/java/com/android/server/biometrics
3389 */
3390message BiometricErrorOccurred {
3391 // Biometric modality that was used.
3392 optional android.hardware.biometrics.ModalityEnum modality = 1;
3393 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3394 optional int32 user = 2;
3395 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3396 optional bool is_crypto = 3;
3397 // Action that the device is performing.
3398 optional android.hardware.biometrics.ActionEnum action = 4;
3399 // The client that this acquisition was received for.
3400 optional android.hardware.biometrics.ClientEnum client = 5;
3401 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3402 // are unique to modality.
3403 optional int32 error_info = 6;
3404 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3405 // by the vendor and not specified by the HIDL interface.
3406 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003407 // Dictates if this message should trigger additional debugging.
3408 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003409 // Time spent during the authentication attempt.
3410 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003411}
3412
3413/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003414 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003415 * Logged from:
3416 * frameworks/base/services/core/java/com/android/server/biometrics
3417 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003418message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003419 // Biometric modality.
3420 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003421 // Type of issue detected.
3422 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003423 // Dictates if this message should trigger additional debugging.
3424 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003425}
Howard Ro688ae182018-09-25 00:09:36 -07003426
joshmccloskey6f952b22019-03-25 20:59:35 -07003427/**
3428 * Logs when a biometric enrollment occurs.
3429 *
3430 * Logged from:
3431 * frameworks/base/services/core/java/com/android/server/biometrics
3432 */
3433message BiometricEnrolled {
3434 // Biometric modality that was used.
3435 optional android.hardware.biometrics.ModalityEnum modality = 1;
3436 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3437 optional int32 user = 2;
3438 // The amount of time the enrollment took in milliseconds.
3439 optional int64 latency_millis = 3;
3440 // Whether or not the enrollment was successful.
3441 optional bool success = 4;
3442}
3443
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003444/*
Tej Singh0d176952019-01-16 19:10:54 -08003445 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003446 */
Tej Singh0d176952019-01-16 19:10:54 -08003447message FlagFlipUpdateOccurred {
3448 // If the event is from a flag config package, specify the package name.
3449 optional string flag_flip_package_name = 1;
3450
3451 // The order id of the package
3452 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003453}
3454
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003455/**
3456 * Potential experiment ids that goes with a train install.
3457 */
3458message TrainExperimentIds {
3459 repeated int64 experiment_id = 1;
3460}
3461
Yangster-macb89807e2018-11-15 21:10:57 -08003462/*
3463 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003464 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003465 */
3466message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003467 // Name of the train.
3468 optional string train_name = 1;
3469 // Version code for a "train" of packages that need to be installed atomically
3470 optional int64 train_version_code = 2;
3471 // After installation of this package, device requires a restart.
3472 optional bool requires_staging = 3;
3473 // Rollback should be enabled for this install.
3474 optional bool rollback_enabled = 4;
3475 // Requires low latency monitoring if possible.
3476 optional bool requires_low_latency_monitor = 5;
3477
Yangster-macb89807e2018-11-15 21:10:57 -08003478 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003479 UNKNOWN = 0;
3480 INSTALL_REQUESTED = 1;
3481 INSTALL_STARTED = 2;
3482 INSTALL_STAGED_NOT_READY = 3;
3483 INSTALL_STAGED_READY = 4;
3484 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003485 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3486 // and INSTALL_FAILURE_COMMIT.
3487 INSTALL_FAILURE = 6 [deprecated = true];
3488 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003489 INSTALL_CANCELLED = 7;
3490 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003491 INSTALLER_ROLLBACK_INITIATED = 9;
3492 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3493 INSTALLER_ROLLBACK_STAGED = 11;
3494 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3495 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3496 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3497 INSTALLER_ROLLBACK_SUCCESS = 15;
3498 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003499 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3500 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3501 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3502 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3503 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3504 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003505 INSTALL_FAILURE_DOWNLOAD = 23;
3506 INSTALL_FAILURE_STATE_MISMATCH = 24;
3507 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003508 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003509 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003510 // Possible experiment ids for monitoring this push.
3511 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3512 // user id
3513 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003514}
3515
Tej Singhc9203082019-05-03 13:42:23 -07003516/* Test atom, is not logged anywhere */
3517message TestAtomReported {
3518 repeated AttributionNode attribution_node = 1;
3519 optional int32 int_field = 2;
3520 optional int64 long_field = 3;
3521 optional float float_field = 4;
3522 optional string string_field = 5;
3523 optional bool boolean_field = 6;
3524 enum State {
3525 UNKNOWN = 0;
3526 OFF = 1;
3527 ON = 2;
3528 }
3529 optional State state = 7;
3530 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3531}
3532
Maggie Whitefc1aa592018-11-28 21:55:23 -08003533/** Represents USB port overheat event. */
3534message UsbPortOverheatEvent {
3535 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3536 optional int32 plug_temperature_deci_c = 1;
3537
3538 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3539 optional int32 max_temperature_deci_c = 2;
3540
3541 /* Time between USB plug event and overheat threshold trip, in seconds. */
3542 optional int32 time_to_overheat_secs = 3;
3543
3544 /* Time between overheat threshold trip and hysteresis, in seconds. */
3545 optional int32 time_to_hysteresis_secs = 4;
3546
3547 /* Time between hysteresis and active mitigation ending, in seconds. */
3548 optional int32 time_to_inactive_secs = 5;
3549};
3550
Maggie White8735b852019-01-18 11:40:49 -08003551/**
3552 * Logs total effective full charge and discharge cycles on a battery.
3553 * Here are some examples of one effective cycle:
3554 * 1) the battery charges from 0% to 100% and drains back to 0%,
3555 * 2) charging from 50% to 100% and draining back to 50% twice.
3556 * Pulled from:
3557 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3558 */
3559message BatteryCycleCount {
3560 /* Number of total charge and discharge cycles on the system battery. */
3561 optional int32 cycle_count = 1;
3562}
3563
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003564/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003565 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3566 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003567 * Pulled from:
3568 * StatsCompanionService
3569 */
3570
Carmen Agimof12dec122019-03-06 16:14:38 +00003571message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003572
Carmen Agimof12dec122019-03-06 16:14:38 +00003573 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003574 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003575 PUBLIC = 1;
3576 PRIVATE = 2;
3577 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003578 }
3579
Carmen Agimof12dec122019-03-06 16:14:38 +00003580 // The type of external storage.
3581 optional android.stats.storage.ExternalStorageType storage_type = 1;
3582 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3583 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003584 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003585 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003586}
3587
Yangster-macb89807e2018-11-15 21:10:57 -08003588/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003589 * Logs when a connection becomes available and lost.
3590 * Logged in StatsCompanionService.java
3591 */
3592message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003593 // Id of the network.
3594 optional int32 net_id = 1;
3595
3596 enum State {
3597 UNKNOWN = 0;
3598 CONNECTED = 1;
3599 DISCONNECTED = 2;
3600 }
3601 // Connected state of a network.
3602 optional State state = 2;
3603}
3604
3605/**
3606 * Logs when a service starts and stops.
3607 * Logged from:
3608 * services/core/java/com/android/server/am/ActiveServices.java
3609 */
3610message ServiceStateChanged {
3611
3612 optional int32 uid = 1 [(is_uid) = true];
3613
3614 optional string package_name = 2;
3615
3616 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003617
3618 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003619 START = 1;
3620 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003621 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003622
3623 optional State state = 4;
3624}
3625
3626/**
3627 * Logs when a service is launched.
3628 * Logged from:
3629 * services/core/java/com/android/server/am/ActiveServices.java
3630 */
3631message ServiceLaunchReported {
3632
3633 optional int32 uid = 1 [(is_uid) = true];
3634
3635 optional string package_name = 2;
3636
3637 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003638}
Howard Ro688ae182018-09-25 00:09:36 -07003639
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003640/**
3641 * Logs when a hidden API is used.
3642 *
3643 * Logged from:
3644 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3645 */
3646message HiddenApiUsed {
3647 // The uid of the app making the hidden access.
3648 optional int32 uid = 1 [(is_uid) = true];
3649
3650 // Signature of the method or field accessed.
3651 optional string signature = 2;
3652
3653 enum AccessMethod {
3654 NONE = 0;
3655 REFLECTION = 1;
3656 JNI = 2;
3657 LINKING = 3;
3658 }
3659
3660 // Type of access.
3661 optional AccessMethod access_method = 3;
3662
3663 // Whether the access was prevented or not.
3664 optional bool access_denied = 4;
3665}
3666
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003667/**
3668 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3669 * - When user sees privacy chip
3670 * - When user clicks privacy chip
3671 * - How does the user exit the Privacy Dialog
3672 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003673 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3674 */
3675message PrivacyIndicatorsInteracted {
3676
3677 enum Type {
3678 UNKNOWN = 0;
3679 CHIP_VIEWED = 1;
3680 CHIP_CLICKED = 2;
3681 DIALOG_PRIVACY_SETTINGS = 3;
3682 DIALOG_DISMISS = 4;
3683 DIALOG_LINE_ITEM = 5;
3684 }
3685
3686 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3687
3688 // Used if the type is LINE_ITEM
3689 optional string package_name = 2;
3690}
3691
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003692/**
3693 * Logs information about a package that is moved from the internal to external storage and vice
3694 * versa.
3695 * It logs the package name, the type of the external storage where the package is installed
3696 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3697 * and the move type: if it's from internal to external or the other way around.
3698 *
3699 * Logged from:
3700 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3701 */
3702message AppMovedStorageReported {
3703 enum MoveType {
3704 UNKNOWN = 0;
3705 TO_EXTERNAL = 1;
3706 TO_INTERNAL = 2;
3707 }
3708 // The type of the external storage.
3709 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3710 // The type of move.
3711 optional MoveType move_type = 2;
3712 // The name of the package that was moved.
3713 optional string package_name = 3;
3714}
3715
jianjin8f2dee02019-03-29 14:03:08 -07003716/**
3717 * Logs when system server watchdog occurs.
3718 * Logged from:
3719 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3720 */
3721message SystemServerWatchdogOccurred {
3722 optional string subject = 1;
3723}
3724
3725/**
3726 * Logs when new file added to tombstones.
3727 * Logged from:
3728 * frameworks/base/core/java/com/android/server/BootReceiver.java
3729 */
3730message TombStoneOccurred {
3731}
3732
Hai Zhang5d3328d2019-04-13 21:25:06 +08003733/*
3734 * Information about a role request
3735 *
3736 * Logged from:
3737 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3738 */
3739message RoleRequestResultReported {
3740 // UID of application requesting the role
3741 optional int32 requesting_uid = 1;
3742
3743 // Package name of application requesting the role
3744 optional string requesting_package_name = 2;
3745
3746 // The role to be granted
3747 optional string role_name = 3;
3748
3749 // The count of applications qualifying for the role
3750 optional int32 qualifying_count = 4;
3751
3752 // UID of application current granted the role
3753 optional int32 current_uid = 5;
3754
3755 // Package name of application current granted the role
3756 optional string current_package_name = 6;
3757
3758 // UID of another application that user chose to grant the role to, instead of the requesting
3759 // application
3760 optional int32 granted_another_uid = 7;
3761
3762 // Package name of another application that user chose to grant the role to, instead of the
3763 // requesting application
3764 optional string granted_another_package_name = 8;
3765
3766 enum Result {
3767 UNDEFINED = 0;
3768 // role request was ignored
3769 IGNORED = 1;
3770 // role request was ignored because it's already granted
3771 IGNORED_ALREADY_GRANTED = 2;
3772 // role request was ignored because the application isn't qualified
3773 IGNORED_NOT_QUALIFIED = 3;
3774 // role request was ignored because user said it should be always denied
3775 IGNORED_USER_ALWAYS_DENIED = 4;
3776 // role was granted by user action
3777 USER_GRANTED = 5;
3778 // role was denied by user action
3779 USER_DENIED = 6;
3780 // role was denied by user granting another application the role
3781 USER_DENIED_GRANTED_ANOTHER = 7;
3782 // role was denied and set to be always denied by the user
3783 USER_DENIED_WITH_ALWAYS = 8;
3784 }
3785 // The result of the role request
3786 optional Result result = 9;
3787}
3788
Mark Tabrya824a642019-11-05 12:26:12 -08003789/**
3790 * Logs when a Vehicle Maps Service client's connection state has changed
3791 *
3792 * Logged from:
3793 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
3794 */
3795message VmsClientConnectionStateChanged {
3796 // The UID of the VMS client app
3797 optional int32 uid = 1 [(is_uid) = true];
3798
3799 enum State {
3800 UNKNOWN = 0;
3801 // Attempting to connect to the client
3802 CONNECTING = 1;
3803 // Client connection established
3804 CONNECTED = 2;
3805 // Client connection closed unexpectedly
3806 DISCONNECTED = 3;
3807 // Client connection closed by VMS
3808 TERMINATED = 4;
3809 // Error establishing the client connection
3810 CONNECTION_ERROR = 5;
3811 }
3812
3813 optional State state = 2;
3814}
3815
Jeff Sharkey6bd21572019-11-15 20:45:33 -07003816/**
3817 * Logs when MediaProvider has successfully finished scanning a storage volume.
3818 *
3819 * Logged from:
3820 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
3821 */
3822message MediaProviderScanEvent {
3823 enum Reason {
3824 // Scan triggered due to unknown reason
3825 UNKNOWN = 0;
3826 // Scan triggered due to storage volume being mounted
3827 MOUNTED = 1;
3828 // Scan triggered due to explicit user action or app request
3829 DEMAND = 2;
3830 // Scan triggered due to idle maintenance
3831 IDLE = 3;
3832 }
3833
3834 // Volume type that this event pertains to
3835 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3836 // Reason why this scan was triggered
3837 optional Reason reason = 2;
3838 // Total number of files scanned
3839 optional int64 item_count = 3;
3840 // Duration of scan, normalized per file
3841 optional float normalized_duration_millis = 4;
3842 // Number of database inserts, normalized per file
3843 optional float normalized_insert_count = 5;
3844 // Number of database updates, normalized per file
3845 optional float normalized_update_count = 6;
3846 // Number of database deletes, normalized per file
3847 optional float normalized_delete_count = 7;
3848}
3849
3850/**
3851 * Logs when an app has asked MediaProvider to delete media belonging to the user.
3852 *
3853 * Logged from:
3854 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
3855 */
3856message MediaProviderDeletionEvent {
3857 // Volume type that this event pertains to
3858 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3859 // Device timestamp when this deletion event occurred
3860 optional int64 timestamp_millis = 2;
3861 // App that requested deletion
3862 optional string package_name = 3;
3863 // Number of items that were deleted
3864 optional int32 item_count = 4;
3865}
3866
3867/**
3868 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
3869 *
3870 * Logged from:
3871 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
3872 */
3873message MediaProviderPermissionEvent {
3874 enum Result {
3875 UNKNOWN = 0;
3876 USER_GRANTED = 1;
3877 AUTO_GRANTED = 2;
3878 USER_DENIED = 3;
3879 USER_DENIED_WITH_PREJUDICE = 4;
3880 AUTO_DENIED = 5;
3881 }
3882
3883 // Volume type that this event pertains to
3884 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3885 // Device timestamp when this permission event occurred
3886 optional int64 timestamp_millis = 2;
3887 // App that requested permission
3888 optional string package_name = 3;
3889 // Number of items that were requested
3890 optional int32 item_count = 4;
3891 // Result of this request
3892 optional Result result = 5;
3893}
3894
3895/**
3896 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
3897 *
3898 * Logged from:
3899 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
3900 */
3901message MediaProviderSchemaChange {
3902 // Volume type that this event pertains to
3903 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3904 // Old database version code
3905 optional int32 version_from = 2;
3906 // New database version code
3907 optional int32 version_to = 3;
3908 // Total number of files in database
3909 optional int64 item_count = 4;
3910 // Duration of schema change, normalized per file
3911 optional float normalized_duration_millis = 5;
3912}
3913
3914/**
3915 * Logs when MediaProvider has finished an idle maintenance job.
3916 *
3917 * Logged from:
3918 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
3919 */
3920message MediaProviderIdleMaintenance {
3921 // Volume type that this event pertains to
3922 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3923
3924 // Total number of files in database
3925 optional int64 item_count = 2;
3926 // Duration of idle maintenance, normalized per file
3927 optional float normalized_duration_millis = 3;
3928 // Number of thumbnails found to be stale, normalized per file
3929 optional float normalized_stale_thumbnails = 4;
3930 // Number of items found to be expired, normalized per file
3931 optional float normalized_expired_media = 5;
3932}
3933
Keun young Park3e033cb2019-12-18 11:27:35 -08003934/**
3935 * Represents boot time event with duration in ms.
3936 *
3937 * Logged from: bootstat and various system server components. Check each enums for details.
3938 */
3939message BootTimeEventDuration {
3940 enum DurationEvent {
3941 UNKNOWN = 0;
3942 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
3943 ABSOLUTE_BOOT_TIME = 1;
3944 // Bootloader's 1st stage execution time.
3945 // Logged from bootstat.
3946 BOOTLOADER_FIRST_STAGE_EXEC = 2;
3947 // Bootloader's 1st stage loading time.
3948 // Logged from bootstat.
3949 BOOTLOADER_FIRST_STAGE_LOAD = 3;
3950 // Bootloader's kernel loading time.
3951 // Logged from bootstat.
3952 BOOTLOADER_KERNEL_LOAD = 4;
3953 // Bootloader's 2nd stage execution time.
3954 // Logged from bootstat.
3955 BOOTLOADER_SECOND_STAGE_EXEC = 5;
3956 // Bootloader's 2nd stage loading time.
3957 // Logged from bootstat.
3958 BOOTLOADER_SECOND_STAGE_LOAD = 6;
3959 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
3960 // for locked device.
3961 // Logged from bootstat.
3962 BOOTLOADER_UI_WAIT = 7;
3963 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
3964 // Logged from bootstat.
3965 BOOTLOADER_TOTAL = 8;
3966 // Shutdown duration inside init for the reboot before the current boot up.
3967 // Logged from f/b/services/.../BootReceiver.java.
3968 SHUTDOWN_DURATION = 9;
3969 // Total time for mounting of disk devices during bootup.
3970 // Logged from f/b/services/.../BootReceiver.java.
3971 MOUNT_DEFAULT_DURATION = 10;
3972 // Total time for early stage mounting of disk devices during bootup.
3973 // Logged from f/b/services/.../BootReceiver.java.
3974 MOUNT_EARLY_DURATION = 11;
3975 // Total time for late stage mounting of disk devices during bootup.
3976 // Logged from f/b/services/.../BootReceiver.java.
3977 MOUNT_LATE_DURATION = 12;
3978 // Average time to scan non-system app after OTA
3979 // Logged from f/b/services/.../PackageManagerService.java
3980 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
3981 // Time to initialize Package manager after OTA
3982 // Logged from f/b/services/.../PackageManagerService.java
3983 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
3984 // Time to scan all system app from Package manager after OTA
3985 // Logged from f/b/services/.../PackageManagerService.java
3986 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
3987 // Init's total time for cold boot stage.
3988 // Logged from bootstat.
3989 COLDBOOT_WAIT = 16;
3990 // Init's total time for initializing selinux.
3991 // Logged from bootstat.
3992 SELINUX_INIT = 17;
3993 // Time since last factory reset.
3994 // Logged from bootstat.
3995 FACTORY_RESET_TIME_SINCE_RESET = 18;
3996 }
3997
3998 // Type of the event.
3999 optional DurationEvent event = 1;
4000 // Duration of the event in ms.
4001 optional int64 duration_millis = 2;
4002}
4003
4004/**
4005 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4006 * since boot-up.
4007 *
4008 * Logged from: bootstat and various system server components. Check each enums for details.
4009 */
4010message BootTimeEventElapsedTime {
4011 enum ElapsedTimeEvent {
4012 UNKNOWN = 0;
4013 // Time when init starts 1st stage. Logged from bootstat.
4014 ANDROID_INIT_STAGE_1 = 1;
4015 // Time when sys.boot_completed prop is set.
4016 // Logged from bootstat.
4017 BOOT_COMPLETE = 2;
4018 // BOOT_COMPLETE for encrypted device.
4019 BOOT_COMPLETE_ENCRYPTION = 3;
4020 // BOOT_COMPLETE for device with no encryption.
4021 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4022 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
4023 BOOT_COMPLETE_POST_DESCRYPT = 5;
4024 // BOOT_COMPLETE after factory reset.
4025 FACTORY_RESET_BOOT_COMPLETE = 6;
4026 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4027 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
4028 // BOOT_COMPLETE_POST_DESCRYPT after factory reset.
4029 FACTORY_RESET_BOOT_COMPLETE_POST_DESCRYPT = 8;
4030 // BOOT_COMPLETE after OTA.
4031 OTA_BOOT_COMPLETE = 9;
4032 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4033 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
4034 // BOOT_COMPLETE_POST_DESCRYPT after OTA.
4035 OTA_BOOT_COMPLETE_POST_DESCRYPT = 11;
4036 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4037 // Logged from f/b/services/.../UserController.java
4038 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4039 // Time when the system starts sending BOOT_COMPLETED broadcast.
4040 // Logged from f/b/services/.../UserController.java
4041 FRAMEWORK_BOOT_COMPLETED = 13;
4042 // Time when the package manager starts init.
4043 // Logged from f/b/services/.../SystemServer.java
4044 PACKAGE_MANAGER_INIT_START = 14;
4045 // Time when package manager is ready
4046 // Logged from f/b/services/.../SystemServer.java
4047 PACKAGE_MANAGER_INIT_READY = 15;
4048 // Represents the time when user has entered unlock credential for system with user pin.
4049 // Logged from bootstat.
4050 POST_DECRYPT = 16;
4051 // Represents the start of zygote's init.
4052 // Logged from zygote itself.
4053 ZYGOTE_INIT_START = 17;
4054 // Represents the start of secondary zygote's init.
4055 // TODO: add logging to zygote
4056 SECONDARY_ZYGOTE_INIT_START = 18;
4057 // Represents the start of system server's init.
4058 // Logged from f/b/services/.../SystemServer.java
4059 SYSTEM_SERVER_INIT_START = 19;
4060 // Represents the completion of system server's init.
4061 // Logged from f/b/services/.../SystemServer.java
4062 SYSTEM_SERVER_READY = 20;
4063 // Represents the start of launcher during boot-up.
4064 // TODO: add logging
4065 LAUNCHER_START = 21;
4066 // Represents the completion of launcher's initial rendering. User can use other apps from
4067 // launcher from this point.
4068 // TODO: add logging
4069 LAUNCHER_SHOWN = 22;
4070 }
4071
4072 // Type of the event.
4073 optional ElapsedTimeEvent event = 1;
4074 // Time since bootup for the event.
4075 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4076 optional int64 time_millis = 2;
4077}
4078
4079/**
4080 * Boot time events with UTC time.
4081 *
4082 * Logged from: bootstat and various system server components. Check each enums for details.
4083 */
4084message BootTimeEventUtcTime {
4085 enum UtcTimeEvent {
4086 UNKNOWN = 0;
4087 // Time of the bootstat's marking of 1st boot after the last factory reset.
4088 // Logged from bootstat.
4089 FACTORY_RESET_RESET_TIME = 1;
4090 // The time when bootstat records FACTORY_RESET_* events. This is close to
4091 // BOOT_COMPLETE time for the current bootup.
4092 // Logged from bootstat.
4093 FACTORY_RESET_CURRENT_TIME = 2;
4094 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4095 // Logged from bootstat.
4096 FACTORY_RESET_RECORD_VALUE = 3;
4097 }
4098
4099 // Type of the event.
4100 optional UtcTimeEvent event = 1;
4101 // UTC time for the event.
4102 optional int64 utc_time_secs = 2;
4103}
4104
4105/**
4106 * Boot time events representing specific error code during bootup.
4107 * Meaning of error code can be different per each event type.
4108 *
4109 * Logged from: bootstat and various system server components. Check each enums for details.
4110 */
4111message BootTimeEventErrorCode {
4112 enum ErrorCodeEvent {
4113 UNKNOWN = 0;
4114 // Linux error code for time() call to get the current UTC time.
4115 // Logged from bootstat.
4116 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4117 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4118 // as UMOUNT_STAT_* from init/reboot.cpp.
4119 // Logged from f/b/services/.../BootReceiver.java.
4120 SHUTDOWN_UMOUNT_STAT = 2;
4121 // Reprepsents fie system mounting error code for the current boot. Error codes defined
4122 // as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
4123 // Logged from f/b/services/.../BootReceiver.java.
4124 FS_MGR_FS_STAT = 3;
4125 }
4126
4127 // Type of the event.
4128 optional ErrorCodeEvent event = 1;
4129 // error code defined per each event type.
4130 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4131 // FS_MGR_FS_STAT.
4132 optional int32 error_code = 2;
4133}
4134
Chenjie Yubbcbc602018-02-05 16:51:52 -08004135//////////////////////////////////////////////////////////////////////
4136// Pulled atoms below this line //
4137//////////////////////////////////////////////////////////////////////
4138
4139/**
David Chenc8a43242017-10-17 16:23:28 -07004140 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4141 *
4142 * Pulled from:
4143 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4144 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004145message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004146 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004147
4148 optional int64 rx_bytes = 2;
4149
4150 optional int64 rx_packets = 3;
4151
4152 optional int64 tx_bytes = 4;
4153
4154 optional int64 tx_packets = 5;
4155}
4156
4157/**
4158 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4159 *
4160 * Pulled from:
4161 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4162 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004163message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004164 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004165
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004166 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4167 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004168
4169 optional int64 rx_bytes = 3;
4170
4171 optional int64 rx_packets = 4;
4172
4173 optional int64 tx_bytes = 5;
4174
4175 optional int64 tx_packets = 6;
4176}
4177
4178/**
4179 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4180 *
4181 * Pulled from:
4182 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4183 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004184message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004185 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004186
4187 optional int64 rx_bytes = 2;
4188
4189 optional int64 rx_packets = 3;
4190
4191 optional int64 tx_bytes = 4;
4192
4193 optional int64 tx_packets = 5;
4194}
4195
4196/**
4197 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4198 *
4199 * Pulled from:
4200 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4201 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004202message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004203 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004204
Yao Chenc40a19d2018-03-15 16:48:25 -07004205 // 1 denotes foreground and 0 denotes background. This is called Set in
4206 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004207 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004208
4209 optional int64 rx_bytes = 3;
4210
4211 optional int64 rx_packets = 4;
4212
4213 optional int64 tx_bytes = 5;
4214
4215 optional int64 tx_packets = 6;
4216}
4217
4218/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004219 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4220 *
4221 * Pulled from:
4222 * StatsCompanionService
4223 */
4224message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004225 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004226
4227 optional int64 rx_bytes = 2;
4228
4229 optional int64 tx_bytes = 3;
4230}
4231
4232/**
David Chenc8a43242017-10-17 16:23:28 -07004233 * Pulls the kernel wakelock durations. This atom is adapted from
4234 * android/internal/os/KernelWakelockStats.java
4235 *
4236 * Pulled from:
4237 * StatsCompanionService using KernelWakelockReader.
4238 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004239message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004240 optional string name = 1;
4241
4242 optional int32 count = 2;
4243
4244 optional int32 version = 3;
4245
Yangster-maca8a30442018-10-13 23:46:34 -07004246 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004247}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004248
Chenjie Yu05013b32017-11-21 10:21:41 -08004249/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004250 * Pulls low power state information. If power.stats HAL is not available, this
4251 * includes platform and subsystem sleep state information,
4252 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4253 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004254 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004255 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004256 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4257 * as defined in:
4258 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004259 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004260message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004261 // Subsystem name
4262 optional string subsystem_name = 1;
4263 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4264 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004265 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4266 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004267 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004268 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004269 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004270 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004271 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004272}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004273
Chenjie Yu05013b32017-11-21 10:21:41 -08004274/**
Bookatz92da2832018-11-01 18:10:03 -07004275 * Pulls on-device power measurement information.
4276 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4277 * Pulled from:
4278 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4279 */
4280message OnDevicePowerMeasurement {
4281 // Name of the subsystem (to which the rail belongs).
4282 optional string subsystem_name = 1;
4283
4284 // Rail name. The rail lies within the subsystem.
4285 optional string rail_name = 2;
4286
4287 // Time (in ms since boot) at which the rail energy value was measured.
4288 // This may differ slightly from the time that statsd logs this information.
4289 optional uint64 measurement_timestamp_millis = 3;
4290
4291 // Accumulated energy used via the rail since device boot in uWs.
4292 optional uint64 energy_microwatt_secs = 4;
4293}
4294
4295/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004296 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004297 * Pulls the time the cpu spend on the frequency index. Frequency index
4298 * starts from highest to lowest. The value should be monotonically
4299 * increasing since boot. However, if there is a cpu
4300 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004301 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004302message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004303 optional uint32 cluster = 1;
4304 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004305 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004306}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004307
Chenjie Yu05013b32017-11-21 10:21:41 -08004308/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004309 * Pulls Cpu Time Per Uid.
4310 * Note that isolated process uid time should be attributed to host uids.
4311 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004312message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004313 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004314 optional uint64 user_time_micros = 2;
4315 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004316}
4317
4318/**
4319 * Pulls Cpu Time Per Uid per frequency.
4320 * Note that isolated process uid time should be attributed to host uids.
4321 * For each uid, we order the time by descending frequencies.
4322 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004323message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004324 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004325 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004326 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004327}
Hugo Benichi884970e2017-11-14 22:42:46 +09004328
Chenjie Yu05013b32017-11-21 10:21:41 -08004329/**
4330 * Pulls Wifi Controller Activity Energy Info
4331 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004332message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004333 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004334 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004335 // stack reported state
4336 // TODO: replace this with proto enum
4337 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004338 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004339 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004340 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004341 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004342 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004343 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004344 // product of current(mA), voltage(V) and time(ms)
4345 optional uint64 controller_energy_used = 6;
4346}
4347
4348/**
4349 * Pulls Modem Activity Energy Info
4350 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004351message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004352 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004353 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004354 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004355 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004356 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004357 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004358 /**
4359 * Tx power index
4360 * index 0 = tx_power < 0dBm
4361 * index 1 = 0dBm < tx_power < 5dBm
4362 * index 2 = 5dBm < tx_power < 15dBm
4363 * index 3 = 15dBm < tx_power < 20dBm
4364 * index 4 = tx_power > 20dBm
4365 */
4366 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004367 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004368 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004369 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004370 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004371 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004372 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004373 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004374 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004375 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004376 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004377 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004378 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004379 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004380}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004381
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004382/**
4383 * Pulls Bluetooth Activity Energy Info
4384 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4385 */
4386message BluetoothActivityInfo {
4387 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004388 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004389 // bluetooth stack state
4390 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004391 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004392 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004393 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004394 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004395 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004396 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004397 // product of current(mA), voltage(V) and time(ms)
4398 optional uint64 energy_used = 6;
4399}
4400
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004401/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004402 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004403 *
4404 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004405 */
4406message ProcessMemoryState {
4407 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004408 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004409
4410 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004411 // Usually package name, "system" for system server.
4412 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004413 optional string process_name = 2;
4414
Rafal Slawikda51b932018-12-13 16:31:33 +00004415 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004416 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004417
4418 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004419 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004420
4421 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004422 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004423
Rajeev Kumar90235992018-01-29 11:06:48 -08004424 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004425 // Value is read from memory.stat, field total_rss if per-app memory
4426 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004427 optional int64 rss_in_bytes = 6;
4428
4429 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004430 // Value is read from memory.stat, field total_cache if per-app memory
4431 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004432 optional int64 cache_in_bytes = 7;
4433
4434 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004435 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004436 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004437 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004438
Rafal Slawik203c3db2019-09-25 19:53:01 +01004439 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004440 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004441
Rafal Slawik203c3db2019-09-25 19:53:01 +01004442 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4443 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004444
Rafal Slawik203c3db2019-09-25 19:53:01 +01004445 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4446 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004447}
4448
4449/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004450 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004451 *
4452 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4453 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004454 *
4455 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004456 */
4457message ProcessMemoryHighWaterMark {
4458 // The uid if available. -1 means not available.
4459 optional int32 uid = 1 [(is_uid) = true];
4460
Rafal Slawikda51b932018-12-13 16:31:33 +00004461 // The process name.
4462 // Usually package name or process cmdline.
4463 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004464 optional string process_name = 2;
4465
Rafal Slawik239b6802019-09-09 18:46:01 +01004466 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4467 // computed by converting kilobytes to bytes.
4468 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4469
Rafal Slawik3bea8952018-11-15 12:39:33 +00004470 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4471 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004472 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004473}
4474
4475/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004476 * Logs the memory stats for a process.
4477 *
4478 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4479 * and for selected native processes.
4480 */
4481message ProcessMemorySnapshot {
4482 // The uid if available. -1 means not available.
4483 optional int32 uid = 1 [(is_uid) = true];
4484
4485 // The process name.
4486 // Usually package name or process cmdline.
4487 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4488 optional string process_name = 2;
4489
4490 // The pid of the process.
4491 // Allows to disambiguate instances of the process.
4492 optional int32 pid = 3;
4493
4494 // The current OOM score adjustment value.
4495 // Read from ProcessRecord for managed processes.
4496 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4497 optional int32 oom_score_adj = 4;
4498
4499 // The current RSS of the process.
4500 // VmRSS from /proc/pid/status.
4501 optional int32 rss_in_kilobytes = 5;
4502
4503 // The current anon RSS of the process.
4504 // RssAnon from /proc/pid/status.
4505 optional int32 anon_rss_in_kilobytes = 6;
4506
4507 // The current swap size of the process.
4508 // VmSwap from /proc/pid/status.
4509 optional int32 swap_in_kilobytes = 7;
4510
4511 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4512 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4513}
4514
4515/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004516 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004517 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004518message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004519 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004520}
4521
4522/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004523 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004524 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004525message SystemUptime {
4526 // Milliseconds since the system was booted.
4527 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4528 // for external input).
4529 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004530 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004531}
4532
4533/*
4534 * Reads from /proc/uid_concurrent_active_time which has the format:
4535 * active: X (X is # cores)
4536 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4537 * [uid1]: [time-0] [time-1] [time-2] ... ...
4538 * ...
4539 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4540 * The file contains a monotonically increasing count of time for a single boot.
4541 */
4542message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004543 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004544 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004545}
4546
4547/**
4548 * Reads from /proc/uid_concurrent_policy_time which has the format:
4549 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4550 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4551 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4552 * ...
4553 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4554 * The file contains a monotonically increasing count of time for a single boot.
4555 */
4556message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004557 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004558 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004559 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004560}
4561
4562/*
4563 * Pulls free disk space, for data, system partition and temporary directory.
4564 */
4565message DiskSpace {
4566 // available bytes in data partition
4567 optional uint64 data_available_bytes = 1;
4568 // available bytes in system partition
4569 optional uint64 system_available_bytes = 2;
4570 // available bytes in download cache or temp directories
4571 optional uint64 temp_available_bytes = 3;
4572}
Tej Singhbf972d92018-01-10 20:51:13 -08004573
4574/**
4575 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004576 *
4577 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004578 */
4579message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004580 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004581}
4582
4583/**
4584 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004585 * Pulled from:
4586 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004587 */
4588message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004589 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004590}
4591
4592/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004593 * Pulls battery voltage.
4594 * Pulled from:
4595 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4596 */
4597message BatteryVoltage {
4598 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004599 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004600}
4601
4602/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004603 * Pulls battery level (percent full, from 0 to 100).
4604 *
4605 * Pulled from:
4606 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4607 */
4608message BatteryLevel {
4609 // Battery level. Should be in [0, 100].
4610 optional int32 battery_level = 1;
4611}
4612
4613/**
Tej Singhd89137e2018-03-26 14:51:40 -07004614 * Pulls the temperature of various parts of the device.
4615 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004616 *
Maggie White442b6312019-04-05 16:26:44 -07004617 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004618 */
4619message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004620 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004621 optional android.os.TemperatureTypeEnum sensor_location = 1;
4622
4623 // The name of the temperature source. Eg. CPU0
4624 optional string sensor_name = 2;
4625
Tej Singhd89137e2018-03-26 14:51:40 -07004626 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004627 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004628 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004629
4630 // Relative severity of the throttling, see enum definition.
4631 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004632}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004633
4634/**
4635 * Pulls the statistics of calls to Binder.
4636 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004637 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4638 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004639 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004640 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004641 */
4642message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004643 // UID of the process responsible for the binder transaction. It will be set if the process
4644 // executing the binder transaction attribute the transaction to another uid using
4645 // Binder.setThreadWorkSource().
4646 //
4647 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004648 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004649 // UID of the process executing the binder transaction.
4650 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004651 // Fully qualified class name of the API call.
4652 //
4653 // This is a system server class name.
4654 //
4655 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4656 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4657 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4658 // commonly used APIs.
4659 optional string service_class_name = 2;
4660 // Method name of the API call. It can also be a transaction code if we cannot
4661 // resolve it to a name. See Binder#getTransactionName.
4662 //
4663 // This is a system server method name.
4664 optional string service_method_name = 3;
4665 // Total number of API calls.
4666 optional int64 call_count = 4;
4667 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4668 optional bool screen_interactive = 13;
4669 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4670 // call_count will be equal to recorded_call_count.
4671 //
4672 // If recorded_call_count is different than call_count, it means data collection has been
4673 // sampled. All the fields below will be sampled in this case.
4674 optional int64 recorded_call_count = 12;
4675 // Number of exceptions thrown by the API.
4676 optional int64 recorded_exception_count = 5;
4677 // Total latency of all API calls.
4678 // Average can be computed using total_latency_micros / recorded_call_count.
4679 optional int64 recorded_total_latency_micros = 6;
4680 // Maximum latency of one API call.
4681 optional int64 recorded_max_latency_micros = 7;
4682 // Total CPU usage of all API calls.
4683 // Average can be computed using total_cpu_micros / recorded_call_count.
4684 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4685 optional int64 recorded_total_cpu_micros = 8;
4686 // Maximum CPU usage of one API call.
4687 optional int64 recorded_max_cpu_micros = 9;
4688 // Maximum parcel reply size of one API call.
4689 optional int64 recorded_max_reply_size_bytes = 10;
4690 // Maximum parcel request size of one API call.
4691 optional int64 recorded_max_request_size_bytes = 11;
4692}
4693
4694/**
4695 * Pulls the statistics of exceptions during calls to Binder.
4696 *
4697 * Binder stats are cumulative from boot unless somebody reset the data using
4698 * > adb shell dumpsys binder_calls_stats --reset
4699 */
4700message BinderCallsExceptions {
4701 // Exception class name, e.g. java.lang.IllegalArgumentException.
4702 //
4703 // This is an exception class name thrown by the system server.
4704 optional string exception_class_name = 1;
4705 // Total number of exceptions.
4706 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004707}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004708
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004709/**
4710 * Pulls the statistics of message dispatching on HandlerThreads.
4711 *
4712 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4713 * config on the device.
4714 *
4715 * Next tag: 11
4716 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004717message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004718 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004719 optional int32 uid = 1 [(is_uid) = true];
4720
4721 // Fully qualified class name of the handler target class.
4722 //
4723 // This field does not contain PII. This is a system server class name.
4724 optional string handler_class_name = 2;
4725
4726 // The name of the thread that runs the Looper.
4727 //
4728 // This field does not contain PII. This is a system server thread name.
4729 optional string looper_thread_name = 3;
4730
4731 // The name of the dispatched message.
4732 //
4733 // This field does not contain PII. This is a system server constant or class
4734 // name.
4735 optional string message_name = 4;
4736
4737 // Total number of successfully dispatched messages.
4738 optional int64 message_count = 5;
4739
4740 // Total number of messages that failed dispatching.
4741 optional int64 exception_count = 6;
4742
4743 // Total number of processed messages we have data recorded for. If we
4744 // collected data for all the messages, message_count will be equal to
4745 // recorded_message_count.
4746 //
4747 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004748 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004749 optional int64 recorded_message_count = 7;
4750
4751 // Total latency of all processed messages.
4752 // Average can be computed using recorded_total_latency_micros /
4753 // recorded_message_count.
4754 optional int64 recorded_total_latency_micros = 8;
4755
4756 // Total CPU usage of all processed message.
4757 // Average can be computed using recorded_total_cpu_micros /
4758 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004759 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004760 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004761
4762 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4763 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004764
4765 // Max recorded CPU usage of all processed messages.
4766 optional int64 recorded_max_cpu_micros = 11;
4767
4768 // Max recorded latency of all processed messages.
4769 optional int64 recorded_max_latency_micros = 12;
4770
4771 // Total number of messages we tracked the dispatching delay for. If we
4772 // collected data for all the messages, message_count will be equal to
4773 // recorded_delay_message_count.
4774 //
4775 // If recorded_delay_message_count is different than message_count, it means data
4776 // collection has been sampled or/and not all messages specified the target dispatch time.
4777 // The fields below will be sampled in this case.
4778 optional int64 recorded_delay_message_count = 13;
4779
4780 // Total dispatching delay of all processed messages.
4781 // Calculated as a difference between the target dispatching time (Message.when)
4782 // and the actual dispatching time.
4783 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4784 optional int64 recorded_total_delay_millis = 14;
4785
4786 // Max dispatching delay of all processed messages.
4787 // Calculated as a difference between the target dispatching time (Message.when)
4788 // and the actual dispatching time.
4789 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004790}
Tej Singh86dc9db2018-09-06 00:39:57 +00004791
4792/**
4793 * Pulls disk information, such as write speed and latency.
4794 */
4795message DiskStats {
4796 // Time taken to open, write 512B to, and close a file.
4797 // -1 if error performing the check.
4798 optional int64 data_write_latency_millis = 1;
4799
4800 optional bool file_based_encryption = 2;
4801
4802 // Recent disk write speed in kB/s.
4803 // -1 if error querying storageed.
4804 // 0 if data is unavailable.
4805 optional int32 recent_disk_write_speed = 3;
4806}
4807
4808
4809/**
4810 * Free and total bytes of the Data, Cache, and System partition.
4811 */
4812message DirectoryUsage {
4813 enum Directory {
4814 UNKNOWN = 0;
4815 DATA = 1;
4816 CACHE = 2;
4817 SYSTEM = 3;
4818 }
4819 optional Directory directory = 1;
4820 optional int64 free_bytes = 2;
4821 optional int64 total_bytes = 3;
4822}
4823
4824
4825/**
4826 * Size of an application: apk size, data size, and cache size.
4827 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4828 * Information is only reported for apps with the primary user (user 0).
4829 * Sizes are aggregated by package name.
4830 */
4831message AppSize {
4832 // Including uids will involve modifying diskstats logic.
4833 optional string package_name = 1;
4834 // App size in bytes. -1 if unavailable.
4835 optional int64 app_size_bytes = 2;
4836 // App data size in bytes. -1 if unavailable.
4837 optional int64 app_data_size_bytes = 3;
4838 // App cache size in bytes. -1 if unavailable.
4839 optional int64 app_cache_size_bytes = 4;
4840 // Time that the cache file was produced.
4841 // Uses System.currentTimeMillis(), which is wall clock time.
4842 optional int64 cache_time_millis = 5;
4843}
4844
4845
4846/**
4847 * Size of a particular category. Eg: photos, videos.
4848 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4849 */
4850message CategorySize {
4851 enum Category {
4852 UNKNOWN = 0;
4853 APP_SIZE = 1;
4854 APP_DATA_SIZE = 2;
4855 APP_CACHE_SIZE = 3;
4856 PHOTOS = 4;
4857 VIDEOS = 5;
4858 AUDIO = 6;
4859 DOWNLOADS = 7;
4860 SYSTEM = 8;
4861 OTHER = 9;
4862 }
4863 optional Category category = 1;
4864 // Category size in bytes.
4865 optional int64 size_bytes = 2;
4866 // Time that the cache file was produced.
4867 // Uses System.currentTimeMillis(), which is wall clock time.
4868 optional int64 cache_time_millis = 3;
4869}
Tej Singhd6d6d772018-09-05 17:41:25 -07004870
4871/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004872 * Pulls per uid I/O stats. The stats are cumulative since boot.
4873 *
4874 * Read/write bytes are I/O events from a storage device
4875 * Read/write chars are data requested by read/write syscalls, and can be
4876 * satisfied by caching.
4877 *
4878 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4879 */
4880message DiskIo {
4881 optional int32 uid = 1 [(is_uid) = true];
4882 optional int64 fg_chars_read = 2;
4883 optional int64 fg_chars_write = 3;
4884 optional int64 fg_bytes_read = 4;
4885 optional int64 fg_bytes_write = 5;
4886 optional int64 bg_chars_read = 6;
4887 optional int64 bg_chars_write = 7;
4888 optional int64 bg_bytes_read = 8;
4889 optional int64 bg_bytes_write = 9;
4890 optional int64 fg_fsync = 10;
4891 optional int64 bg_fsync= 11;
4892}
4893
4894
4895/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004896 * Pulls the number of fingerprints for each user.
4897 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004898 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004899 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004900message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004901 // The associated user. Eg: 0 for owners, 10+ for others.
4902 // Defined in android/os/UserHandle.java
4903 optional int32 user = 1;
4904 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004905 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004906}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004907
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004908/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004909 * Pulls the number of faces for each user.
4910 *
4911 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4912 */
4913message NumFacesEnrolled {
4914 // The associated user. Eg: 0 for owners, 10+ for others.
4915 // Defined in android/os/UserHandle.java
4916 optional int32 user = 1;
4917 // Number of faces registered to that user.
4918 optional int32 num_faces_enrolled = 2;
4919}
4920/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004921 * A mapping of role holder -> role
4922 */
4923message RoleHolder {
4924 // uid of the role holder
4925 optional int32 uid = 1 [(is_uid) = true];
4926
4927 // package name of the role holder
4928 optional string package_name = 2;
4929
4930 // the role held
4931 optional string role = 3;
4932}
4933
Yangsteraf9aee72018-10-12 09:26:16 -07004934message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004935 // These are all in byte resolution.
4936 optional int64 min = 1 [deprecated = true];
4937 optional int64 average = 2 [deprecated = true];
4938 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07004939
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004940 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
4941 // int64 fields.
4942 optional int32 mean_kb = 4;
4943 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07004944}
4945
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004946// A reduced subset of process states; reducing the number of possible states allows more
4947// aggressive device-side aggregation of statistics and hence reduces metric upload size.
4948enum ProcessStateAggregated {
4949 PROCESS_STATE_UNKNOWN = 0;
4950 // Persistent system process.
4951 PROCESS_STATE_PERSISTENT = 1;
4952 // Top activity; actually any visible activity.
4953 PROCESS_STATE_TOP = 2;
4954 // Process binding to top or a foreground service.
4955 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
4956 // Processing running a foreground service.
4957 PROCESS_STATE_FGS = 4;
4958 // Important foreground process (ime, wallpaper, etc).
4959 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
4960 // Important background process.
4961 PROCESS_STATE_BACKGROUND = 6;
4962 // Process running a receiver.
4963 PROCESS_STATE_RECEIVER = 7;
4964 // All kinds of cached processes.
4965 PROCESS_STATE_CACHED = 8;
4966}
4967
4968// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07004969message ProcessStatsStateProto {
4970 optional android.service.procstats.ScreenState screen_state = 1;
4971
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004972 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07004973
4974 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4975 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004976 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
4977
4978 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07004979
4980 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004981 optional int64 duration_millis = 4 [deprecated = true];
4982 // Same as above, but with minute resolution so it fits into an int32.
4983 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07004984
4985 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004986 optional int64 realtime_duration_millis = 9 [deprecated = true];
4987 // Same as above, but with minute resolution so it fits into an int32.
4988 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07004989
4990 // # of samples taken
4991 optional int32 sample_size = 5;
4992
4993 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004994 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07004995
4996 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004997 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07004998
4999 // RSS is memory resident for this process
5000 optional AggStats rss = 8;
5001}
5002
5003// Next Tag: 7
5004message ProcessStatsProto {
5005 // Name of process.
5006 optional string process = 1;
5007
5008 // Uid of the process.
5009 optional int32 uid = 2;
5010
5011 // Information about how often kills occurred
5012 message Kill {
5013 // Count of excessive CPU kills
5014 optional int32 cpu = 1;
5015
5016 // Count of kills when cached
5017 optional int32 cached = 2;
5018
5019 // PSS stats during cached kill
5020 optional AggStats cached_pss = 3;
5021 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005022 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005023
5024 // Time and memory spent in various states.
5025 repeated ProcessStatsStateProto states = 5;
5026
5027 // Total time process has been running... screen_state, memory_state, and process_state
5028 // will not be set.
5029 optional ProcessStatsStateProto total_running_state = 6;
5030}
5031
5032message PackageServiceOperationStatsProto {
5033 // Operate enum: Started, Foreground, Bound, Executing
5034 optional android.service.procstats.ServiceOperationState operation = 1;
5035
5036 // Number of times the service was in this operation.
5037 optional int32 count = 2;
5038
5039 // Information about a state the service can be in.
5040 message StateStats {
5041 // Screen state enum.
5042 optional android.service.procstats.ScreenState screen_state = 1;
5043 // Memory state enum.
5044 optional android.service.procstats.MemoryState memory_state = 2;
5045
5046 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005047 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005048 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005049 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005050 }
5051 repeated StateStats state_stats = 3;
5052}
5053
5054message PackageServiceStatsProto {
5055 // Name of service component.
5056 optional string service_name = 1;
5057
5058 // The operation stats.
5059 // The package_name, package_uid, package_version, service_name will not be set to save space.
5060 repeated PackageServiceOperationStatsProto operation_stats = 2;
5061}
5062
5063message PackageAssociationSourceProcessStatsProto {
5064 // Uid of the process.
5065 optional int32 process_uid = 1;
5066 // Process name.
5067 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005068 // Package name.
5069 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005070 // Total count of the times this association appeared.
5071 optional int32 total_count = 3;
5072
5073 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005074 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005075
5076 // Total count of the times this association became actively impacting its target process.
5077 optional int32 active_count = 5;
5078
5079 // Information on one source in this association.
5080 message StateStats {
5081 // Process state enum.
5082 optional android.service.procstats.ProcessState process_state = 1;
5083 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005084 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005085 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005086 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005087 }
5088 repeated StateStats active_state_stats = 6;
5089}
5090
5091message PackageAssociationProcessStatsProto {
5092 // Name of the target component.
5093 optional string component_name = 1;
5094 // Information on one source in this association.
5095 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5096}
5097
5098
5099message ProcessStatsPackageProto {
5100 // Name of package.
5101 optional string package = 1;
5102
5103 // Uid of the package.
5104 optional int32 uid = 2;
5105
5106 // Version of the package.
5107 optional int64 version = 3;
5108
5109 // Stats for each process running with the package loaded in to it.
5110 repeated ProcessStatsProto process_stats = 4;
5111
5112 // Stats for each of the package's services.
5113 repeated PackageServiceStatsProto service_stats = 5;
5114
5115 // Stats for each association with the package.
5116 repeated PackageAssociationProcessStatsProto association_stats = 6;
5117}
5118
5119message ProcessStatsSectionProto {
5120 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005121 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005122
5123 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005124 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005125
5126 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005127 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005128
5129 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005130 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005131
5132 // System runtime library. e.g. "libdvm.so", "libart.so".
5133 optional string runtime = 5;
5134
5135 // whether kernel reports swapped pss.
5136 optional bool has_swapped_pss = 6;
5137
5138 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5139 enum Status {
5140 STATUS_UNKNOWN = 0;
5141 STATUS_COMPLETE = 1;
5142 STATUS_PARTIAL = 2;
5143 STATUS_SHUTDOWN = 3;
5144 STATUS_SYSPROPS = 4;
5145 }
5146 repeated Status status = 7;
5147
Chenjie Yub2ecc792019-01-17 10:27:26 -08005148 // Number of pages available of various types and sizes, representation fragmentation.
5149 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5150
Yangsteraf9aee72018-10-12 09:26:16 -07005151 // Stats for each process.
5152 repeated ProcessStatsProto process_stats = 8;
5153
5154 // Stats for each package.
5155 repeated ProcessStatsPackageProto package_stats = 9;
5156}
5157
Chenjie Yub2ecc792019-01-17 10:27:26 -08005158message ProcessStatsAvailablePagesProto {
5159 // Node these pages are in (as per /proc/pagetypeinfo)
5160 optional int32 node = 1;
5161
5162 // Zone these pages are in (as per /proc/pagetypeinfo)
5163 optional string zone = 2;
5164
5165 // Label for the type of these pages (as per /proc/pagetypeinfo)
5166 optional string label = 3;
5167
5168 // Distribution of number of pages available by order size. First entry in array is
5169 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5170 repeated int32 pages_per_order = 4;
5171}
5172
Chenjie Yu12e5e672018-09-14 15:54:59 -07005173/**
5174 * Pulled from ProcessStatsService.java
5175 */
5176message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005177 optional ProcessStatsSectionProto proc_stats_section = 1;
5178}
5179
Chenjie Yuf910b7802019-01-11 16:08:20 -08005180/**
5181 * Pulled from ProcessStatsService.java
5182 */
5183message ProcStatsPkgProc {
5184 optional ProcessStatsSectionProto proc_stats_section = 1;
5185}
5186
Chris Wrencdea3b72019-11-22 16:58:17 -05005187// Next Tag: 2
5188message PackageRemoteViewInfoProto {
5189 optional string package_name = 1;
5190 // add per-package additional info here (like channels)
5191}
5192
5193// Next Tag: 2
5194message NotificationRemoteViewsProto {
5195 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5196}
5197
5198/**
5199 * Pulled from NotificationManagerService.java
5200 */
5201message NotificationRemoteViews {
5202 optional NotificationRemoteViewsProto notification_remote_views = 1;
5203}
5204
Yangsteraf9aee72018-10-12 09:26:16 -07005205message PowerProfileProto {
5206 optional double cpu_suspend = 1;
5207
5208 optional double cpu_idle = 2;
5209
5210 optional double cpu_active = 3;
5211
5212 message CpuCluster {
5213 optional int32 id = 1;
5214 optional double cluster_power = 2;
5215 optional int32 cores = 3;
5216 repeated int64 speed = 4;
5217 repeated double core_power = 5;
5218 }
5219
5220 repeated CpuCluster cpu_cluster = 40;
5221
5222 optional double wifi_scan = 4;
5223
5224 optional double wifi_on = 5;
5225
5226 optional double wifi_active = 6;
5227
5228 optional double wifi_controller_idle = 7;
5229
5230 optional double wifi_controller_rx = 8;
5231
5232 optional double wifi_controller_tx = 9;
5233
5234 repeated double wifi_controller_tx_levels = 10;
5235
5236 optional double wifi_controller_operating_voltage = 11;
5237
5238 optional double bluetooth_controller_idle = 12;
5239
5240 optional double bluetooth_controller_rx = 13;
5241
5242 optional double bluetooth_controller_tx = 14;
5243
5244 optional double bluetooth_controller_operating_voltage = 15;
5245
5246 optional double modem_controller_sleep = 16;
5247
5248 optional double modem_controller_idle = 17;
5249
5250 optional double modem_controller_rx = 18;
5251
5252 repeated double modem_controller_tx = 19;
5253
5254 optional double modem_controller_operating_voltage = 20;
5255
5256 optional double gps_on = 21;
5257
5258 repeated double gps_signal_quality_based = 22;
5259
5260 optional double gps_operating_voltage = 23;
5261
5262 optional double bluetooth_on = 24;
5263
5264 optional double bluetooth_active = 25;
5265
5266 optional double bluetooth_at_cmd = 26;
5267
5268 optional double ambient_display = 27;
5269
5270 optional double screen_on = 28;
5271
5272 optional double radio_on = 29;
5273
5274 optional double radio_scanning = 30;
5275
5276 optional double radio_active = 31;
5277
5278 optional double screen_full = 32;
5279
5280 optional double audio = 33;
5281
5282 optional double video = 34;
5283
5284 optional double flashlight = 35;
5285
5286 optional double memory = 36;
5287
5288 optional double camera = 37;
5289
5290 optional double wifi_batched_scan = 38;
5291
5292 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005293}
Chenjie Yuab530202018-09-26 12:39:20 -07005294
5295/**
5296 * power_profile.xml and other constants for power model calculations.
5297 * Pulled from PowerProfile.java
5298 */
5299message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005300 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005301}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005302
5303/**
arangelovd5db50e2018-10-12 20:24:39 +01005304 * Logs when a user restriction was added or removed.
5305 *
5306 * Logged from:
5307 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5308 */
5309message UserRestrictionChanged {
5310 // The raw string of the user restriction as defined in UserManager.
5311 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5312 optional string restriction = 1;
5313 // Whether the restriction is enabled or disabled.
5314 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005315}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005316
5317/**
5318 * Pulls process user time and system time. Puller takes a snapshot of all pids
5319 * in the system and returns cpu stats for those that are working at the time.
5320 * Dead pids will be dropped. Kernel processes are excluded.
5321 * Min cool-down is 5 sec.
5322 */
5323message ProcessCpuTime {
5324 optional int32 uid = 1 [(is_uid) = true];
5325
5326 optional string process_name = 2;
5327 // Process cpu time in user space, cumulative from boot/process start
5328 optional int64 user_time_millis = 3;
5329 // Process cpu time in system space, cumulative from boot/process start
5330 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005331}
Misha Wagner5a51e002018-10-03 15:04:09 +01005332
5333/**
5334 * Pulls the CPU usage for each thread.
5335 *
5336 * Read from /proc/$PID/task/$TID/time_in_state files.
5337 *
5338 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5339 * time_in_state files not being present on some phones, have not been addressed. These should be
5340 * considered before a public release.
5341 */
5342message CpuTimePerThreadFreq {
5343 // UID that owns the process.
5344 optional int32 uid = 1 [(is_uid) = true];
5345 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005346 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005347 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005348 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005349 // Name of the process taken from `/proc/$PID/cmdline`.
5350 optional string process_name = 4;
5351 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5352 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005353
5354 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5355 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5356 // frequencies are given here as the alternative is sending eight separate atoms. This method
5357 // significantly reduces the amount of data created
5358 optional int32 frequency1_khz = 6;
5359 optional int32 time1_millis = 7;
5360 optional int32 frequency2_khz = 8;
5361 optional int32 time2_millis = 9;
5362 optional int32 frequency3_khz = 10;
5363 optional int32 time3_millis = 11;
5364 optional int32 frequency4_khz = 12;
5365 optional int32 time4_millis = 13;
5366 optional int32 frequency5_khz = 14;
5367 optional int32 time5_millis = 15;
5368 optional int32 frequency6_khz = 16;
5369 optional int32 time6_millis = 17;
5370 optional int32 frequency7_khz = 18;
5371 optional int32 time7_millis = 19;
5372 optional int32 frequency8_khz = 20;
5373 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005374}
Bookatz75ee60422018-11-09 12:27:37 -08005375
5376/**
Bookatz366a4432018-11-20 09:42:33 -08005377 * Pulls information about the device's build.
5378 */
5379message BuildInformation {
5380 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5381 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5382 optional string fingerprint = 1;
5383
5384 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5385 optional string brand = 2;
5386
5387 // Build.PRODUCT. The name of the overall product.
5388 optional string product = 3;
5389
5390 // Build.DEVICE. The name of the industrial design.
5391 optional string device = 4;
5392
5393 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5394 optional string version_release = 5;
5395
5396 // Build.ID. E.g. a label like "M4-rc20".
5397 optional string id = 6;
5398
5399 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5400 // represent this build.
5401 optional string version_incremental = 7;
5402
5403 // Build.TYPE. The type of build, like "user" or "eng".
5404 optional string type = 8;
5405
5406 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5407 optional string tags = 9;
5408}
5409
5410/**
Adam He420947c2019-01-23 15:59:09 -08005411 * Logs information about mismatched caller for content capture.
5412 *
5413 * Logged from:
5414 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5415 */
5416message ContentCaptureCallerMismatchReported {
5417 optional string intended_package = 1;
5418 optional string calling_package = 2;
5419}
5420
5421/**
5422 * Logs information about content capture service events.
5423 *
5424 * Logged from:
5425 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5426 */
5427message ContentCaptureServiceEvents {
5428 // The type of event.
5429 enum Event {
5430 UNKNOWN = 0;
5431 ON_CONNECTED = 1;
5432 ON_DISCONNECTED = 2;
5433 SET_WHITELIST = 3;
5434 SET_DISABLED = 4;
5435 ON_USER_DATA_REMOVED = 5;
5436 }
5437 optional Event event = 1;
5438 // component/package of content capture service.
5439 optional string service_info = 2;
5440 // component/package of target.
5441 // it's a concatenated list of component/package for SET_WHITELIST event
5442 // separated by " ".
5443 optional string target_info = 3;
5444}
5445
5446/**
5447 * Logs information about content capture session events.
5448 *
5449 * Logged from:
5450 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5451 */
5452message ContentCaptureSessionEvents {
5453 // The type of event.
5454 enum Event {
5455 UNKNOWN = 0;
5456 ON_SESSION_STARTED = 1;
5457 ON_SESSION_FINISHED = 2;
5458 SESSION_NOT_CREATED = 3;
5459 }
5460 optional int32 session_id = 1;
5461 optional Event event = 2;
5462 // (n/a on session finished)
5463 optional int32 state_flags = 3;
5464 // component/package of content capture service.
5465 optional string service_info = 4;
5466 // component/package of app.
5467 // (n/a on session finished)
5468 optional string app_info = 5;
5469 optional bool is_child_session = 6;
5470}
5471
5472/**
5473 * Logs information about session being flushed.
5474 *
5475 * Logged from:
5476 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5477 */
5478message ContentCaptureFlushed {
5479 optional int32 session_id = 1;
5480 // component/package of content capture service.
5481 optional string service_info = 2;
5482 // component/package of app.
5483 optional string app_info = 3;
5484 // session start/finish events
5485 optional int32 child_session_started = 4;
5486 optional int32 child_session_finished = 5;
5487 // count of view events.
5488 optional int32 view_appeared_count = 6;
5489 optional int32 view_disappeared_count = 7;
5490 optional int32 view_text_changed_count = 8;
5491
5492 // Flush stats.
5493 optional int32 max_events = 9;
5494 optional int32 idle_flush_freq = 10;
5495 optional int32 text_flush_freq = 11;
5496 optional int32 flush_reason = 12;
5497}
5498
5499/**
Bookatz75ee60422018-11-09 12:27:37 -08005500 * Pulls on-device BatteryStats power use calculations for the overall device.
5501 */
5502message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005503 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5504 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5505 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5506 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005507}
5508
5509/**
5510 * Pulls on-device BatteryStats power use calculations broken down by uid.
5511 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5512 * that is attributed to non-uid items. They must all be included to get the total power use.
5513 */
5514message DeviceCalculatedPowerBlameUid {
5515 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5516 optional int32 uid = 1 [(is_uid) = true];
5517
Bookatz3dbc13a2018-12-21 12:16:51 -08005518 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5519 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5520 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005521}
5522
5523/**
5524 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5525 * drain type.
5526 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5527 * is attributed uids. They must all be included to get the total power use.
5528 */
5529message DeviceCalculatedPowerBlameOther {
5530 // The type of item whose power use is being reported.
5531 enum DrainType {
5532 AMBIENT_DISPLAY = 0;
5533 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5534 BLUETOOTH = 2;
5535 CAMERA = 3;
5536 // Cell-standby
5537 CELL = 4;
5538 FLASHLIGHT = 5;
5539 IDLE = 6;
5540 MEMORY = 7;
5541 // Amount that total computed drain exceeded the drain estimated using the
5542 // battery level changes and capacity.
5543 OVERCOUNTED = 8;
5544 PHONE = 9;
5545 SCREEN = 10;
5546 // Amount that total computed drain was below the drain estimated using the
5547 // battery level changes and capacity.
5548 UNACCOUNTED = 11;
5549 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5550 WIFI = 13;
5551 }
5552 optional DrainType drain_type = 1;
5553
Bookatz3dbc13a2018-12-21 12:16:51 -08005554 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5555 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5556 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005557}
arangelov4e994062018-11-13 16:12:38 +00005558
5559/**
5560 * Logs device policy features.
5561 *
5562 * Logged from:
5563 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5564 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5565 */
5566message DevicePolicyEvent {
5567 // The event id - unique for each event.
5568 optional android.stats.devicepolicy.EventId event_id = 1;
5569 // The admin package name.
5570 optional string admin_package_name = 2;
5571 // A generic integer parameter.
5572 optional int32 integer_value = 3;
5573 // A generic boolean parameter.
5574 optional bool boolean_value = 4;
5575 // A parameter specifying a time period in milliseconds.
5576 optional uint64 time_period_millis = 5;
5577 // A parameter specifying a list of package names, bundle extras or string parameters.
5578 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5579}
shawnlinea5b66b2018-11-13 15:05:29 +08005580
5581/**
5582 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5583 *
5584 * Logged from:
5585 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5586 */
5587message DocsUILaunchReported {
5588 optional android.stats.docsui.LaunchAction launch_action = 1;
5589 optional bool has_initial_uri = 2;
5590 optional android.stats.docsui.MimeType mime_type = 3;
5591 optional android.stats.docsui.Root initial_root = 4;
5592}
5593
5594/**
5595 * Logs root/app visited event in file managers/picker. Call this when the user
5596 * taps on root/app in hamburger menu.
5597 *
5598 * Logged from:
5599 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5600 */
5601message DocsUIRootVisitedReported {
5602 optional android.stats.docsui.ContextScope scope = 1;
5603 optional android.stats.docsui.Root root = 2;
5604}
5605
5606/**
5607 * Logs file operation stats. Call this when a file operation has completed.
5608 *
5609 * Logged from:
5610 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5611 */
5612message DocsUIFileOperationReported {
5613 optional android.stats.docsui.Provider provider = 1;
5614 optional android.stats.docsui.FileOperation file_op = 2;
5615}
5616
5617/**
5618 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5619 * mode.
5620 *
5621 * Logged from:
5622 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5623 */
5624message DocsUIFileOperationCopyMoveModeReported {
5625 optional android.stats.docsui.FileOperation file_op = 1;
5626 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5627}
5628
5629
5630/**
5631 * Logs file sub operation stats. Call this when a file operation has failed.
5632 *
5633 * Logged from:
5634 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5635 */
5636message DocsUIFileOperationFailureReported {
5637 optional android.stats.docsui.Authority authority = 1;
5638 optional android.stats.docsui.SubFileOperation sub_op = 2;
5639}
5640
5641/**
5642* Logs the cancellation of a file operation. Call this when a job is canceled
5643*
5644* Logged from:
5645* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5646*/
5647message DocsUIFileOperationCanceledReported {
5648 optional android.stats.docsui.FileOperation file_op = 1;
5649}
5650
5651/**
5652 * Logs startup time in milliseconds.
5653 *
5654 * Logged from:
5655 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5656 */
5657message DocsUIStartupMsReported {
5658 optional int32 startup_millis = 1;
5659}
5660
5661/**
5662 * Logs the action that was started by user.
5663 *
5664 * Logged from:
5665 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5666 */
5667message DocsUIUserActionReported {
5668 optional android.stats.docsui.UserAction action = 1;
5669}
5670
5671/**
5672 * Logs the invalid type when invalid scoped access is requested.
5673 *
5674 * Logged from:
5675 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5676 */
5677message DocsUIInvalidScopedAccessRequestReported {
5678 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005679}
Ben Murdochbab399f62018-12-06 11:01:38 +00005680
5681/**
shawnlina75e82d2019-01-07 10:31:12 +08005682 * Logs the package name that launches docsui picker mode.
5683 *
5684 * Logged from:
5685 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5686 */
5687message DocsUIPickerLaunchedFromReported {
5688 optional string package_name = 1;
5689}
5690
5691/**
5692 * Logs the search type.
5693 *
5694 * Logged from:
5695 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5696 */
5697message DocsUISearchTypeReported {
5698 optional android.stats.docsui.SearchType search_type = 1;
5699}
5700
5701/**
5702 * Logs the search mode.
5703 *
5704 * Logged from:
5705 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5706 */
5707message DocsUISearchModeReported {
5708 optional android.stats.docsui.SearchMode search_mode = 1;
5709}
5710
5711/**
5712 * Logs the pick result information.
5713 *
5714 * Logged from:
5715 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5716 */
5717message DocsUIPickResultReported {
5718 optional int32 total_action_count = 1;
5719 optional int64 duration_millis = 2;
5720 optional int32 file_count= 3;
5721 optional bool is_searching = 4;
5722 optional android.stats.docsui.Root picked_from = 5;
5723 optional android.stats.docsui.MimeType mime_type = 6;
5724 optional int32 repeatedly_pick_times = 7;
5725}
5726
5727/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005728 * Logs when an app's memory is compacted.
5729 *
5730 * Logged from:
5731 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5732 */
5733message AppCompacted {
5734 // The pid of the process being compacted.
5735 optional int32 pid = 1;
5736
5737 // The name of the process being compacted.
5738 optional string process_name = 2;
5739
5740 // The type of compaction.
5741 enum Action {
5742 UNKNOWN = 0;
5743 SOME = 1;
5744 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005745 PERSISTENT = 3;
5746 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005747 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005748 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005749
5750 // Total RSS in kilobytes consumed by the process prior to compaction.
5751 optional int64 before_rss_total_kilobytes = 4;
5752
5753 // File RSS in kilobytes consumed by the process prior to compaction.
5754 optional int64 before_rss_file_kilobytes = 5;
5755
5756 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5757 optional int64 before_rss_anon_kilobytes = 6;
5758
5759 // Swap in kilobytes consumed by the process prior to compaction.
5760 optional int64 before_swap_kilobytes = 7;
5761
5762 // Total RSS in kilobytes consumed by the process after compaction.
5763 optional int64 after_rss_total_kilobytes = 8;
5764
5765 // File RSS in kilobytes consumed by the process after compaction.
5766 optional int64 after_rss_file_kilobytes = 9;
5767
5768 // Anonymous RSS in kilobytes consumed by the process after compaction.
5769 optional int64 after_rss_anon_kilobytes = 10;
5770
5771 // Swap in kilobytes consumed by the process after compaction.
5772 optional int64 after_swap_kilobytes = 11;
5773
5774 // The time taken to perform compaction in milliseconds.
5775 optional int64 time_to_compact_millis = 12;
5776
5777 // The last compaction action performed for this app.
5778 optional Action last_action = 13;
5779
Ben Murdoch01720b82018-12-19 18:03:44 +00005780 // The last time that compaction was attempted on this process in milliseconds
5781 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5782 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005783
Ben Murdoch885c21b2019-03-15 18:02:04 +00005784 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005785 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005786
5787 // The process state at the time of compaction.
5788 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005789
5790 // Free ZRAM in kilobytes before compaction.
5791 optional int64 before_zram_free_kilobytes = 17;
5792
5793 // Free ZRAM in kilobytes after compaction.
5794 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005795}
lifr157fc552018-12-12 16:38:04 +08005796
5797/**
lifrb6b90b62019-03-29 00:40:17 +08005798 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5799 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5800 *
lifr1f74b052019-04-16 22:16:30 +08005801 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5802 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5803 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5804 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005805 */
5806message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005807 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005808
lifr1f74b052019-04-16 22:16:30 +08005809 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005810
5811 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005812 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005813
lifr1f74b052019-04-16 22:16:30 +08005814 // Only valid for event_type = EVENT_GETADDRINFO.
5815 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005816
lifr1f74b052019-04-16 22:16:30 +08005817 // Flags passed to android_res_nsend() defined in multinetwork.h
5818 // Only valid for event_type = EVENT_RESNSEND.
5819 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005820
lifrad9becc2019-05-20 11:04:41 +08005821 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005822
5823 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005824 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005825
5826 // Additional pass-through fields opaque to statsd.
5827 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005828 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005829
5830 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5831 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005832}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005833
5834/**
5835 * Logs when a data stall event occurs.
5836 *
5837 * Log from:
5838 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5839 */
5840message DataStallEvent {
5841 // Data stall evaluation type.
5842 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5843 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5844 optional int32 evaluation_type = 1;
5845 // See definition in data_stall_event.proto.
5846 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5847 // See definition in data_stall_event.proto.
5848 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5849 // See definition in data_stall_event.proto.
5850 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5851 // See definition in data_stall_event.proto.
5852 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5853 // See definition in data_stall_event.proto.
5854 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5855}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005856
5857/*
5858 * Logs when RescueParty resets some set of experiment flags.
5859 *
5860 * Logged from:
5861 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5862 */
5863message RescuePartyResetReported {
5864 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5865 optional int32 rescue_level = 1;
5866}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005867
5868/**
5869 * Logs when signed config is received from an APK, and if that config was applied successfully.
5870 * Logged from:
5871 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5872 */
5873message SignedConfigReported {
5874 enum Type {
5875 UNKNOWN_TYPE = 0;
5876 GLOBAL_SETTINGS = 1;
5877 }
5878 optional Type type = 1;
5879
5880 // The final status of the signed config received.
5881 enum Status {
5882 UNKNOWN_STATUS = 0;
5883 APPLIED = 1;
5884 BASE64_FAILURE_CONFIG = 2;
5885 BASE64_FAILURE_SIGNATURE = 3;
5886 SECURITY_EXCEPTION = 4;
5887 INVALID_CONFIG = 5;
5888 OLD_CONFIG = 6;
5889 SIGNATURE_CHECK_FAILED = 7;
5890 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005891 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005892 }
5893 optional Status status = 2;
5894
5895 // The version of the signed config processed.
5896 optional int32 version = 3;
5897
5898 // The package name that the config was extracted from.
5899 optional string from_package = 4;
5900
5901 enum Key {
5902 NO_KEY = 0;
5903 DEBUG = 1;
5904 PRODUCTION = 2;
5905 }
5906 // Which key was used to verify the config.
5907 optional Key verified_with = 5;
5908}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005909
5910/*
5911 * Logs GNSS Network-Initiated (NI) location events.
5912 *
5913 * Logged from:
5914 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5915 */
5916message GnssNiEventReported {
5917 // The type of GnssNiEvent.
5918 enum EventType {
5919 UNKNOWN = 0;
5920 NI_REQUEST = 1;
5921 NI_RESPONSE = 2;
5922 }
5923 optional EventType event_type = 1;
5924
5925 // An ID generated by HAL to associate NI notifications and UI responses.
5926 optional int32 notification_id = 2;
5927
5928 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005929 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005930
5931 // NI requires notification.
5932 optional bool need_notify = 4;
5933
5934 // NI requires verification.
5935 optional bool need_verify = 5;
5936
5937 // NI requires privacy override, no notification/minimal trace.
5938 optional bool privacy_override = 6;
5939
5940 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5941 // seconds.
5942 optional int32 timeout = 7;
5943
5944 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005945 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005946
5947 // String representing the requester of the network inititated location request.
5948 optional string requestor_id = 9;
5949
5950 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5951 // network initiated location request.
5952 optional string text = 10;
5953
5954 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005955 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005956
5957 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005958 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005959
5960 // True if SUPL ES is enabled.
5961 optional bool is_supl_es_enabled = 13;
5962
5963 // True if GNSS location is enabled.
5964 optional bool is_location_enabled = 14;
5965
5966 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005967 optional android.server.location.GnssUserResponseType user_response = 15;
5968}
5969
5970/**
5971 * Logs GNSS non-framework (NFW) location notification.
5972 *
5973 * Logged from:
5974 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5975 */
5976message GnssNfwNotificationReported {
5977 // Package name of the Android proxy application representing the non-framework entity that
5978 // requested location. Set to empty string if unknown.
5979 optional string proxy_app_package_name = 1;
5980
5981 // Protocol stack that initiated the non-framework location request.
5982 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5983
5984 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5985 // set to empty string. This field is opaque to the framework and used for logging purposes.
5986 optional string other_protocol_stack_name = 3;
5987
5988 // Source initiating/receiving the location information.
5989 optional android.server.location.NfwRequestor requestor = 4;
5990
5991 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5992 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5993 // and used for logging purposes.
5994 optional string requestor_id = 5;
5995
5996 // Indicates whether location information was provided for this request.
5997 optional android.server.location.NfwResponseType response_type = 6;
5998
5999 // True if the device is in user initiated emergency session.
6000 optional bool in_emergency_mode = 7;
6001
6002 // True if cached location is provided.
6003 optional bool is_cached_location = 8;
6004
6005 // True if proxy app permission mismatch between framework and GNSS HAL.
6006 optional bool is_permission_mismatched = 9;
6007}
6008
6009/**
6010 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6011 *
6012 * Logged from:
6013 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6014 */
6015message GnssConfigurationReported {
6016 // SUPL host name.
6017 optional string supl_host = 1;
6018
6019 // SUPL port number.
6020 optional int32 supl_port = 2;
6021
6022 // C2K host name.
6023 optional string c2k_host = 3;
6024
6025 // C2K port number.
6026 optional int32 c2k_port = 4;
6027
6028 // The SUPL version requested by Carrier.
6029 optional int32 supl_ver = 5;
6030
6031 // The SUPL mode.
6032 optional android.server.location.SuplMode supl_mode = 6;
6033
6034 // True if NI emergency SUPL restrictions is enabled.
6035 optional bool supl_es = 7;
6036
6037 // LTE Positioning Profile settings
6038 optional android.server.location.LppProfile lpp_profile = 8;
6039
6040 // Positioning protocol on A-Glonass system.
6041 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6042
6043 // True if emergency PDN is used. Otherwise, regular PDN is used.
6044 optional bool use_emergency_pdn_for_emergency_supl= 10;
6045
6046 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6047 optional android.server.location.GpsLock gps_lock = 11;
6048
6049 // Number of seconds to extend the emergency session duration post emergency call.
6050 optional int32 es_extension_sec = 12;
6051
6052 // The full list of package names of proxy Android applications representing the non-framework
6053 // location access entities (on/off the device) for which the framework user has granted
6054 // non-framework location access permission. The package names are concatenated in one string
6055 // with spaces as separators.
6056 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006057}
Jack Yu95b64f32018-12-13 18:26:11 +08006058
6059/**
6060 * Logs when a NFC device's error occurred.
6061 * Logged from:
6062 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6063 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6064 */
6065message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006066 enum Type {
6067 UNKNOWN = 0;
6068 CMD_TIMEOUT = 1;
6069 ERROR_NOTIFICATION = 2;
6070 AID_OVERFLOW = 3;
6071 }
6072 optional Type type = 1;
6073 // If it's nci cmd timeout, log the timeout command.
6074 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006075
Alex Salod7c3eef2019-01-25 14:43:27 -08006076 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006077}
6078
6079/**
6080 * Logs when a NFC device's state changed event
6081 * Logged from:
6082 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6083 */
6084message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006085 enum State {
6086 UNKNOWN = 0;
6087 OFF = 1;
6088 ON = 2;
6089 ON_LOCKED = 3; // Secure Nfc enabled.
6090 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6091 }
6092 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006093}
6094
6095/**
6096 * Logs when a NFC Beam Transaction occurred.
6097 * Logged from:
6098 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6099 */
6100message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006101 enum Operation {
6102 UNKNOWN = 0;
6103 SEND = 1;
6104 RECEIVE = 2;
6105 }
6106 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006107}
6108
6109/**
6110 * Logs when a NFC Card Emulation Transaction occurred.
6111 * Logged from:
6112 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6113 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6114 */
6115message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006116 enum Category {
6117 UNKNOWN = 0;
6118 HCE_PAYMENT = 1;
6119 HCE_OTHER = 2;
6120 OFFHOST = 3;
6121 }
6122 // Transaction belongs to HCE payment or HCE other category, or offhost.
6123 optional Category category = 1;
6124 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6125 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006126}
6127
6128/**
6129 * Logs when a NFC Tag event occurred.
6130 * Logged from:
6131 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6132 */
6133message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006134 enum Type {
6135 UNKNOWN = 0;
6136 URL = 1;
6137 BT_PAIRING = 2;
6138 PROVISION = 3;
6139 WIFI_CONNECT = 4;
6140 APP_LAUNCH = 5;
6141 OTHERS = 6;
6142 }
6143 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006144}
6145
6146/**
6147 * Logs when Hce transaction triggered
6148 * Logged from:
6149 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6150 */
6151message NfcHceTransactionOccurred {
6152 // The latency period(in microseconds) it took for the first HCE data
6153 // exchange.
6154 optional uint32 latency_micros = 1;
6155}
6156
6157/**
6158 * Logs when SecureElement state event changed
6159 * Logged from:
6160 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6161 */
6162message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006163 enum State {
6164 UNKNOWN = 0;
6165 INITIALIZED = 1;
6166 DISCONNECTED = 2;
6167 CONNECTED = 3;
6168 HALCRASH = 4;
6169 }
6170 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006171
Alex Salod7c3eef2019-01-25 14:43:27 -08006172 optional string state_change_reason = 2;
6173 // SIMx or eSEx.
6174 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006175}
6176
6177/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006178 * Information about a permission grant request
6179 */
6180message PermissionGrantRequestResultReported {
6181 // unique value identifying an API call. A API call might result in multiple of these atoms
6182 optional int64 request_id = 1;
6183
6184 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006185 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006186
6187 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006188 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006189
6190 // The permission to be granted
6191 optional string permission_name = 4;
6192
6193 // If the permission was explicitly requested via the API or added by the system
6194 optional bool is_implicit = 5;
6195
6196 enum Result {
6197 UNDEFINED = 0;
6198 // permission request was ignored
6199 IGNORED = 1;
6200 // permission request was ignored because it was user fixed
6201 IGNORED_USER_FIXED = 2;
6202 // permission request was ignored because it was policy fixed
6203 IGNORED_POLICY_FIXED = 3;
6204 // permission was granted by user action
6205 USER_GRANTED = 4;
6206 // permission was automatically granted
6207 AUTO_GRANTED = 5;
6208 // permission was denied by user action
6209 USER_DENIED = 6;
6210 // permission was denied with prejudice by the user
6211 USER_DENIED_WITH_PREJUDICE = 7;
6212 // permission was automatically denied
6213 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006214 // permission request was ignored because permission is restricted
6215 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006216 // one time permission was granted by user action
6217 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006218 // user ignored request by leaving the request screen without choosing any option
6219 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006220 // user granted the permission after being linked to settings
6221 USER_GRANTED_IN_SETTINGS = 12;
6222 // user denied the permission after being linked to settings
6223 USER_DENIED_IN_SETTINGS = 13;
6224 // user denied the permission with prejudice after being linked to settings
6225 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6226 // permission was automatically revoked after one-time permission expired
6227 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006228 }
6229 // The result of the permission grant
6230 optional Result result = 6;
6231}
6232
6233/**
Jack Yu95b64f32018-12-13 18:26:11 +08006234 * Logs when Omapi API used
6235 * Logged from:
6236 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6237 */
6238message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006239 enum Operation {
6240 UNKNOWN = 0;
6241 OPEN_CHANNEL = 1;
6242 }
6243 optional Operation operation = 1;
6244 // SIMx or eSEx.
6245 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006246
Alex Salod7c3eef2019-01-25 14:43:27 -08006247 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006248}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006249
6250/**
Alex Saloa060aee2019-01-21 14:36:41 -08006251 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6252 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006253 * Logged from:
6254 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6255 */
6256message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006257 optional int64 dispatch_latency_millis = 1;
6258}
6259
6260/**
6261 * Logs AttentionManagerService attention check result.
6262 *
6263 * Logged from:
6264 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6265 */
6266message AttentionManagerServiceResultReported {
6267 // See core/java/android/service/attention/AttentionService.java
6268 enum AttentionCheckResult {
6269 UNKNOWN = 20;
6270 ATTENTION_SUCCESS_ABSENT = 0;
6271 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006272 ATTENTION_FAILURE_UNKNOWN = 2;
6273 ATTENTION_FAILURE_CANCELLED = 3;
6274 ATTENTION_FAILURE_PREEMPTED = 4;
6275 ATTENTION_FAILURE_TIMED_OUT = 5;
6276 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006277 }
6278 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006279}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006280
6281/**
6282 * Logs when an adb connection changes state.
6283 *
6284 * Logged from:
6285 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6286 */
6287message AdbConnectionChanged {
6288 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6289 // previously selected for this system.
6290 optional int64 last_connection_time_millis = 1;
6291
6292 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6293 // to reconnect via adb without user interaction.
6294 optional int64 auth_window_millis = 2;
6295
6296 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6297 optional android.debug.AdbConnectionStateEnum state = 3;
6298
6299 // True if the 'always allow' option was selected for this system.
6300 optional bool always_allow = 4;
6301}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006302
6303/*
6304 * Logs the reported speech DSP status.
6305 *
6306 * Logged from:
6307 * Vendor audio implementation.
6308 */
6309message SpeechDspStatReported {
6310 // The total Speech DSP uptime in milliseconds.
6311 optional int32 total_uptime_millis = 1;
6312 // The total Speech DSP downtime in milliseconds.
6313 optional int32 total_downtime_millis = 2;
6314 optional int32 total_crash_count = 3;
6315 optional int32 total_recover_count = 4;
6316}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006317
6318/**
6319 * Logs USB connector contaminant status.
6320 *
6321 * Logged from: USB Service.
6322 */
6323message UsbContaminantReported {
6324 optional string id = 1;
6325 optional android.service.usb.ContaminantPresenceStatus status = 2;
6326}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006327
6328/**
6329 * This atom is for debugging purpose.
6330 */
6331message DebugElapsedClock {
6332 // Monotically increasing value for each pull.
6333 optional int64 pull_count = 1;
6334 // Time from System.elapsedRealtime.
6335 optional int64 elapsed_clock_millis = 2;
6336 // Time from System.elapsedRealtime.
6337 optional int64 same_elapsed_clock_millis = 3;
6338 // Diff between current elapsed time and elapsed time from previous pull.
6339 optional int64 elapsed_clock_diff_millis = 4;
6340
6341 enum Type {
6342 TYPE_UNKNOWN = 0;
6343 ALWAYS_PRESENT = 1;
6344 PRESENT_ON_ODD_PULLS = 2;
6345 }
6346 // Type of behavior for the pulled data.
6347 optional Type type = 5;
6348}
6349
6350/**
6351 * This atom is for debugging purpose.
6352 */
6353message DebugFailingElapsedClock {
6354 // Monotically increasing value for each pull.
6355 optional int64 pull_count = 1;
6356 // Time from System.elapsedRealtime.
6357 optional int64 elapsed_clock_millis = 2;
6358 // Time from System.elapsedRealtime.
6359 optional int64 same_elapsed_clock_millis = 3;
6360 // Diff between current elapsed time and elapsed time from previous pull.
6361 optional int64 elapsed_clock_diff_millis = 4;
6362}
Steven Wuacef6bb2019-01-23 14:21:17 -05006363
6364/** Logs System UI bubbles event changed.
6365 *
6366 * Logged from:
6367 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6368 */
6369message BubbleUIChanged {
6370
6371 // The app package that is posting the bubble.
6372 optional string package_name = 1;
6373
6374 // The notification channel that is posting the bubble.
6375 optional string notification_channel = 2;
6376
6377 // The notification id associated with the posted bubble.
6378 optional int32 notification_id = 3;
6379
6380 // The position of the bubble within the bubble stack.
6381 optional int32 position = 4;
6382
6383 // The total number of bubbles within the bubble stack.
6384 optional int32 total_number = 5;
6385
6386 // User interactions with the bubble.
6387 enum Action {
6388 UNKNOWN = 0;
6389 POSTED = 1;
6390 UPDATED = 2;
6391 EXPANDED = 3;
6392 COLLAPSED = 4;
6393 DISMISSED = 5;
6394 STACK_DISMISSED = 6;
6395 STACK_MOVED = 7;
6396 HEADER_GO_TO_APP = 8;
6397 HEADER_GO_TO_SETTINGS = 9;
6398 PERMISSION_OPT_IN = 10;
6399 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006400 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006401 SWIPE_LEFT = 13;
6402 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006403 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006404 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006405 }
6406 optional Action action = 6;
6407
6408 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6409 optional float normalized_x_position = 7;
6410 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006411
6412 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6413 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006414
6415 // Whether the bubble is an on-going one.
6416 optional bool is_ongoing = 10;
6417
6418 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006419 // This is deprecated and the value should be ignored.
6420 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006421}
Kweku Adams8845d012018-12-11 20:06:45 -08006422
6423/**
Steven Wu552f63f2019-02-05 13:41:36 -05006424 * Logs System UI bubbles developer errors.
6425 *
6426 * Logged from:
6427 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6428 */
6429message BubbleDeveloperErrorReported {
6430
6431 // The app package that is posting the bubble.
6432 optional string package_name = 1;
6433
6434 // Bubble developer error type enums.
6435 enum Error {
6436 UNKNOWN = 0;
6437 ACTIVITY_INFO_MISSING = 1;
6438 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6439 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6440 }
6441 optional Error error = 2 [default = UNKNOWN];
6442}
6443
6444/**
Kweku Adams8845d012018-12-11 20:06:45 -08006445 * Logs that a constraint for a scheduled job has changed.
6446 *
6447 * Logged from:
6448 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6449 */
6450message ScheduledJobConstraintChanged {
6451 repeated AttributionNode attribution_node = 1;
6452
6453 // Name of the job.
6454 optional string job_name = 2;
6455
6456 optional com.android.server.job.ConstraintEnum constraint = 3;
6457
6458 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006459 UNKNOWN = 0;
6460 UNSATISFIED = 1;
6461 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006462 }
6463 optional State state = 4;
6464}
Alex Salod7c3eef2019-01-25 14:43:27 -08006465
6466/**
6467 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6468 * returns true.
6469 *
6470 * Logged from:
6471 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6472 */
6473message ScreenTimeoutExtensionReported {
6474 // Describes how many times in a row did the power manager reset the screen off timeout.
6475 optional uint32 consecutive_timeout_extended_count = 1;
6476}
Hui Yu885aca12019-01-10 17:11:34 -08006477
6478/*
6479* Logs number of milliseconds it takes to start a process.
6480* The definition of app process start time is from the app launch time to
6481* the time that Zygote finished forking the app process and loaded the
6482* application package's java classes.
6483
6484* This metric is different from AppStartOccurred which is for foreground
6485* activity only.
6486
6487* ProcessStartTime can report all processes (both foreground and background)
6488* start time.
6489*
6490* Logged from:
6491* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6492*/
6493message ProcessStartTime {
6494 // The uid of the ProcessRecord.
6495 optional int32 uid = 1 [(is_uid) = true];
6496
6497 // The process pid.
6498 optional int32 pid = 2;
6499
6500 // The process name.
6501 // Usually package name, "system" for system server.
6502 // Provided by ActivityManagerService.
6503 optional string process_name = 3;
6504
6505 enum StartType {
6506 UNKNOWN = 0;
6507 WARM = 1;
6508 HOT = 2;
6509 COLD = 3;
6510 }
6511
6512 // The start type.
6513 optional StartType type = 4;
6514
6515 // The elapsed realtime at the start of the process.
6516 optional int64 process_start_time_millis = 5;
6517
6518 // Number of milliseconds it takes to reach bind application.
6519 optional int32 bind_application_delay_millis = 6;
6520
6521 // Number of milliseconds it takes to finish start of the process.
6522 optional int32 process_start_delay_millis = 7;
6523
6524 // hostingType field in ProcessRecord, the component type such as "activity",
6525 // "service", "content provider", "broadcast" or other strings.
6526 optional string hosting_type = 8;
6527
6528 // hostingNameStr field in ProcessRecord. The component class name that runs
6529 // in this process.
6530 optional string hosting_name = 9;
6531}
6532
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006533/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006534 * Track Media Codec usage
6535 * Logged from:
6536 * frameworks/av/media/libstagefright/MediaCodec.cpp
6537 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6538 */
6539message MediametricsCodecReported {
6540 optional int64 timestamp_nanos = 1;
6541 optional string package_name = 2;
6542 optional int64 package_version_code = 3;
6543 optional int64 media_apex_version = 4;
6544
6545 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6546}
6547
6548/**
6549 * Track Media Extractor (pulling video/audio streams out of containers) usage
6550 * Logged from:
6551 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6552 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6553 */
6554message MediametricsExtractorReported {
6555 optional int64 timestamp_nanos = 1;
6556 optional string package_name = 2;
6557 optional int64 package_version_code = 3;
6558 optional int64 media_apex_version = 4;
6559
6560 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6561}
6562
6563/**
6564 * Track how we arbitrate between microphone/input requests.
6565 * Logged from
6566 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6567 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6568 */
6569message MediametricsAudiopolicyReported {
6570 optional int64 timestamp_nanos = 1;
6571 optional string package_name = 2;
6572 optional int64 package_version_code = 3;
6573 optional int64 media_apex_version = 4;
6574
6575 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6576}
6577
6578/**
6579 * Track how we arbitrate between microphone requests.
6580 * Logged from
6581 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6582 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6583 */
6584message MediametricsAudiorecordReported {
6585 optional int64 timestamp_nanos = 1;
6586 optional string package_name = 2;
6587 optional int64 package_version_code = 3;
6588 optional int64 media_apex_version = 4;
6589
6590 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6591}
6592
6593/**
6594 * Track how we arbitrate between microphone/input requests.
6595 * Logged from
6596 * frameworks/av/media/libnblog/ReportPerformance.cpp
6597 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6598 */
6599message MediametricsAudiothreadReported {
6600 optional int64 timestamp_nanos = 1;
6601 optional string package_name = 2;
6602 optional int64 package_version_code = 3;
6603 optional int64 media_apex_version = 4;
6604
6605 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6606}
6607
6608/**
6609 * Track how we arbitrate between microphone/input requests.
6610 * Logged from
6611 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6612 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6613 */
6614message MediametricsAudiotrackReported {
6615 optional int64 timestamp_nanos = 1;
6616 optional string package_name = 2;
6617 optional int64 package_version_code = 3;
6618 optional int64 media_apex_version = 4;
6619
6620 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6621}
6622
6623/**
6624 * Track information about DRM framework performance
6625 * Logged from
6626 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6627 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6628 */
6629message MediametricsMediadrmReported {
6630 optional int64 timestamp_nanos = 1;
6631 optional string package_name = 2;
6632 optional int64 package_version_code = 3;
6633 optional int64 media_apex_version = 4;
6634
6635 // vendor+description tell about which DRM plugin is in use on this device
6636 optional string vendor = 5;
6637 optional string description = 6;
6638 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6639 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6640}
6641
6642/**
6643 * Track information about the widevine DRM plugin performance
6644 * Logged from
6645 * vendor/widevine/libwvdrmengine/cdm/metrics
6646 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6647 */
6648message MediametricsDrmWidevineReported {
6649 optional int64 timestamp_nanos = 1;
6650 optional string package_name = 2;
6651 optional int64 package_version_code = 3;
6652 optional int64 media_apex_version = 4;
6653
6654 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6655}
6656
6657/**
6658 * Track information about recordings (e.g. camcorder)
6659 * Logged from
6660 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6661 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6662 */
6663message MediametricsRecorderReported {
6664 optional int64 timestamp_nanos = 1;
6665 optional string package_name = 2;
6666 optional int64 package_version_code = 3;
6667 optional int64 media_apex_version = 4;
6668
6669 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6670}
6671
6672/**
6673 * Track Media Player usage
6674 * Logged from:
6675 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6676 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6677 */
6678message MediametricsNuPlayerReported {
6679 optional int64 timestamp_nanos = 1;
6680 optional string package_name = 2;
6681 optional int64 package_version_code = 3;
6682 optional int64 media_apex_version = 4;
6683
6684 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6685}
6686
6687/**
Robert Shiha4beed32019-08-19 14:15:23 -07006688 * Track Legacy DRM usage
6689 * Logged from
6690 * frameworks/av/drm/drmserver/DrmManager.cpp
6691 */
6692message MediametricsDrmManagerReported {
6693 optional int64 timestamp_nanos = 1;
6694 optional string package_name = 2;
6695 optional int64 package_version_code = 3;
6696 optional int64 media_apex_version = 4;
6697
6698 enum Method {
6699 METHOD_NOT_FOUND = -1;
6700 GET_CONSTRAINTS = 0;
6701 GET_METADATA = 1;
6702 CAN_HANDLE = 2;
6703 PROCESS_DRM_INFO = 3;
6704 ACQUIRE_DRM_INFO = 4;
6705 SAVE_RIGHTS = 5;
6706 GET_ORIGINAL_MIME_TYPE = 6;
6707 GET_DRM_OBJECT_TYPE = 7;
6708 CHECK_RIGHTS_STATUS = 8;
6709 REMOVE_RIGHTS = 9;
6710 REMOVE_ALL_RIGHTS = 10;
6711 OPEN_CONVERT_SESSION = 11;
6712 OPEN_DECRYPT_SESSION = 12;
6713 }
6714
6715 // plugin_id+description inform which Legacy DRM plugins are still in use on device
6716 optional string plugin_id = 5;
6717 optional string description = 6;
6718 optional Method method = 7;
6719 optional string mime_types = 8;
6720}
6721
6722/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006723 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00006724 * Pulled from: StatsCompanionService
6725*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006726message DangerousPermissionState {
6727 // Name of the permission
6728 optional string permission_name = 1;
6729
6730 // Uid of the package
6731 optional int32 uid = 2 [(is_uid) = true];
6732
6733 // Package requesting the permission
6734 optional string package_name = 3;
6735
6736 // If the permission is granted to the uid
6737 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006738
6739 // Permission flags as per android.content.pm.PermissionFlags
6740 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006741}
6742
Michael Groover4a0ca942019-01-24 17:41:25 -08006743/**
6744 * Logs when a package is denied access to a device identifier based on the new access requirements.
6745 *
6746 * Logged from:
6747 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6748 */
6749message DeviceIdentifierAccessDenied {
6750 // The name of the package denied access to the requested device identifier.
6751 optional string package_name = 1;
6752
6753 // The name of the device identifier method the package attempted to invoke.
6754 optional string method_name = 2;
6755
6756 // True if the package is preinstalled.
6757 optional bool is_preinstalled = 3;
6758
6759 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08006760 // Starting from Android 11, this boolean is not set and will always be false.
6761 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08006762}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006763
6764/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006765 * Pulls the ongoing mainline install train version code.
6766 * Pulled from StatsCompanionService
6767 */
6768message TrainInfo {
6769 optional int64 train_version_code = 1;
6770
6771 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006772
6773 optional string train_name = 3;
6774
6775 enum Status {
6776 UNKNOWN = 0;
6777 INSTALL_REQUESTED = 1;
6778 INSTALL_STARTED = 2;
6779 INSTALL_STAGED_NOT_READY = 3;
6780 INSTALL_STAGED_READY = 4;
6781 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006782 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6783 // and INSTALL_FAILURE_COMMIT.
6784 INSTALL_FAILURE = 6 [deprecated = true];
6785 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006786 INSTALL_CANCELLED = 7;
6787 INSTALLER_ROLLBACK_REQUESTED = 8;
6788 INSTALLER_ROLLBACK_INITIATED = 9;
6789 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6790 INSTALLER_ROLLBACK_STAGED = 11;
6791 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6792 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6793 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6794 INSTALLER_ROLLBACK_SUCCESS = 15;
6795 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006796 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6797 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6798 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6799 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6800 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6801 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006802 INSTALL_FAILURE_DOWNLOAD = 23;
6803 INSTALL_FAILURE_STATE_MISMATCH = 24;
6804 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006805 }
6806 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006807}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006808
6809/**
6810 * Logs the gesture stage changed event.
6811 *
6812 * Logged from:
6813 * frameworks/base/packages/SystemUI/
6814 */
6815message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006816 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006817}
6818
6819/**
6820 * Logs the feedback type.
6821 *
6822 * Logged from:
6823 * frameworks/base/packages/SystemUI/
6824 */
6825message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006826 // Whether or not the gesture was used.
6827 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006828}
6829
6830/**
6831 * Logs the progress.
6832 *
6833 * Logged from:
6834 * frameworks/base/packages/SystemUI/
6835 */
6836message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006837 // [0,100] progress for the assist gesture.
6838 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006839}
Neil Fullerdb14b482019-02-05 19:44:44 +00006840
6841/*
6842 * Information about the time zone data on a device.
6843 */
6844message TimeZoneDataInfo {
6845 // A version identifier for the data set on device. e.g. "2018i"
6846 optional string tzdb_version = 1;
6847}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006848
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006849/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006850 * Logs the GPU stats global health information.
6851 *
6852 * Logged from:
6853 * frameworks/native/services/gpuservice/gpustats/
6854 */
6855message GpuStatsGlobalInfo {
6856 // Package name of the gpu driver.
6857 optional string driver_package_name = 1;
6858
6859 // Version name of the gpu driver.
6860 optional string driver_version_name = 2;
6861
6862 // Version code of the gpu driver.
6863 optional int64 driver_version_code = 3;
6864
6865 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6866 optional int64 driver_build_time = 4;
6867
6868 // Total count of the gl driver gets loaded.
6869 optional int64 gl_loading_count = 5;
6870
6871 // Total count of the gl driver fails to be loaded.
6872 optional int64 gl_loading_failure_count = 6;
6873
6874 // Total count of the Vulkan driver gets loaded.
6875 optional int64 vk_loading_count = 7;
6876
6877 // Total count of the Vulkan driver fails to be loaded.
6878 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006879
6880 // Api version of the system Vulkan driver.
6881 optional int32 vulkan_version = 9;
6882
6883 // Api version of the system CPU Vulkan driver.
6884 optional int32 cpu_vulkan_version = 10;
6885
6886 // Api version of the system GLES driver.
6887 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006888
6889 // Total count of the angle driver gets loaded.
6890 optional int64 angle_loading_count = 12;
6891
6892 // Total count of the angle driver fails to be loaded.
6893 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006894}
6895
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006896/**
6897 * GPU driver loading time info.
6898 */
6899message GpuDriverLoadingTime {
6900 // List of all the driver loading times for this app. The list size is
6901 // capped at 50.
6902 repeated int64 driver_loading_time = 1;
6903}
6904
6905/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006906 * Logs the GPU stats per app health information.
6907 *
6908 * Logged from:
6909 * frameworks/native/services/gpuservice/gpustats/
6910 */
6911message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006912 // Package name of the application that loads the gpu driver. Total number
6913 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006914 optional string app_package_name = 1;
6915
6916 // Version code of the gpu driver this app loads.
6917 optional int64 driver_version_code = 2;
6918
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006919 // gl driver loading time info.
6920 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6921 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006922
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006923 // Vulkan driver loading time info.
6924 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6925 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006926
6927 // Angle driver loading time info.
6928 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6929 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006930
6931 // CPU Vulkan implementation is in use.
6932 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07006933
6934 // App is not doing pre-rotation correctly.
6935 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08006936
6937 // App creates GLESv1 context.
6938 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006939}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006940
6941/*
6942 * Logs the size of the system ion heap.
6943 *
6944 * Pulled from StatsCompanionService.
6945 */
6946message SystemIonHeapSize {
6947 // Size of the system ion heap in bytes.
6948 optional int64 size_in_bytes = 1;
6949}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006950
Rafal Slawik77987ed2019-06-17 12:28:23 +01006951/*
6952 * Logs the per-process size of the system ion heap.
6953 *
6954 * Pulled from StatsCompanionService.
6955 */
6956message ProcessSystemIonHeapSize {
6957 // The uid if available. -1 means not available.
6958 optional int32 uid = 1 [(is_uid) = true];
6959
6960 // The process name (from /proc/PID/cmdline).
6961 optional string process_name = 2;
6962
6963 // Sum of sizes of all allocations.
6964 optional int32 total_size_in_kilobytes = 3;
6965
6966 // Number of allocations.
6967 optional int32 allocation_count = 4;
6968
6969 // Size of the largest allocation.
6970 optional int32 max_size_in_kilobytes = 5;
6971}
6972
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006973/**
6974 * Push network stack events.
6975 *
6976 * Log from:
6977 * frameworks/base/packages/NetworkStack/
6978 */
6979message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006980 // The id that indicates the event reported from NetworkStack.
6981 optional int32 event_id = 1;
6982 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006983 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6984}
Carmen Agimofa769c152019-03-04 14:39:14 +00006985
6986/**
6987 * Logs the apps that are installed on the external storage.
6988 * Pulled from:
6989 * StatsCompanionService
6990 */
6991message AppsOnExternalStorageInfo {
6992 // The type of the external storage.
6993 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6994 // The name of the package that is installed on the external storage.
6995 optional string package_name = 2;
6996}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006997
6998/**
6999 * Logs the settings related to Face.
7000 * Logged from:
7001 * frameworks/base/services/core/java/com/android/server/stats
7002 */
7003message FaceSettings {
7004 // Whether or not face unlock is allowed on Keyguard.
7005 optional bool unlock_keyguard_enabled = 1;
7006 // Whether or not face unlock dismisses the Keyguard.
7007 optional bool unlock_dismisses_keyguard = 2;
7008 // Whether or not face unlock requires attention.
7009 optional bool unlock_attention_required = 3;
7010 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7011 optional bool unlock_app_enabled = 4;
7012 // Whether or not face unlock always requires user confirmation.
7013 optional bool unlock_always_require_confirmation = 5;
7014 // Whether or not a diverse set of poses are required during enrollment.
7015 optional bool unlock_diversity_required = 6;
7016}
Maggie White442b6312019-04-05 16:26:44 -07007017
7018/**
7019 * Logs cooling devices maintained by the kernel.
7020 *
7021 * Pulled from StatsCompanionService.java
7022 */
7023message CoolingDevice {
7024 // The type of cooling device being reported. Eg. CPU, GPU...
7025 optional android.os.CoolingTypeEnum device_location = 1;
7026 // The name of the cooling device source. Eg. CPU0
7027 optional string device_name = 2;
7028 // Current throttle state of the cooling device. The value can any unsigned
7029 // integer between 0 and max_state defined in its driver. 0 means device is
7030 // not in throttling, higher value means deeper throttling.
7031 optional int32 state = 3;
7032}
Ben Blount763a5d52019-04-10 11:48:58 -07007033
7034/**
7035 * Intelligence has several counter-type events that don't warrant a
7036 * full separate atom. These are primarily API call counters but also include
7037 * counters for feature usage and specific failure modes.
7038 *
7039 * Logged from the Intelligence mainline module.
7040 */
7041message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007042 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007043 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007044 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007045 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007046 // How many times the event occured (to report a batch of high frequency events).
7047 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007048 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007049 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007050}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007051
7052/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007053 * Logs when Car Power state changed.
7054 *
7055 * Logged from:
7056 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7057 */
7058message CarPowerStateChanged {
7059 // States come from CpmsState in CarPowerManagementService.java.
7060 enum State {
7061 WAIT_FOR_VHAL = 0;
7062 ON = 1;
7063 SHUTDOWN_PREPARE = 2;
7064 WAIT_FOR_FINISH = 3;
7065 SUSPEND = 4;
7066 SIMULATE_SLEEP = 5;
7067 }
7068 optional State state = 1;
7069}
7070
7071/**
7072 * Logs whether GarageMode is entered.
7073 *
7074 * Logged from:
7075 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7076 */
7077message GarageModeInfo {
7078 // Whether GarageMode is entered.
7079 optional bool is_garage_mode = 1;
7080}
Martijn Coenencd95d462019-04-25 17:09:45 +02007081
7082/**
7083 * Historical app ops data per package.
7084 */
7085message AppOps {
7086 // Uid of the package requesting the op
7087 optional int32 uid = 1 [(is_uid) = true];
7088
7089 // Nmae of the package performing the op
7090 optional string package_name = 2;
7091
7092 // operation id; maps to the OP_* constants in AppOpsManager.java
7093 optional int32 op_id = 3;
7094
7095 // The number of times the op was granted while the app was in the
7096 // foreground (only for trusted requests)
7097 optional int64 trusted_foreground_granted_count = 4;
7098
7099 // The number of times the op was granted while the app was in the
7100 // background (only for trusted requests)
7101 optional int64 trusted_background_granted_count = 5;
7102
7103 // The number of times the op was rejected while the app was in the
7104 // foreground (only for trusted requests)
7105 optional int64 trusted_foreground_rejected_count = 6;
7106
7107 // The number of times the op was rejected while the app was in the
7108 // background (only for trusted requests)
7109 optional int64 trusted_background_rejected_count = 7;
7110
7111 // For long-running operations, total duration of the operation
7112 // while the app was in the foreground (only for trusted requests)
7113 optional int64 trusted_foreground_duration_millis = 8;
7114
7115 // For long-running operations, total duration of the operation
7116 // while the app was in the background (only for trusted requests)
7117 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007118
7119 // Whether AppOps is guarded by Runtime permission
7120 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007121}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007122
7123/**
7124 * Location Manager API Usage information(e.g. API under usage,
7125 * API call's parameters).
7126 * Logged from:
7127 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7128 */
7129message LocationManagerApiUsageReported {
7130
7131 // Indicating if usage starts or usage ends.
7132 optional android.stats.location.UsageState state = 1;
7133
7134 // LocationManagerService's API in use.
7135 // We can identify which API from LocationManager is
7136 // invoking current LMS API by the combination of
7137 // API parameter(e.g. is_listener_null, is_intent_null,
7138 // is_location_request_null)
7139 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7140
7141 // Name of the package calling the API.
7142 optional string calling_package_name = 3;
7143
7144 // Type of the location provider.
7145 optional android.stats.location.ProviderType provider = 4;
7146
7147 // Quality of the location request
7148 optional android.stats.location.LocationRequestQuality quality = 5;
7149
7150 // The desired interval for active location updates, in milliseconds.
7151 // Bucketized to reduce cardinality.
7152 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7153
7154 // Minimum distance between location updates, in meters.
7155 // Bucketized to reduce cardinality.
7156 optional android.stats.location.SmallestDisplacementBucket
7157 bucketized_smallest_displacement = 7;
7158
7159 // The number of location updates.
7160 optional int64 num_updates = 8;
7161
7162 // The request expiration time, in millisecond since boot.
7163 // Bucketized to reduce cardinality.
7164 optional android.stats.location.ExpirationBucket
7165 bucketized_expire_in = 9;
7166
7167 // Type of Callback passed in for this API.
7168 optional android.stats.location.CallbackType callback_type = 10;
7169
7170 // The radius of the central point of the alert
7171 // region, in meters. Only for API REQUEST_GEOFENCE.
7172 // Bucketized to reduce cardinality.
7173 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7174
7175 // Activity Importance of API caller.
7176 // Categorized to 3 types that are interesting from location's perspective.
7177 optional android.stats.location.ActivityImportance activiy_importance = 12;
7178}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007179
7180/**
7181 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7182 */
7183message ReviewPermissionsFragmentResultReported {
7184 // unique value identifying a permission group change. A permission group change might result
7185 // in multiple of these atoms
7186 optional int64 change_id = 1;
7187
7188 // UID of package the permission belongs to
7189 optional int32 uid = 2 [(is_uid) = true];
7190
7191 // Name of package the permission belongs to
7192 optional string package_name = 3;
7193
7194 // The permission to be granted
7195 optional string permission_name = 4;
7196
7197 // The result of the permission grant
7198 optional bool permission_granted = 5;
7199}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007200
7201/**
7202* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7203* Logged from: RuntimePermissionUpdgradeController
7204*/
7205message RuntimePermissionsUpgradeResult {
7206 // Permission granted as result of upgrade
7207 optional string permission_name = 1;
7208
7209 // UID of package granted permission
7210 optional int32 uid = 2 [(is_uid) = true];
7211
7212 // Name of package granted permission
7213 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007214}
7215
7216/**
7217* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7218*/
7219message GrantPermissionsActivityButtonActions {
7220 // Permission granted as result of upgrade
7221 optional string permission_group_name = 1;
7222
7223 // UID of package granted permission
7224 optional int32 uid = 2 [(is_uid) = true];
7225
7226 // Name of package requesting permission
7227 optional string package_name = 3;
7228
7229 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7230 // LABEL_ constants in GrantPermissionActivity.java
7231 optional int32 buttons_presented = 4;
7232
7233 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7234 optional int32 button_clicked = 5;
7235}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007236
7237/**
7238 * Information about LocationAccessCheck notification presented to user
7239 */
7240message LocationAccessCheckNotificationAction {
7241
7242 // id which identifies single session of user interacting with permission controller
7243 optional int64 session_id = 1;
7244
7245 // Uid of package for which location access check is presented
7246 optional int32 package_uid = 2;
7247
7248 // Name of package for which location access check is presented
7249 optional string package_name = 3;
7250
7251 enum Result {
7252 UNDEFINED = 0;
7253 // notification was presented to the user
7254 NOTIFICATION_PRESENTED = 1;
7255 // notification was declined by the user
7256 NOTIFICATION_DECLINED = 2;
7257 // notification was clicked by the user
7258 NOTIFICATION_CLICKED = 3;
7259 }
7260
7261 // View / interaction recorded
7262 optional Result result = 4;
7263}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007264
7265/**
7266 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7267 */
7268message AppPermissionFragmentActionReported {
7269 // id which identifies single session of user interacting with permission controller
7270 optional int64 session_id = 1;
7271
7272 // unique value identifying a permission group change. A permission group change might result
7273 // in multiple of these atoms
7274 optional int64 change_id = 2;
7275
7276 // UID of package the permission belongs to
7277 optional int32 uid = 3 [(is_uid) = true];
7278
7279 // Name of package the permission belongs to
7280 optional string package_name = 4;
7281
7282 // The permission to be granted
7283 optional string permission_name = 5;
7284
7285 // The result of the permission grant
7286 optional bool permission_granted = 6;
7287}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007288
7289/**
7290* Information about a AppPermissionFragment viewed by user
7291*/
7292message AppPermissionFragmentViewed {
7293 // id which identifies single session of user interacting with permission controller
7294 optional int64 session_id = 1;
7295
7296 // UID of package for which permissions are viewed
7297 optional int32 uid = 2 [(is_uid) = true];
7298
7299 // Name of package for which permissions are viewed
7300 optional string package_name = 3;
7301
7302 // Permission group viewed
7303 optional string permission_group_name = 4;
7304}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007305
7306/**
7307* Information about a AppPermissionsFragment viewed by user
7308*/
7309message AppPermissionsFragmentViewed {
7310 // id which identifies single session of user interacting with permission controller
7311 optional int64 session_id = 1;
7312
7313 // id which identifies single view as every view might have several logging records
7314 // with different package information attached
7315 optional int64 view_id = 2;
7316
7317 // Permission group viewed
7318 optional string permission_group_name = 3;
7319
7320 // UID of package for which permissions are viewed
7321 optional int32 uid = 4 [(is_uid) = true];
7322
7323 // Name of package for which permissions are viewed
7324 optional string package_name = 5;
7325
7326 // Category in which permission is included
7327 enum Category {
7328 UNDEFINED = 0;
7329 ALLOWED = 1;
7330 ALLOWED_FOREGROUND = 2;
7331 DENIED = 3;
7332 }
7333 optional Category category = 6;
7334}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007335
7336/**
7337* Information about a PermissionAppsFragment viewed by user.
7338* Logged from ui/handheld/PermissionAppsFragment.java
7339*/
7340message PermissionAppsFragmentViewed {
7341 // id which identifies single session of user interacting with permission controller
7342 optional int64 session_id = 1;
7343
7344 // id which identifies single view as every view might have several logging records
7345 // with different package information attached
7346 optional int64 view_id = 2;
7347
7348 // Permission group viewed
7349 optional string permission_group_name = 3;
7350
7351 // UID of package for which permissions are viewed
7352 optional int32 uid = 4 [(is_uid) = true];
7353
7354 // Name of package for which permissions are viewed
7355 optional string package_name = 5;
7356
7357 // Category in which app is included
7358 enum Category {
7359 UNDEFINED = 0;
7360 ALLOWED = 1;
7361 ALLOWED_FOREGROUND = 2;
7362 DENIED = 3;
7363 }
7364 optional Category category = 6;
7365}
Tony Make2b1b672019-07-29 16:59:47 +01007366
7367/**
7368 * Logs when there is a smart selection related event.
7369 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7370 * Logged from: TextClassifierEventLogger.java
7371 */
7372message TextSelectionEvent {
7373 // A session ID.
7374 optional string session_id = 1;
7375
7376 // Event type of this event.
7377 optional android.stats.textclassifier.EventType event_type = 2;
7378
Tony Mak9c84bd22019-12-09 07:27:25 +00007379 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007380 optional string model_name = 3;
7381
7382 // Type of widget that was involved in triggering this event.
7383 optional android.stats.textclassifier.WidgetType widget_type = 4;
7384
7385 // Index of this event in a session.
7386 optional int32 event_index = 5;
7387
7388 // Entity type that is involved.
7389 optional string entity_type = 6;
7390
7391 // Relative word index of the start of the selection.
7392 optional int32 relative_word_start_index = 7;
7393
7394 // Relative word (exclusive) index of the end of the selection.
7395 optional int32 relative_word_end_index = 8;
7396
7397 // Relative word index of the start of the smart selection.
7398 optional int32 relative_suggested_word_start_index = 9;
7399
7400 // Relative word (exclusive) index of the end of the smart selection.
7401 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007402
7403 // Name of source package.
7404 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007405}
7406
7407/**
7408 * Logs when there is a smart linkify related event.
7409 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7410 * Logged from: TextClassifierEventLogger.java
7411 */
7412message TextLinkifyEvent {
7413 // A session ID.
7414 optional string session_id = 1;
7415
7416 // Event type of this event.
7417 optional android.stats.textclassifier.EventType event_type = 2;
7418
Tony Mak9c84bd22019-12-09 07:27:25 +00007419 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007420 optional string model_name = 3;
7421
7422 // Type of widget that was involved in triggering this event.
7423 optional android.stats.textclassifier.WidgetType widget_type = 4;
7424
7425 // Index of this event in a session.
7426 optional int32 event_index = 5;
7427
7428 // Entity type that is involved.
7429 optional string entity_type = 6;
7430
7431 // Number of links detected.
7432 optional int32 num_links = 7;
7433
7434 // The total length of all links.
7435 optional int32 linked_text_length = 8;
7436
7437 // Length of input text.
7438 optional int32 text_length = 9;
7439
7440 // Time spent on generating links in ms.
7441 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007442
7443 // Name of source package.
7444 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007445}
7446
7447/**
7448 * Logs when there is a conversation actions related event.
7449 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7450 * Logged from: TextClassifierEventLogger.java
7451 */
7452message ConversationActionsEvent {
7453 // A session ID.
7454 optional string session_id = 1;
7455
7456 // Event type of this event.
7457 optional android.stats.textclassifier.EventType event_type = 2;
7458
Tony Mak9c84bd22019-12-09 07:27:25 +00007459 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007460 optional string model_name = 3;
7461
7462 // Type of widget that was involved in triggering this event.
7463 optional android.stats.textclassifier.WidgetType widget_type = 4;
7464
7465 // The first entity type that is involved.
7466 optional string first_entity_type = 5;
7467
7468 // The second entity type that is involved.
7469 optional string second_entity_type = 6;
7470
7471 // The third entity type that is involved.
7472 optional string third_entity_type = 7;
7473
7474 // The score of the first entity type.
7475 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007476
7477 // Name of source package.
7478 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00007479
7480 // Name of the annotator model that is involved in this event.
7481 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01007482}
7483
7484/**
7485 * Logs when there is a language detection related event.
7486 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7487 * Logged from: TextClassifierEventLogger.java
7488 */
7489message LanguageDetectionEvent {
7490 // A session ID.
7491 optional string session_id = 1;
7492
7493 // Event type of this event.
7494 optional android.stats.textclassifier.EventType event_type = 2;
7495
Tony Mak9c84bd22019-12-09 07:27:25 +00007496 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007497 optional string model_name = 3;
7498
7499 // Type of widget that was involved in triggering this event.
7500 optional android.stats.textclassifier.WidgetType widget_type = 4;
7501
7502 // Detected language.
7503 optional string language_tag = 5;
7504
7505 // Score of the detected language.
7506 optional float score = 6;
7507
7508 // Position of this action.
7509 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007510
7511 // Name of source package.
7512 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007513}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007514
7515/**
7516 * Information about an OTA update attempt by update_engine.
7517 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7518 */
7519message UpdateEngineUpdateAttemptReported {
7520 // The number of attempts for the update engine to apply a given payload.
7521 optional int32 attempt_number = 1;
7522
7523 optional android.stats.otaupdate.PayloadType payload_type = 2;
7524
7525 // The total time in minutes for the update engine to apply a given payload.
7526 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7527 // it's increased when the system is sleeping.
7528 optional int32 duration_boottime_in_minutes = 3;
7529
7530 // The total time in minutes for the update engine to apply a given payload.
7531 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7532 // and it's not increased when the system is sleeping.
7533 optional int32 duration_monotonic_in_minutes = 4;
7534
7535 // The size of the payload in MiBs.
7536 optional int32 payload_size_mib = 5;
7537
7538 // The attempt result reported by the update engine for an OTA update.
7539 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7540
7541 // The error code reported by the update engine after an OTA update attempt
7542 // on A/B devices.
7543 optional android.stats.otaupdate.ErrorCode error_code = 7;
7544
7545 // The build fingerprint of the source system. The value is read from a
7546 // system property when the device takes the update. e.g.
7547 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7548 optional string source_fingerprint = 8;
7549}
7550
7551/**
7552 * Information about all the attempts the device make before finishing the
7553 * successful update.
7554 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7555 */
7556message UpdateEngineSuccessfulUpdateReported {
7557 // The number of attempts for the update engine to apply the payload for a
7558 // successful update.
7559 optional int32 attempt_count = 1;
7560
7561 optional android.stats.otaupdate.PayloadType payload_type = 2;
7562
7563 optional int32 payload_size_mib = 3;
7564
7565 // The total number of bytes downloaded by update_engine since the last
7566 // successful update.
7567 optional int32 total_bytes_downloaded_mib = 4;
7568
7569 // The ratio in percentage of the over-downloaded bytes compared to the
7570 // total bytes needed to successfully install the update. e.g. 200 if we
7571 // download 200MiB in total for a 100MiB package.
7572 optional int32 download_overhead_percentage = 5;
7573
7574 // The total time in minutes for the update engine to apply the payload for a
7575 // successful update.
7576 optional int32 total_duration_minutes = 6;
7577
7578 // The number of reboot of the device during a successful update.
7579 optional int32 reboot_count = 7;
7580}
Alec Mourie088e762019-07-02 13:10:55 -07007581
7582/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08007583 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
7584 * key to indicate whether it was successful or not.
7585 *
7586 * Logged from:
7587 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
7588 */
7589message RebootEscrowRecoveryReported {
7590 optional bool successful = 1;
7591}
7592
7593/**
Alec Mourie088e762019-07-02 13:10:55 -07007594 * Global display pipeline metrics reported by SurfaceFlinger.
7595 * Pulled from:
7596 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7597 */
7598message SurfaceflingerStatsGlobalInfo {
7599 // Total number of frames presented during the tracing period
7600 optional int64 total_frames = 1;
7601 // Total number of frames missed
7602 optional int64 missed_frames = 2;
7603 // Total number of frames that fell back to client composition
7604 optional int64 client_composition_frames = 3;
7605 // Total time the display was turned on
7606 optional int64 display_on_millis = 4;
7607 // Total time that was spent performing animations.
7608 // This is derived from the present-to-present layer histogram
7609 optional int64 animation_millis = 5;
7610}
7611
7612/**
7613 * Per-layer display pipeline metrics reported by SurfaceFlinger.
7614 * The number of layers uploaded will be restricted due to size limitations.
7615 * Pulled from:
7616 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7617 */
7618message SurfaceflingerStatsLayerInfo {
7619 // The layer for this set of metrics
7620 // For now we can infer that the package name is included in the layer
7621 // name.
7622 optional string layer_name = 1;
7623 // Total number of frames presented
7624 optional int64 total_frames = 2;
7625 // Total number of dropped frames while latching a buffer for this layer.
7626 optional int64 dropped_frames = 3;
7627 // Set of timings measured between successive presentation timestamps.
7628 optional FrameTimingHistogram present_to_present = 4
7629 [(android.os.statsd.log_mode) = MODE_BYTES];
7630 // Set of timings measured from when an app queued a buffer for
7631 // presentation, until the buffer was actually presented to the
7632 // display.
7633 optional FrameTimingHistogram post_to_present = 5
7634 [(android.os.statsd.log_mode) = MODE_BYTES];
7635 // Set of timings measured from when a buffer is ready to be presented,
7636 // until the buffer was actually presented to the display.
7637 optional FrameTimingHistogram acquire_to_present = 6
7638 [(android.os.statsd.log_mode) = MODE_BYTES];
7639 // Set of timings measured from when a buffer was latched by
7640 // SurfaceFlinger, until the buffer was presented to the display
7641 optional FrameTimingHistogram latch_to_present = 7
7642 [(android.os.statsd.log_mode) = MODE_BYTES];
7643 // Set of timings measured from the desired presentation to the actual
7644 // presentation time
7645 optional FrameTimingHistogram desired_to_present = 8
7646 [(android.os.statsd.log_mode) = MODE_BYTES];
7647 // Set of timings measured from when an app queued a buffer for
7648 // presentation, until the buffer was ready to be presented.
7649 optional FrameTimingHistogram post_to_acquire = 9
7650 [(android.os.statsd.log_mode) = MODE_BYTES];
7651}
7652
7653/**
7654 * Histogram of frame counts bucketed by time in milliseconds.
7655 * Because of size limitations, we hard-cap the number of buckets, with
7656 * buckets for corresponding to larger milliseconds being less precise.
7657 */
7658message FrameTimingHistogram {
7659 // Timings in milliseconds that describes a set of histogram buckets
7660 repeated int32 time_millis_buckets = 1;
7661 // Number of frames that match to each time_millis, i.e. the bucket
7662 // contents
7663 // It's required that len(time_millis) == len(frame_count)
7664 repeated int64 frame_counts = 2;
7665}
Emilian Peev6729f372019-08-29 09:14:09 -07007666
Emilian Peev6729f372019-08-29 09:14:09 -07007667/**
7668 * Information about camera facing and API level usage.
7669 * Logged from:
7670 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
7671 */
7672message CameraActionEvent {
7673 // Camera session duration
7674 optional int64 duration = 1;
7675
7676 // Camera API level used
7677 optional int32 api_level = 2;
7678
7679 // Name of client package
7680 optional string package_name = 3;
7681
7682 // Camera facing
7683 enum Facing {
7684 UNKNOWN = 0;
7685 BACK = 1;
7686 FRONT = 2;
7687 EXTERNAL = 3;
7688 }
7689 optional Facing facing = 4;
7690}
atrost01a20932019-08-28 15:40:37 +01007691
7692/**
7693 * Logs when a compatibility change is affecting an app.
7694 *
7695 * Logged from:
7696 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
7697 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
7698 */
7699message AppCompatibilityChangeReported {
7700 // The UID of the app being affected by the compatibilty change.
7701 optional int32 uid = 1 [(is_uid) = true];
7702
7703 // The ID of the change affecting the app.
7704 optional int64 change_id = 2;
7705
7706 enum State {
7707 UNKNOWN_STATE = 0;
7708 ENABLED = 1;
7709 DISABLED = 2;
7710 LOGGED = 3;
7711 }
7712
7713 // The state of the change - if logged from gating whether it was enabled or disabled, or just
7714 // logged otherwise.
7715 optional State state = 3;
7716
7717 enum Source {
7718 UNKNOWN_SOURCE = 0;
7719 APP_PROCESS = 1;
7720 SYSTEM_SERVER = 2;
7721 }
7722
7723 // Where it was logged from.
7724 optional Source source = 4;
7725
7726}
Hector Dearman40579f62019-11-01 13:19:30 +00007727
7728/**
7729 * Logged from
7730 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
7731 */
7732message PerfettoUploaded {
7733 enum Event {
7734 PERFETTO_UNDEFINED = 0;
7735 PERFETTO_TRACE_BEGIN = 1;
7736 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
7737 PERFETTO_ON_CONNECT = 3;
7738 PERFETTO_ON_TRACING_DISABLED = 4;
7739 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
7740 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
7741 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
7742 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
7743 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
7744 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
7745 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
7746 PERFETTO_TRIGGER_BEGIN = 12;
7747 PERFETTO_TRIGGER_SUCCESS = 13;
7748 PERFETTO_TRIGGER_FAILURE = 14;
7749 PERFETTO_HIT_GUARDRAILS = 15;
7750 PERFETTO_ON_TIMEOUT = 16;
7751 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
7752 }
7753
7754 // Which stage of the pipeline we are reporting from.
7755 optional Event event = 1;
7756
7757 // UUID matching the one set inside the SystemInfo trace packet.
7758 optional int64 trace_uuid_lsb = 2;
7759 optional int64 trace_uuid_msb = 3;
7760}
Mark Tabrya824a642019-11-05 12:26:12 -08007761
7762/**
7763 * Pulls client metrics on data transferred via Vehicle Maps Service.
7764 * Metrics are keyed by uid + layer.
7765 *
7766 * Pulled from:
7767 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
7768 */
7769message VmsClientStats {
7770 // UID of the VMS client app
7771 optional int32 uid = 1 [(is_uid) = true];
7772
7773 // VMS layer definition
7774 optional int32 layer_type = 2;
7775 optional int32 layer_channel = 3;
7776 optional int32 layer_version = 4;
7777
7778 // Bytes and packets sent by the client for the layer
7779 optional int64 tx_bytes = 5;
7780 optional int64 tx_packets = 6;
7781
7782 // Bytes and packets received by the client for the layer
7783 optional int64 rx_bytes = 7;
7784 optional int64 rx_packets = 8;
7785
7786 // Bytes and packets dropped due to client error
7787 optional int64 dropped_bytes = 9;
7788 optional int64 dropped_packets = 10;
7789}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007790
7791/**
7792 * State of a dangerous permission requested by a package - sampled
7793 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
7794*/
7795message DangerousPermissionStateSampled {
7796 // Name of the permission
7797 optional string permission_name = 1;
7798
7799 // Uid of the package
7800 optional int32 uid = 2 [(is_uid) = true];
7801
7802 // If the permission is granted to the uid
7803 optional bool is_granted = 3;
7804
7805 // Permission flags as per android.content.pm.PermissionFlags
7806 optional int32 permission_flags = 4;
7807}
7808
Stan Iliev637ba5e2019-08-16 13:43:08 -04007809/**
7810 * HWUI renders pipeline type: GL (0) or Vulkan (1).
7811 */
7812enum PipelineType {
7813 GL = 0;
7814 VULKAN = 1;
7815}
7816
7817/**
7818 * HWUI stats for a given app.
7819 */
7820message GraphicsStats {
7821 // The package name of the app
7822 optional string package_name = 1;
7823
7824 // The version code of the app
7825 optional int64 version_code = 2;
7826
7827 // The start & end timestamps in UTC as
7828 // milliseconds since January 1, 1970
7829 // Compatible with java.util.Date#setTime()
7830 optional int64 stats_start = 3;
7831
7832 optional int64 stats_end = 4;
7833
7834 // HWUI renders pipeline type: GL or Vulkan.
7835 optional PipelineType pipeline = 5;
7836
7837 // Distinct frame count.
7838 optional int32 total_frames = 6;
7839
7840 // Number of "missed vsync" events.
7841 optional int32 missed_vsync_count = 7;
7842
7843 // Number of frames in triple-buffering scenario (high input latency)
7844 optional int32 high_input_latency_count = 8;
7845
7846 // Number of "slow UI thread" events.
7847 optional int32 slow_ui_thread_count = 9;
7848
7849 // Number of "slow bitmap upload" events.
7850 optional int32 slow_bitmap_upload_count = 10;
7851
7852 // Number of "slow draw" events.
7853 optional int32 slow_draw_count = 11;
7854
7855 // Number of frames that missed their deadline (aka, visibly janked)
7856 optional int32 missed_deadline_count = 12;
7857
7858 // The frame time histogram for the package
7859 optional FrameTimingHistogram cpu_histogram = 13
7860 [(android.os.statsd.log_mode) = MODE_BYTES];
7861
7862 // The gpu frame time histogram for the package
7863 optional FrameTimingHistogram gpu_histogram = 14
7864 [(android.os.statsd.log_mode) = MODE_BYTES];
7865
7866 // UI mainline module version.
7867 optional int64 version_ui_module = 15;
7868
7869 // If true, these are HWUI stats for up to a 24h period for a given app from today.
7870 // If false, these are HWUI stats for a 24h period for a given app from the last complete
7871 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
7872 // more apps are running / rendering.
7873 optional bool is_today = 16;
7874}