blob: 4e57c9cdf8064f10cfd67644fcd594c7bf948f0c [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.
Stanislav Zholnin606454c2019-11-27 15:31:49 +0000344 // Next: 10070
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;
Stanislav Zholnin606454c2019-11-27 15:31:49 +0000414 RuntimeAppOpsAccess runtime_app_ops_access = 10069;
David Chenc8a43242017-10-17 16:23:28 -0700415 }
yroa1fe77c2018-02-26 14:22:54 -0800416
Bookatz76aafcf2018-09-17 16:17:10 -0700417 // DO NOT USE field numbers above 100,000 in AOSP.
418 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
419 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100420
421 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700422}
423
Yao Chend54f9dd2017-10-17 17:37:48 +0000424/**
Yangster-mac20877162017-12-22 17:19:39 -0800425 * This proto represents a node of an attribution chain.
426 * Note: All attribution chains are represented as a repeated field of type
427 * AttributionNode. It is understood that in such arrays, the order is that
428 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000429 */
Yangster-mac20877162017-12-22 17:19:39 -0800430message AttributionNode {
431 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800432 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800433
Yangster-mac20877162017-12-22 17:19:39 -0800434 // The (optional) string tag for an element in the attribution chain. If the
435 // element has no tag, it is encoded as an empty string.
436 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700437}
438
Yangster-mac48b3d622018-08-18 12:38:11 -0700439message KeyValuePair {
440 optional int32 key = 1;
441 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700442 int32 value_int = 2;
443 int64 value_long = 3;
444 string value_str = 4;
445 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700446 }
447}
448
449message KeyValuePairsAtom {
450 optional int32 uid = 1;
451 repeated KeyValuePair pairs = 2;
452}
453
Yao Chend54f9dd2017-10-17 17:37:48 +0000454/*
455 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800456 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000457 *
458 * RULES:
459 * - The field ids for each atom must start at 1, and count upwards by 1.
460 * Skipping field ids is not allowed.
461 * - These form an API, so renaming, renumbering or removing fields is
462 * not allowed between android releases. (This is not currently enforced,
463 * but there will be a tool to enforce this restriction).
464 * - The types must be built-in protocol buffer types, namely, no sub-messages
465 * are allowed (yet). The bytes type is also not allowed.
466 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800467 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000468 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800469 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000470 * - A field that is a uid should be a string field, tagged with the [xxx]
471 * annotation. The generated code on android will be represented by UIDs,
472 * and those UIDs will be translated in xxx to those strings.
473 *
474 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700475 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000476 * - If there is a UID, it goes first. Think in an object-oriented fashion.
477 * *****************************************************************************
478 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700479
Yao Chend54f9dd2017-10-17 17:37:48 +0000480/**
Tej Singha72344992019-04-17 18:55:08 -0700481 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700482 * Logs when the Thermal service HAL notifies the throttling start/stop events.
483 *
484 * Logged from:
485 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
486 */
487message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700488 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700489 optional android.os.TemperatureTypeEnum sensor_type = 1;
490
Maggie White442b6312019-04-05 16:26:44 -0700491 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700492 enum State {
493 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700494 START = 1; // START indicated that throttling was triggered.
495 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700496 }
Yangster-mace16189a2018-08-26 12:20:16 -0700497 optional State state = 2;
498
499 optional float temperature = 3;
500}
501
502/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000503 * Logs when the screen state changes.
504 *
505 * Logged from:
506 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
507 */
508message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800509 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700510 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700511}
Yao Chend54f9dd2017-10-17 17:37:48 +0000512
513/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700514 * Logs that the process state of the uid, as determined by ActivityManager
515 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000516 *
517 * Logged from:
518 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
519 */
Bookatzc1a050a2017-10-10 15:49:28 -0700520message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700521 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000522
Bookatzdb026a22018-01-10 19:01:56 -0800523 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700524 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000525}
526
527/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700528 * Logs process state change of a process, as per the activity manager.
529 *
530 * Logged from:
531 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
532 */
533message ProcessStateChanged {
534 optional int32 uid = 1;
535 optional string process_name = 2;
536 optional string package_name = 3;
537 // TODO: remove this when validation is done
538 optional int64 version = 5;
539 // The state, from frameworks/base/core/proto/android/app/enums.proto.
540 optional android.app.ProcessStateEnum state = 4;
541}
542
543/**
544 * Logs when ActivityManagerService sleep state is changed.
545 *
546 * Logged from:
547 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
548 */
549message ActivityManagerSleepStateChanged {
550 // TODO: import frameworks proto
551 enum State {
552 UNKNOWN = 0;
553 ASLEEP = 1;
554 AWAKE = 2;
555 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700556 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700557}
558
559/**
560 * Logs when system memory state changes.
561 *
562 * Logged from:
563 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
564 */
565message MemoryFactorStateChanged {
566 // TODO: import frameworks proto
567 enum State {
568 MEMORY_UNKNOWN = 0;
569 NORMAL = 1; // normal.
570 MODERATE = 2; // moderate memory pressure.
571 LOW = 3; // low memory.
572 CRITICAL = 4; // critical memory.
573
574 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700575 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700576}
577
578/**
579 * Logs when app is using too much cpu, according to ActivityManagerService.
580 *
581 * Logged from:
582 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
583 */
584message ExcessiveCpuUsageReported {
585 optional int32 uid = 1;
586 optional string process_name = 2;
587 optional string package_name = 3;
588 // package version. TODO: remove this when validation is done
589 optional int64 version = 4;
590}
591
592/**
593 * Logs when a cached process is killed, along with its pss.
594 *
595 * Logged from:
596 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
597 */
598message CachedKillReported {
599 optional int32 uid = 1;
600 optional string process_name = 2;
601 optional string package_name = 3;
602 // TODO: remove this when validation is done
603 optional int64 version = 5;
604 optional int64 pss = 4;
605}
606
607/**
608 * Logs when memory stats of a process is reported.
609 *
610 * Logged from:
611 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
612 */
613message ProcessMemoryStatReported {
614 optional int32 uid = 1;
615 optional string process_name = 2;
616 optional string package_name = 3;
617 //TODO: remove this when validation is done
618 optional int64 version = 9;
619 optional int64 pss = 4;
620 optional int64 uss = 5;
621 optional int64 rss = 6;
622 enum Type {
623 ADD_PSS_INTERNAL_SINGLE = 0;
624 ADD_PSS_INTERNAL_ALL_MEM = 1;
625 ADD_PSS_INTERNAL_ALL_POLL = 2;
626 ADD_PSS_EXTERNAL = 3;
627 ADD_PSS_EXTERNAL_SLOW = 4;
628 }
629 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800630 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700631}
632
633/**
Bookatzc1a050a2017-10-10 15:49:28 -0700634 * Logs that a process started, finished, crashed, or ANRed.
635 *
636 * Logged from:
637 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
638 */
639message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700640 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700641
David Chen0b5c90c2018-01-25 16:51:49 -0800642 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800643 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700644
Bookatzddccf0a2017-11-28 16:48:14 -0800645 // What lifecycle state the process changed to.
646 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800647 enum State {
648 FINISHED = 0;
649 STARTED = 1;
650 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800651 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800652 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700653}
654
Bookatzc1a050a2017-10-10 15:49:28 -0700655/**
656 * Logs when the ble scan state changes.
657 *
658 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700659 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700660 */
661message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800662 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700663
664 enum State {
665 OFF = 0;
666 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700667 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
668 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700669 }
670 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700671
Bookatze5ec0b42018-03-26 13:34:56 -0700672 // Does the scan have a filter.
673 optional bool is_filtered = 3;
674 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
675 optional bool is_first_match = 4;
676 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
677 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700678}
679
680/**
681 * Logs reporting of a ble scan finding results.
682 *
683 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700684 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700685 */
Bookatzae6738e2018-09-13 11:38:56 -0700686// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700687message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800688 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700689
690 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800691 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700692}
693
694/**
695 * Logs when a sensor state changes.
696 *
697 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700698 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700699 */
700message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800701 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700702
Bookatzc1a050a2017-10-10 15:49:28 -0700703 // The id (int) of the sensor.
704 optional int32 sensor_id = 2;
705
706 enum State {
707 OFF = 0;
708 ON = 1;
709 }
710 optional State state = 3;
711}
712
Bookatzc1a050a2017-10-10 15:49:28 -0700713/**
714 * Logs when GPS state changes.
715 *
716 * Logged from:
717 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
718 */
719message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800720 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700721
722 enum State {
723 OFF = 0;
724 ON = 1;
725 }
726 optional State state = 2;
727}
728
Bookatz48d362e2018-11-06 15:49:08 -0800729/**
730 * Logs when GPS signal quality.
731 *
732 * Logged from:
733 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
734 */
735message GpsSignalQualityChanged {
736 optional android.server.location.GpsSignalQualityEnum level = 1;
737}
738
Blake Kragten212edc72019-10-15 13:26:50 -0700739/**
740 * Gps location status report
741 *
742 * Logged from:
743 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
744 */
745message GpsLocationStatusReported {
746 // Boolean stating if location was acquired
747 optional bool location_success = 1;
748}
749
750/**
751 * Gps log time to first fix report
752 *
753 * Logged from:
754 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
755 */
756message GpsTimeToFirstFixReported {
757 // int32 reporting the time to first fix in milliseconds
758 optional int32 time_to_first_fix_millis = 1;
759}
Bookatzc1a050a2017-10-10 15:49:28 -0700760
761/**
762 * Logs when a sync manager sync state changes.
763 *
764 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700765 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700766 */
767message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800768 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700769
David Chen0b5c90c2018-01-25 16:51:49 -0800770 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800771 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700772
773 enum State {
774 OFF = 0;
775 ON = 1;
776 }
777 optional State state = 3;
778}
779
Yangster-mac96353002018-09-05 11:18:55 -0700780/*
781 * Deferred job stats.
782 *
783 * Logged from:
784 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
785*/
786message DeferredJobStatsReported {
787 repeated AttributionNode attribution_node = 1;
788
789 // Number of jobs deferred.
790 optional int32 num_jobs_deferred = 2;
791
792 // Time since the last job runs.
793 optional int64 time_since_last_job_millis = 3;
794}
795
Bookatzc1a050a2017-10-10 15:49:28 -0700796/**
797 * Logs when a job scheduler job state changes.
798 *
799 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700800 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700801 */
802message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800803 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700804
805 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800806 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700807
808 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800809 FINISHED = 0;
810 STARTED = 1;
811 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700812 }
813 optional State state = 3;
814
Tej Singh33a412b2018-03-16 18:43:59 -0700815 // The reason a job has stopped.
816 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700817 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700818 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100819
820 // The standby bucket of the app that scheduled the job. These match the framework constants
821 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
822 // already assigned 0.
823 enum Bucket {
824 UNKNOWN = -1;
825 ACTIVE = 0;
826 WORKING_SET = 1;
827 FREQUENT = 2;
828 RARE = 3;
829 NEVER = 4;
830 }
831 optional Bucket standby_bucket = 5 [default = UNKNOWN];
832
833 // The job id (as assigned by the app).
834 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700835}
836
837/**
838 * Logs when the audio state changes.
839 *
840 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700841 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700842 */
843message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800844 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700845
846 enum State {
847 OFF = 0;
848 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700849 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
850 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700851 }
852 optional State state = 2;
853}
854
855/**
856 * Logs when the video codec state changes.
857 *
858 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700859 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700860 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800861message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800862 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700863
864 enum State {
865 OFF = 0;
866 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700867 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
868 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700869 }
870 optional State state = 2;
871}
872
873/**
874 * Logs when the flashlight state changes.
875 *
876 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700877 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700878 */
879message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800880 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700881
882 enum State {
883 OFF = 0;
884 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700885 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
886 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700887 }
888 optional State state = 2;
889}
890
891/**
892 * Logs when the camera state changes.
893 *
894 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700895 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700896 */
897message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800898 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700899
900 enum State {
901 OFF = 0;
902 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700903 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
904 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700905 }
906 optional State state = 2;
907}
908
909/**
910 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000911 *
912 * Logged from:
913 * TODO
914 */
Bookatzd6746242017-10-24 18:39:35 -0700915message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -0800916 repeated AttributionNode attribution_node = 1
917 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +0000918
Bookatz1a1b0462018-01-12 11:47:03 -0800919 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
920 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristineed615642020-01-02 12:53:41 -0800921 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY];
922 ;
Bookatzc1a050a2017-10-10 15:49:28 -0700923
924 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristineed615642020-01-02 12:53:41 -0800925 optional string tag = 3 [(state_field_option).option = PRIMARY];
Bookatzc1a050a2017-10-10 15:49:28 -0700926
927 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800928 RELEASE = 0;
929 ACQUIRE = 1;
930 CHANGE_RELEASE = 2;
931 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700932 }
tsaichristineed615642020-01-02 12:53:41 -0800933 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Bookatzc1a050a2017-10-10 15:49:28 -0700934}
935
936/**
Bookatzc1a050a2017-10-10 15:49:28 -0700937 * Logs when a partial wakelock is considered 'long' (over 1 min).
938 *
939 * Logged from:
940 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
941 */
942message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800943 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700944
Yao Chend54f9dd2017-10-17 17:37:48 +0000945 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
946 optional string tag = 2;
947
Bookatzc1a050a2017-10-10 15:49:28 -0700948 // TODO: I have no idea what this is.
949 optional string history_tag = 3;
950
951 enum State {
952 OFF = 0;
953 ON = 1;
954 }
955 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000956}
957
Bookatzc1a050a2017-10-10 15:49:28 -0700958/**
Bookatza66083f2018-09-20 17:24:00 -0700959 * Logs when the device is interactive, according to the PowerManager Notifier.
960 *
961 * Logged from:
962 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
963 */
964message InteractiveStateChanged {
965 enum State {
966 OFF = 0;
967 ON = 1;
968 }
969 optional State state = 1;
970}
971
972/**
Bookatzc1a050a2017-10-10 15:49:28 -0700973 * Logs Battery Saver state change.
974 *
975 * Logged from:
976 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
977 */
978message BatterySaverModeStateChanged {
979 enum State {
980 OFF = 0;
981 ON = 1;
982 }
983 optional State state = 1;
984}
985
986/**
987 * Logs Doze mode state change.
988 *
989 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800990 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700991 */
992message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800993 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800994}
995
996
997/**
998 * Logs state change of Doze mode including maintenance windows.
999 *
1000 * Logged from:
1001 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1002 */
1003message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001004 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001005}
1006
1007/**
1008 * Logs screen brightness level.
1009 *
1010 * Logged from:
1011 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1012 */
1013message ScreenBrightnessChanged {
1014 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1015 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001016}
1017
1018/**
1019 * Logs battery level (percent full, from 0 to 100).
1020 *
1021 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001022 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001023 */
1024message BatteryLevelChanged {
1025 // Battery level. Should be in [0, 100].
1026 optional int32 battery_level = 1;
1027}
1028
1029/**
1030 * Logs change in charging status of the device.
1031 *
1032 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001033 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001034 */
1035message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001036 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1037 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001038}
1039
1040/**
1041 * Logs whether the device is plugged in, and what power source it is using.
1042 *
1043 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001044 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001045 */
1046message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001047 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1048 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001049}
1050
Bookatz8c6571b2017-10-24 15:04:41 -07001051/**
1052 * Logs when an app's wakeup alarm fires.
1053 *
1054 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001055 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001056 */
1057message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001058 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001059
1060 // Name of the wakeup alarm.
1061 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001062
1063 // Name of source package (for historical reasons, since BatteryStats tracked it).
1064 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001065
1066 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1067 enum Bucket {
1068 UNKNOWN = 0;
1069 EXEMPTED = 5;
1070 ACTIVE = 10;
1071 WORKING_SET = 20;
1072 FREQUENT = 30;
1073 RARE = 40;
1074 NEVER = 50;
1075 }
1076 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1077 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001078}
1079
1080/**
1081 * Logs when an an app causes the mobile radio to change state.
1082 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1083 *
1084 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001085 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001086 */
1087message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001088 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001089
Bookatz1a1b0462018-01-12 11:47:03 -08001090 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1091 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001092}
1093
1094/**
1095 * Logs when an an app causes the wifi radio to change state.
1096 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1097 *
1098 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001099 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001100 */
1101message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001102 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001103
Bookatz1a1b0462018-01-12 11:47:03 -08001104 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1105 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001106}
1107
1108/**
1109 * Logs kernel wakeup reasons and aborts.
1110 *
1111 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001112 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001113 */
1114message KernelWakeupReported {
1115 // Name of the kernel wakeup reason (or abort).
1116 optional string wakeup_reason_name = 1;
1117
1118 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001119 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001120}
1121
1122/**
Bookatzda1798c2018-12-13 14:16:00 -08001123 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001124 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001125 *
1126 * Logged from:
1127 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1128 */
1129message WifiEnabledStateChanged {
1130 enum State {
1131 OFF = 0;
1132 ON = 1;
1133 }
1134 optional State state = 1;
1135}
1136
1137/**
1138 * 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 -08001139 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1140 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001141 *
1142 * Logged from:
1143 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1144 */
1145message WifiRunningStateChanged {
1146 repeated AttributionNode attribution_node = 1;
1147
1148 enum State {
1149 OFF = 0;
1150 ON = 1;
1151 }
1152 optional State state = 2;
1153}
1154
1155/**
Bookatze5885242017-10-24 20:10:31 -07001156 * Logs wifi locks held by an app.
1157 *
1158 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001159 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001160 */
1161message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001162 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001163
1164 enum State {
1165 OFF = 0;
1166 ON = 1;
1167 }
1168 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001169
1170 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1171 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001172}
1173
1174/**
1175 * Logs wifi signal strength changes.
1176 *
1177 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001178 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001179 */
1180message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001181 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1182 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001183}
1184
1185/**
1186 * Logs wifi scans performed by an app.
1187 *
1188 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001189 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001190 */
1191message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001192 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001193
1194 enum State {
1195 OFF = 0;
1196 ON = 1;
1197 }
1198 optional State state = 2;
1199}
1200
1201/**
Tej Singh4503e102018-01-04 14:35:01 -08001202 * Logs wifi multicast locks held by an app
1203 *
1204 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001205 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001206 */
1207message WifiMulticastLockStateChanged {
1208 repeated AttributionNode attribution_node = 1;
1209
1210 enum State {
1211 OFF = 0;
1212 ON = 1;
1213 }
1214 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001215
1216 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001217}
1218
1219/**
Tej Singh1ea42892018-01-19 09:27:00 -08001220 * Logs shutdown reason and duration on next boot.
1221 *
1222 * Logged from:
1223 * frameworks/base/core/java/com/android/server/BootReceiver.java
1224 */
1225message ShutdownSequenceReported {
1226 // True if shutdown is for a reboot. Default: false if we do not know.
1227 optional bool reboot = 1;
1228
1229 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1230 optional string reason = 2;
1231
1232 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1233 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001234 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001235
1236 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001237 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001238}
1239
Tej Singh6483ea42018-01-25 17:45:49 -08001240
1241/**
1242 * Logs boot reason and duration.
1243 *
1244 * Logged from:
1245 * system/core/bootstat/bootstat.cpp
1246 */
1247message BootSequenceReported {
1248 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1249 // Default: "<EMPTY>" if not available.
1250 optional string bootloader_reason = 1;
1251
1252 // Reason for system boot. Eg. bootloader, reboot,userrequested
1253 // Default: "<EMPTY>" if not available.
1254 optional string system_reason = 2;
1255
1256 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001257 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001258
1259 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001260 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001261
1262 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001263 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001264
1265 // Time since last boot in ms. Default: 0 if not available.
1266 optional int64 time_since_last_boot = 6;
1267}
1268
Tej Singhc477d9c2018-02-05 18:31:39 -08001269
1270/**
1271 * Logs call state and disconnect cause (if applicable).
1272 *
1273 * Logged from:
1274 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1275 */
1276message CallStateChanged {
1277 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1278 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1279 optional android.telecom.CallStateEnum call_state = 1;
1280
1281 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1282 // This value is only applicable when the call_state is DISCONNECTED, and
1283 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1284 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1285 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1286
1287 // True if the call is self-managed, which are apps that use the
1288 // telecom infrastructure to make their own calls.
1289 optional bool self_managed = 3;
1290
1291 // True if call is external. External calls are calls on connected Wear
1292 // devices but show up in Telecom so the user can pull them onto the device.
1293 optional bool external_call = 4;
1294}
1295
Tej Singh1ea42892018-01-19 09:27:00 -08001296/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001297 * Logs keyguard state. The keyguard is the lock screen.
1298 *
1299 * Logged from:
1300 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1301 */
1302message KeyguardStateChanged {
1303 enum State {
1304 UNKNOWN = 0;
1305 // The keyguard is hidden when the phone is unlocked.
1306 HIDDEN = 1;
1307 // The keyguard is shown when the phone is locked (screen turns off).
1308 SHOWN= 2;
1309 // The keyguard is occluded when something is overlaying the keyguard.
1310 // Eg. Opening the camera while on the lock screen.
1311 OCCLUDED = 3;
1312 }
1313 optional State state = 1;
1314}
1315
1316/**
1317 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1318 * prompts the user to enter a password (pattern, pin, etc).
1319 *
1320 * Logged from:
1321 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1322 */
1323
1324message KeyguardBouncerStateChanged {
1325 enum State {
1326 UNKNOWN = 0;
1327 // Bouncer is hidden, either as a result of successfully entering the
1328 // password, screen timing out, or user going back to lock screen.
1329 HIDDEN = 1;
1330 // This is when the user is being prompted to enter the password.
1331 SHOWN = 2;
1332 }
1333 optional State state = 1;
1334}
1335
1336/**
1337 * Logs the result of entering a password into the keyguard bouncer.
1338 *
1339 * Logged from:
1340 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1341 */
1342message KeyguardBouncerPasswordEntered {
1343 enum BouncerResult {
1344 UNKNOWN = 0;
1345 // The password entered was incorrect.
1346 FAILURE = 1;
1347 // The password entered was correct.
1348 SUCCESS = 2;
1349 }
1350 optional BouncerResult result = 1;
1351}
1352
Tej Singha883b372018-02-15 11:30:01 -08001353/*
1354 * Logs changes to the configuration of the device. The configuration is defined
1355 * in frameworks/base/core/java/android/content/res/Configuration.java
1356 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1357 * Please go there to interpret the possible values each field can be.
1358 *
1359 * Logged from:
1360 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1361 */
1362message ResourceConfigurationChanged {
1363 // Bit mask of color capabilities of the screen.
1364 // Contains information about the color gamut and hdr mode of the screen.
1365 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001366 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001367
1368 // The target screen density being rendered to.
1369 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001370 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001371
1372 // Current user preference for the scaling factor for fonts,
1373 // relative to the base density scaling.
1374 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001375 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001376
1377 // Flag indicating whether the hard keyboard is hidden.
1378 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001379 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001380
1381 // The type of keyboard attached to the device.
1382 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1383 optional int32 keyboard = 5;
1384
1385 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1386 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001387 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001388
1389 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1390 // 0 if undefined.
1391 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1392 optional int32 mcc = 7;
1393
1394 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1395 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1396 // MNC_ZERO symbol defined in Configuration.java.
1397 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1398 optional int32 mnc = 8;
1399
1400 // The kind of navigation available on the device.
1401 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1402 optional int32 navigation = 9;
1403
1404 // Flag indicating whether the navigation is available.
1405 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001406 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001407
1408 // Overall orientation of the screen.
1409 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1410 optional int32 orientation = 11;
1411
1412 // The current height of the available screen space, in dp units.
1413 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001414 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001415
1416 // Bit mask of overall layout of the screen.
1417 // Contains information about screen size, whether the screen is wider/taller
1418 // than normal, whether the screen layout is right-tl-left or left-to-right,
1419 // and whether the screen has a rounded shape.
1420 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001421 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001422
1423 // Current width of the available screen space, in dp units.
1424 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001425 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001426
1427 // The smallest screen size an application will see in normal operation.
1428 // This is the smallest value of both screenWidthDp and screenHeightDp
1429 // in portrait and landscape.
1430 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001431 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001432
1433 // The type of touch screen attached to the device.
1434 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1435 optional int32 touchscreen = 16;
1436
1437 // Bit mask of the ui mode.
1438 // Contains information about the overall ui mode of the device.
1439 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1440 // Also contains information about whether the device is in night mode.
1441 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001442 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001443}
1444
Tej Singheee317b2018-03-07 19:28:05 -08001445
1446/**
1447 * Logs changes in the connection state of the mobile radio.
1448 *
1449 * Logged from:
1450 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1451 */
1452message MobileConnectionStateChanged {
1453 // States are from the state machine DataConnection.java.
1454 enum State {
1455 UNKNOWN = 0;
1456 // The connection is inactive, or disconnected.
1457 INACTIVE = 1;
1458 // The connection is being activated, or connecting.
1459 ACTIVATING = 2;
1460 // The connection is active, or connected.
1461 ACTIVE = 3;
1462 // The connection is disconnecting.
1463 DISCONNECTING = 4;
1464 // The connection is disconnecting after creating a connection.
1465 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1466 }
1467 optional State state = 1;
1468 // For multi-sim phones, this distinguishes between the sim cards.
1469 optional int32 sim_slot_index = 2;
1470 // Used to identify the connection. Starts at 0 and increments by 1 for
1471 // every new network created. Resets whenever the device reboots.
1472 optional int32 data_connection_id = 3;
1473 // A bitmask for the capabilities of this connection.
1474 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1475 // Default value (if we have no information): 0
1476 optional int64 capabilities = 4;
1477 // If this connection has internet.
1478 // This just checks if the DEFAULT bit of capabilities is set.
1479 optional bool has_internet = 5;
1480}
1481
1482/**
1483 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1484 *
1485 * Logged from:
1486 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1487 */
1488message MobileRadioTechnologyChanged {
1489 optional android.telephony.NetworkTypeEnum state = 1;
1490 // For multi-sim phones, this distinguishes between the sim cards.
1491 optional int32 sim_slot_index = 2;
1492}
1493
Andrew Chantb56388b2018-03-22 21:07:33 -07001494/**
1495 * Logs the VID and PID of any connected USB devices.
1496 *
1497 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1498 *
1499 * Logged by Vendor.
1500 */
1501message UsbDeviceAttached {
1502 optional int32 vid = 1;
1503 optional int32 pid = 2;
1504 optional bool has_audio = 3;
1505 optional bool has_hid = 4;
1506 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001507 enum State {
1508 STATE_DISCONNECTED = 0;
1509 STATE_CONNECTED = 1;
1510 }
1511 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001512 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001513}
1514
Tej Singheee317b2018-03-07 19:28:05 -08001515
Tej Singhdd7bd352018-02-09 19:33:15 -08001516/**
Tej Singh5d991e12018-03-09 19:48:11 -08001517 * Logs when Bluetooth is enabled and disabled.
1518 *
1519 * Logged from:
1520 * services/core/java/com/android/server/BluetoothManagerService.java
1521 */
1522message BluetoothEnabledStateChanged {
1523 repeated AttributionNode attribution_node = 1;
1524 // Whether or not bluetooth is enabled on the device.
1525 enum State {
1526 UNKNOWN = 0;
1527 ENABLED = 1;
1528 DISABLED = 2;
1529 }
1530 optional State state = 2;
1531 // The reason for being enabled/disabled.
1532 // Eg. Airplane mode, crash, application request.
1533 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1534 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001535 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001536}
1537
1538/**
Jack Hed9837c82019-01-09 01:19:13 -08001539 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001540 *
1541 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001542 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1543 *
1544 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001545 */
1546message BluetoothConnectionStateChanged {
1547 // The state of the connection.
1548 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1549 optional android.bluetooth.ConnectionStateEnum state = 1;
1550 // An identifier that can be used to match connect and disconnect events.
1551 // Currently is last two bytes of a hash of a device level ID and
1552 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001553 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001554 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001555 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1556 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001557 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001558 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001559 // An identifier that can be used to match events for this device.
1560 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1561 // Salt: Randomly generated 256 bit value
1562 // Hash algorithm: HMAC-SHA256
1563 // Size: 32 byte
1564 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001565 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001566}
1567
1568/**
1569 * Logs when a Bluetooth device connects and disconnects over ACL
1570 *
1571 * Logged from:
1572 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1573 *
1574 * Next Tag: 3
1575 */
1576message BluetoothAclConnectionStateChanged {
1577 // An identifier that can be used to match events for this device.
1578 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1579 // Salt: Randomly generated 256 bit value
1580 // Hash algorithm: HMAC-SHA256
1581 // Size: 32 byte
1582 // Default: null or empty if the device identifier is not known
1583 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1584 // The state of the connection.
1585 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1586 optional android.bluetooth.ConnectionStateEnum state = 2;
1587}
1588
1589/**
1590 * Logs when a Bluetooth device connects and disconnects over SCO
1591 *
1592 * Logged from:
1593 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1594 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1595 *
1596 * Next Tag: 4
1597 */
1598message BluetoothScoConnectionStateChanged {
1599 // An identifier that can be used to match events for this device.
1600 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1601 // Salt: Randomly generated 256 bit value
1602 // Hash algorithm: HMAC-SHA256
1603 // Size: 32 byte
1604 // Default: null or empty if the device identifier is not known
1605 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1606 // The state of the connection.
1607 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1608 optional android.bluetooth.ConnectionStateEnum state = 2;
1609 // Codec used for this SCO connection
1610 // Default: UNKNOWN
1611 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001612}
1613
Jack Hec27040a2019-01-09 20:54:41 -08001614/**
1615 * Logged when active device of a profile changes
1616 *
1617 * Logged from:
1618 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1619 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1620 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1621 */
1622message BluetoothActiveDeviceChanged {
1623 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1624 // From android.bluetooth.BluetoothProfile
1625 optional int32 bt_profile = 1;
1626 // An identifier that can be used to match events for this new active device.
1627 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1628 // Salt: Randomly generated 256 bit value
1629 // Hash algorithm: HMAC-SHA256
1630 // Size: 32 byte
1631 // Default: null or empty if there is no active device for this profile
1632 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1633}
1634
Jack Heab86dbd22018-12-18 15:43:27 -08001635// Logs when there is an event affecting Bluetooth device's link layer connection.
1636// - This event is triggered when there is a related HCI command or event
1637// - Users of this metrics can deduce Bluetooth device's connection state from these events
1638// - HCI commands are logged before the command is sent, after receiving command status, and after
1639// receiving command complete
1640// - HCI events are logged when they arrive
1641//
1642// Low level log from system/bt
1643//
1644// Bluetooth classic commands:
1645// - CMD_CREATE_CONNECTION
1646// - CMD_DISCONNECT
1647// - CMD_CREATE_CONNECTION_CANCEL
1648// - CMD_ACCEPT_CONNECTION_REQUEST
1649// - CMD_REJECT_CONNECTION_REQUEST
1650// - CMD_SETUP_ESCO_CONNECTION
1651// - CMD_ACCEPT_ESCO_CONNECTION
1652// - CMD_REJECT_ESCO_CONNECTION
1653// - CMD_ENH_SETUP_ESCO_CONNECTION
1654// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1655//
1656// Bluetooth low energy commands:
1657// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1658// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1659// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1660// - CMD_BLE_CLEAR_WHITE_LIST
1661// - CMD_BLE_ADD_WHITE_LIST
1662// - CMD_BLE_REMOVE_WHITE_LIST
1663//
1664// Bluetooth classic events:
1665// - EVT_CONNECTION_COMP
1666// - EVT_CONNECTION_REQUEST
1667// - EVT_DISCONNECTION_COMP
1668// - EVT_ESCO_CONNECTION_COMP
1669// - EVT_ESCO_CONNECTION_CHANGED
1670//
1671// Bluetooth low energy meta events:
1672// - BLE_EVT_CONN_COMPLETE_EVT
1673// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1674//
1675// Next tag: 10
1676message BluetoothLinkLayerConnectionEvent {
1677 // An identifier that can be used to match events for this device.
1678 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1679 // Salt: Randomly generated 256 bit value
1680 // Hash algorithm: HMAC-SHA256
1681 // Size: 32 byte
1682 // Default: null or empty if the device identifier is not known
1683 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1684 // Connection handle of this connection if available
1685 // Range: 0x0000 - 0x0EFF (12 bits)
1686 // Default: 0xFFFF if the handle is unknown
1687 optional int32 connection_handle = 2;
1688 // Direction of the link
1689 // Default: DIRECTION_UNKNOWN
1690 optional android.bluetooth.DirectionEnum direction = 3;
1691 // Type of this link
1692 // Default: LINK_TYPE_UNKNOWN
1693 optional android.bluetooth.LinkTypeEnum type = 4;
1694
1695 // Reason metadata for this link layer connection event, rules for interpretation:
1696 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1697 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1698 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1699 // set and valid, ignore hci_ble_event
1700
1701 // HCI command associated with this event
1702 // Default: CMD_UNKNOWN
1703 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1704 // HCI event associated with this event
1705 // Default: EVT_UNKNOWN
1706 optional android.bluetooth.hci.EventEnum hci_event = 6;
1707 // HCI BLE meta event associated with this event
1708 // Default: BLE_EVT_UNKNOWN
1709 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1710 // HCI command status code if this is triggerred by hci_cmd
1711 // Default: STATUS_UNKNOWN
1712 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1713 // HCI reason code associated with this event
1714 // Default: STATUS_UNKNOWN
1715 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1716}
1717
Howard Roe103fe22019-01-17 16:52:16 -08001718/**
1719 * Logs when a module is rolled back by Watchdog.
1720 *
1721 * Logged from: Rollback Manager
1722 */
1723message WatchdogRollbackOccurred {
1724 enum RollbackType {
1725 UNKNOWN = 0;
1726 ROLLBACK_INITIATE = 1;
1727 ROLLBACK_SUCCESS = 2;
1728 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001729 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001730 }
1731 optional RollbackType rollback_type = 1;
1732
1733 optional string package_name = 2;
1734
1735 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001736
1737 enum RollbackReasonType {
1738 REASON_UNKNOWN = 0;
1739 REASON_NATIVE_CRASH = 1;
1740 REASON_EXPLICIT_HEALTH_CHECK = 2;
1741 REASON_APP_CRASH = 3;
1742 REASON_APP_NOT_RESPONDING = 4;
1743 }
1744 optional RollbackReasonType rollback_reason = 4;
1745
1746 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1747 // is initiated. Empty if the package is unknown.
1748 optional string failing_package_name = 5;
Howard Roe103fe22019-01-17 16:52:16 -08001749}
1750
Jack Hec27040a2019-01-09 20:54:41 -08001751/**
1752 * Logs when there is a change in Bluetooth A2DP playback state
1753 *
1754 * Logged from:
1755 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1756 */
1757message BluetoothA2dpPlaybackStateChanged {
1758 // An identifier that can be used to match events for this device.
1759 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1760 // Salt: Randomly generated 256 bit value
1761 // Hash algorithm: HMAC-SHA256
1762 // Size: 32 byte
1763 // Default: null or empty if the device identifier is not known
1764 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1765 // Current playback state
1766 // Default: PLAYBACK_STATE_UNKNOWN
1767 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1768 // Current audio coding mode
1769 // Default: AUDIO_CODING_MODE_UNKNOWN
1770 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1771}
1772
1773/**
1774 * Logs when there is a change in A2DP codec config for a particular remote device
1775 *
1776 * Logged from:
1777 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1778 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1779 */
1780message BluetoothA2dpCodecConfigChanged {
1781 // An identifier that can be used to match events for this device.
1782 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1783 // Salt: Randomly generated 256 bit value
1784 // Hash algorithm: HMAC-SHA256
1785 // Size: 32 byte
1786 // Default: null or empty if the device identifier is not known
1787 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1788 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1789 // Default SOURCE_CODEC_TYPE_INVALID
1790 optional int32 codec_type = 2;
1791 // Codec priroity, the higher the more preferred, -1 for disabled
1792 // Default: CODEC_PRIORITY_DEFAULT
1793 optional int32 codec_priority = 3;
1794 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1795 // Default: SAMPLE_RATE_NONE
1796 optional int32 sample_rate = 4;
1797 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1798 // Default: BITS_PER_SAMPLE_NONE
1799 optional int32 bits_per_sample = 5;
1800 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1801 // Default: CHANNEL_MODE_NONE
1802 optional int32 channel_mode = 6;
1803 // Codec specific values
1804 // Default 0
1805 optional int64 codec_specific_1 = 7;
1806 optional int64 codec_specific_2 = 8;
1807 optional int64 codec_specific_3 = 9;
1808 optional int64 codec_specific_4 = 10;
1809}
1810
1811/**
1812 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1813 * Each codec's capability is logged separately due to statsd restriction
1814 *
1815 * Logged from:
1816 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1817 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1818 */
1819message BluetoothA2dpCodecCapabilityChanged {
1820 // An identifier that can be used to match events for this device.
1821 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1822 // Salt: Randomly generated 256 bit value
1823 // Hash algorithm: HMAC-SHA256
1824 // Size: 32 byte
1825 // Default: null or empty if the device identifier is not known
1826 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1827 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1828 // Default SOURCE_CODEC_TYPE_INVALID
1829 optional int32 codec_type = 2;
1830 // Codec priroity, the higher the more preferred, -1 for disabled
1831 // Default: CODEC_PRIORITY_DEFAULT
1832 optional int32 codec_priority = 3;
1833 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1834 // in BluetoothCodecConfig
1835 // Default: empty and SAMPLE_RATE_NONE for individual item
1836 optional int32 sample_rate = 4;
1837 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1838 // in BluetoothCodecConfig
1839 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1840 optional int32 bits_per_sample = 5;
1841 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1842 // BluetoothCodecConfig
1843 // Default: empty and CHANNEL_MODE_NONE for individual item
1844 optional int32 channel_mode = 6;
1845 // Codec specific values
1846 // Default 0
1847 optional int64 codec_specific_1 = 7;
1848 optional int64 codec_specific_2 = 8;
1849 optional int64 codec_specific_3 = 9;
1850 optional int64 codec_specific_4 = 10;
1851}
1852
1853/**
1854 * Logs when A2DP failed to read from PCM source.
1855 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1856 *
1857 * Logged from:
1858 * system/bt
1859 */
1860message BluetoothA2dpAudioUnderrunReported {
1861 // An identifier that can be used to match events for this device.
1862 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1863 // Salt: Randomly generated 256 bit value
1864 // Hash algorithm: HMAC-SHA256
1865 // Size: 32 byte
1866 // Default: null or empty if the device identifier is not known
1867 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1868 // Encoding interval in nanoseconds
1869 // Default: 0
1870 optional int64 encoding_interval_nanos = 2;
1871 // Number of bytes of PCM data that could not be read from the source
1872 // Default: 0
1873 optional int32 num_missing_pcm_bytes = 3;
1874}
1875
1876/**
1877 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1878 * buffer queue is full and we have to drop data
1879 *
1880 * Logged from:
1881 * system/bt
1882 */
1883message BluetoothA2dpAudioOverrunReported {
1884 // An identifier that can be used to match events for this device.
1885 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1886 // Salt: Randomly generated 256 bit value
1887 // Hash algorithm: HMAC-SHA256
1888 // Size: 32 byte
1889 // Default: null or empty if the device identifier is not known
1890 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1891 // Encoding interval in nanoseconds
1892 // Default: 0
1893 optional int64 encoding_interval_nanos = 2;
1894 // Number of buffers dropped in this event
1895 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1896 // Default: 0
1897 optional int32 num_dropped_buffers = 3;
1898 // Number of encoded buffers dropped in this event
1899 // Default 0
1900 optional int32 num_dropped_encoded_frames = 4;
1901 // Number of encoded bytes dropped in this event
1902 // Default: 0
1903 optional int32 num_dropped_encoded_bytes = 5;
1904}
1905
1906/**
1907 * Logs when we receive reports regarding a device's RSSI value
1908 *
1909 * Logged from:
1910 * system/bt
1911 */
1912message BluetoothDeviceRssiReported {
1913 // An identifier that can be used to match events for this device.
1914 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1915 // Salt: Randomly generated 256 bit value
1916 // Hash algorithm: HMAC-SHA256
1917 // Size: 32 byte
1918 // Default: null or empty if the device identifier is not known
1919 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1920 // Connection handle of this connection if available
1921 // Range: 0x0000 - 0x0EFF (12 bits)
1922 // Default: 0xFFFF if the handle is unknown
1923 optional int32 connection_handle = 2;
1924 // HCI command status code if this is triggerred by hci_cmd
1925 // Default: STATUS_UNKNOWN
1926 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1927 // BR/EDR
1928 // Range: -128 ≤ N ≤ 127 (signed integer)
1929 // Units: dB
1930 // LE:
1931 // Range: -127 to 20, 127 (signed integer)
1932 // Units: dBm
1933 // Invalid when an out of range value is reported
1934 optional int32 rssi = 4;
1935}
1936
1937/**
1938 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1939 *
1940 * Logged from:
1941 * system/bt
1942 */
1943message BluetoothDeviceFailedContactCounterReported {
1944 // An identifier that can be used to match events for this device.
1945 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1946 // Salt: Randomly generated 256 bit value
1947 // Hash algorithm: HMAC-SHA256
1948 // Size: 32 byte
1949 // Default: null or empty if the device identifier is not known
1950 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1951 // Connection handle of this connection if available
1952 // Range: 0x0000 - 0x0EFF (12 bits)
1953 // Default: 0xFFFF if the handle is unknown
1954 optional int32 connection_handle = 2;
1955 // HCI command status code if this is triggerred by hci_cmd
1956 // Default: STATUS_UNKNOWN
1957 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1958 // Number of consecutive failed contacts for a connection corresponding to the Handle
1959 // Range: uint16_t, 0-0xFFFF
1960 // Default: 0xFFFFF
1961 optional int32 failed_contact_counter = 4;
1962}
1963
1964/**
1965 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1966 *
1967 * Logged from:
1968 * system/bt
1969 */
1970message BluetoothDeviceTxPowerLevelReported {
1971 // An identifier that can be used to match events for this device.
1972 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1973 // Salt: Randomly generated 256 bit value
1974 // Hash algorithm: HMAC-SHA256
1975 // Size: 32 byte
1976 // Default: null or empty if the device identifier is not known
1977 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1978 // Connection handle of this connection if available
1979 // Range: 0x0000 - 0x0EFF (12 bits)
1980 // Default: 0xFFFF if the handle is unknown
1981 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001982 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001983 // Default: STATUS_UNKNOWN
1984 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1985 // Range: -30 ≤ N ≤ 20
1986 // Units: dBm
1987 // Invalid when an out of range value is reported
1988 optional int32 transmit_power_level = 4;
1989}
Jack Heab86dbd22018-12-18 15:43:27 -08001990
Tej Singh5d991e12018-03-09 19:48:11 -08001991/**
Jack He1021a612019-01-20 21:22:46 -08001992 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1993 * receiving an HCI command from the host
1994 *
1995 * Logged from: system/bt
1996 */
1997message BluetoothHciTimeoutReported {
1998 // HCI command associated with this event
1999 // Default: CMD_UNKNOWN
2000 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2001}
2002
2003/**
2004 * Logs when we receive Bluetooth Link Quality Report event from the controller
2005 * See Android Bluetooth HCI specification for more details
2006 *
2007 * Note: all count and bytes field are counted since last event
2008 *
2009 * Logged from: system/bt
2010 */
2011message BluetoothQualityReportReported {
2012 // Quality report ID
2013 // Original type: uint8_t
2014 // Default: BQR_ID_UNKNOWN
2015 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2016 // Packet type of the connection
2017 // Original type: uint8_t
2018 // Default: BQR_PACKET_TYPE_UNKNOWN
2019 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2020 // Connection handle of the connection
2021 // Original type: uint16_t
2022 optional int32 connection_handle = 3;
2023 // Performing Role for the connection
2024 // Original type: uint8_t
2025 optional int32 connection_role = 4;
2026 // Current Transmit Power Level for the connection. This value is the same as the controller's
2027 // response to the HCI_Read_Transmit_Power_Level HCI command
2028 // Original type: uint8_t
2029 optional int32 tx_power_level = 5;
2030 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2031 // absolute receiver signal strength value
2032 // Original type: int8_t
2033 optional int32 rssi = 6;
2034 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2035 // channels used by the link currently
2036 // Original type: uint8_t
2037 optional int32 snr = 7;
2038 // Indicates the number of unused channels in AFH_channel_map
2039 // Original type: uint8_t
2040 optional int32 unused_afh_channel_count = 8;
2041 // Indicates the number of the channels which are interfered and quality is bad but are still
2042 // selected for AFH
2043 // Original type: uint8_t
2044 optional int32 afh_select_unideal_channel_count = 9;
2045 // Current Link Supervision Timeout Setting
2046 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2047 // Original type: uint16_t
2048 optional int32 lsto = 10;
2049 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2050 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2051 // 0x01 (Piconet Clock)
2052 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2053 // Original type: uint32_t
2054 optional int64 connection_piconet_clock = 11;
2055 // The count of retransmission
2056 // Original type: uint32_t
2057 optional int64 retransmission_count = 12;
2058 // The count of no RX
2059 // Original type: uint32_t
2060 optional int64 no_rx_count = 13;
2061 // The count of NAK (Negative Acknowledge)
2062 // Original type: uint32_t
2063 optional int64 nak_count = 14;
2064 // Controller timestamp of last TX ACK
2065 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2066 // Original type: uint32_t
2067 optional int64 last_tx_ack_timestamp = 15;
2068 // The count of Flow-off (STOP)
2069 // Original type: uint32_t
2070 optional int64 flow_off_count = 16;
2071 // Controller timestamp of last Flow-on (GO)
2072 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2073 // Original type: uint32_t
2074 optional int64 last_flow_on_timestamp = 17;
2075 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2076 // Original type: uint32_t
2077 optional int64 buffer_overflow_bytes = 18;
2078 // Buffer underflow count (in byte) since last event
2079 // Original type: uint32_t
2080 optional int64 buffer_underflow_bytes = 19;
2081}
2082
2083/**
2084 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2085 *
2086 * Notes:
2087 * - Each event can be partially filled as we might learn different pieces of device
2088 * information at different time
2089 * - Multiple device info events can be combined to give more complete picture
2090 * - When multiple device info events tries to describe the same information, the
2091 * later one wins
2092 *
2093 * Logged from:
2094 * packages/apps/Bluetooth
2095 */
Jack Heaea26982019-04-04 11:19:48 -07002096message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002097 // An identifier that can be used to match events for this device.
2098 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2099 // Salt: Randomly generated 256 bit value
2100 // Hash algorithm: HMAC-SHA256
2101 // Size: 32 byte
2102 // Default: null or empty if the device identifier is not known
2103 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2104 // Where is this device info obtained from
2105 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2106 // Name of the data source
2107 // For EXTERNAL: package name of the data source
2108 // For INTERNAL: null for general case, component name otherwise
2109 optional string source_name = 3;
2110 // Name of the manufacturer of this device
2111 optional string manufacturer = 4;
2112 // Model of this device
2113 optional string model = 5;
2114 // Hardware version of this device
2115 optional string hardware_version = 6;
2116 // Software version of this device
2117 optional string software_version = 7;
2118}
2119
2120/**
2121 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2122 * device, as documented by the Bluetooth Core HCI specification
2123 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2124 * Vol 2, Part E, Page 1118
2125 *
2126 * Logged from:
2127 * system/bt
2128 */
2129message BluetoothRemoteVersionInfoReported {
2130 // Connection handle of the connection
2131 // Original type: uint16_t
2132 optional int32 connection_handle = 1;
2133 // HCI command status code
2134 // Default: STATUS_UNKNOWN
2135 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2136 // 1 byte Version of current LMP in the remote controller
2137 optional int32 lmp_version = 3;
2138 // 2 bytes LMP manufacturer code of the remote controller
2139 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2140 optional int32 lmp_manufacturer_code = 4;
2141 // 4 bytes subversion of the LMP in the remote controller
2142 optional int32 lmp_subversion = 5;
2143}
2144
2145/**
2146 * Logs when certain Bluetooth SDP attributes are discovered
2147 * Constant definitions are from:
2148 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2149 *
2150 * Current logged attributes:
2151 * - BluetoothProfileDescriptorList
2152 * - Supported Features Bitmask
2153 *
2154 * Logged from:
2155 * system/bt
2156 */
2157message BluetoothSdpAttributeReported {
2158 // An identifier that can be used to match events for this device.
2159 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2160 // Salt: Randomly generated 256 bit value
2161 // Hash algorithm: HMAC-SHA256
2162 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2163 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2164 // Original type: uint16_t
2165 optional int32 protocol_uuid = 2;
2166 // Short form UUIDs used to identify Bluetooth SDP attribute types
2167 // Original type: uint16_t
2168 optional int32 attribute_id = 3;
2169 // Attribute value for the particular attribute
2170 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2171}
2172
2173/**
2174 * Logs when bond state of a Bluetooth device changes
2175 *
2176 * Logged from:
2177 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2178 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2179 */
2180message BluetoothBondStateChanged {
2181 // An identifier that can be used to match events for this device.
2182 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2183 // Salt: Randomly generated 256 bit value
2184 // Hash algorithm: HMAC-SHA256
2185 // Size: 32 byte
2186 // Default: null or empty if the device identifier is not known
2187 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2188 // Preferred transport type to remote dual mode device
2189 // Default: TRANSPORT_AUTO means no preference
2190 optional android.bluetooth.TransportTypeEnum transport = 2;
2191 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2192 // Default: UNKNOWN
2193 optional android.bluetooth.DeviceTypeEnum type = 3;
2194 // Current bond state (NONE, BONDING, BONDED)
2195 // Default: BOND_STATE_UNKNOWN
2196 optional android.bluetooth.BondStateEnum bond_state = 4;
2197 // Bonding sub state
2198 // Default: BOND_SUB_STATE_UNKNOWN
2199 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2200 // Unbond Reason
2201 // Default: UNBOND_REASON_UNKNOWN
2202 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2203}
2204
2205/**
2206 * Logs there is an event related Bluetooth classic pairing
2207 *
2208 * Logged from:
2209 * system/bt
2210 */
2211message BluetoothClassicPairingEventReported {
2212 // An identifier that can be used to match events for this device.
2213 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2214 // Salt: Randomly generated 256 bit value
2215 // Hash algorithm: HMAC-SHA256
2216 // Size: 32 byte
2217 // Default: null or empty if the device identifier is not known
2218 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2219 // Connection handle of this connection if available
2220 // Range: 0x0000 - 0x0EFF (12 bits)
2221 // Default: 0xFFFF if the handle is unknown
2222 optional int32 connection_handle = 2;
2223 // HCI command associated with this event
2224 // Default: CMD_UNKNOWN
2225 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2226 // HCI event associated with this event
2227 // Default: EVT_UNKNOWN
2228 optional android.bluetooth.hci.EventEnum hci_event = 4;
2229 // HCI command status code if this is triggerred by hci_cmd
2230 // Default: STATUS_UNKNOWN
2231 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2232 // HCI reason code associated with this event
2233 // Default: STATUS_UNKNOWN
2234 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002235 // A status value related to this specific event
2236 // Default: 0
2237 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002238}
2239
2240/**
2241 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2242 *
2243 * Logged from:
2244 * system/bt
2245 */
2246message BluetoothSmpPairingEventReported {
2247 // An identifier that can be used to match events for this device.
2248 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2249 // Salt: Randomly generated 256 bit value
2250 // Hash algorithm: HMAC-SHA256
2251 // Size: 32 byte
2252 // Default: null or empty if the device identifier is not known
2253 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2254 // SMP command sent or received over L2CAP
2255 // Default: CMD_UNKNOWN
2256 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2257 // Whether this command is sent or received
2258 // Default: DIRECTION_UNKNOWN
2259 optional android.bluetooth.DirectionEnum direction = 3;
2260 // SMP failure reason code
2261 // Default: PAIRING_FAIL_REASON_DEFAULT
2262 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2263}
2264
2265/**
Jack He815cdba2019-01-30 17:24:55 -08002266 * Logs when a Bluetooth socket’s connection state changed
2267 *
2268 * Logged from:
2269 * system/bt
2270 */
2271message BluetoothSocketConnectionStateChanged {
2272 // An identifier that can be used to match events for this device.
2273 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2274 // Salt: Randomly generated 256 bit value
2275 // Hash algorithm: HMAC-SHA256
2276 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002277 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002278 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002279 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002280 // Default 0 when unknown or don't care
2281 optional int32 port = 2;
2282 // Socket type as mentioned in
2283 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2284 // Default: SOCKET_TYPE_UNKNOWN
2285 optional android.bluetooth.SocketTypeEnum type = 3;
2286 // Socket connection state
2287 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2288 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2289 // Number of bytes sent to remote device during this connection
2290 optional int64 tx_bytes = 5;
2291 // Number of bytes received from remote device during this connection
2292 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002293 // Socket owner's UID
2294 optional int32 uid = 7 [(is_uid) = true];
2295 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2296 // |port| must be spawned by |server_port|
2297 // Default 0 when unknown or don't care
2298 optional int32 server_port = 8;
2299 // Whether this is a server listener socket
2300 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002301}
2302
2303/**
Jack He71426802019-04-02 13:32:52 -07002304 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2305 *
2306 * Logged from:
2307 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2308 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2309 *
2310 */
2311message BluetoothClassOfDeviceReported {
2312 // An identifier that can be used to match events for this device.
2313 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2314 // Salt: Randomly generated 256 bit value
2315 // Hash algorithm: HMAC-SHA256
2316 // Size: 32 byte
2317 // Default: null or empty if this is a server listener socket
2318 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2319 // Class of Device (CoD) value including both Major, Minor device class and service class
2320 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2321 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2322 // Default: 0
2323 optional int32 class_of_device = 2;
2324}
2325
2326/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002327 * Logs when something is plugged into or removed from the USB-C connector.
2328 *
2329 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002330 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002331 */
2332message UsbConnectorStateChanged {
2333 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002334 STATE_DISCONNECTED = 0;
2335 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002336 }
2337 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002338 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002339 // Last active session in ms.
2340 // 0 when the port is in connected state.
2341 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002342}
2343
2344/**
2345 * Logs the reported speaker impedance.
2346 *
2347 * Logged from:
2348 * Vendor audio implementation.
2349 */
2350message SpeakerImpedanceReported {
2351 optional int32 speaker_location = 1;
2352 optional int32 impedance = 2;
2353}
2354
2355/**
2356 * Logs the report of a failed hardware.
2357 *
2358 * Logged from:
2359 * Vendor HALs.
2360 *
2361 */
2362message HardwareFailed {
2363 enum HardwareType {
2364 HARDWARE_FAILED_UNKNOWN = 0;
2365 HARDWARE_FAILED_MICROPHONE = 1;
2366 HARDWARE_FAILED_CODEC = 2;
2367 HARDWARE_FAILED_SPEAKER = 3;
2368 HARDWARE_FAILED_FINGERPRINT = 4;
2369 }
2370 optional HardwareType hardware_type = 1;
2371
Maggie White6dcd8572019-01-31 14:11:50 -08002372 /**
2373 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002374 * the same hardware_type. The specific locations are vendor defined integers,
2375 * referring to board-specific numbering schemes.
2376 */
2377 optional int32 hardware_location = 2;
2378
Maggie White6dcd8572019-01-31 14:11:50 -08002379 /**
2380 * failure_code is specific to the HardwareType of the failed hardware.
2381 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002382 */
Maggie White6dcd8572019-01-31 14:11:50 -08002383 enum HardwareErrorCode {
2384 UNKNOWN = 0;
2385 COMPLETE = 1;
2386 SPEAKER_HIGH_Z = 2;
2387 SPEAKER_SHORT = 3;
2388 FINGERPRINT_SENSOR_BROKEN = 4;
2389 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002390 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002391 }
2392 optional int32 failure_code = 3;
2393}
2394
2395/**
2396 * Log an event when the device has been physically dropped.
2397 * Reported from the /vendor partition.
2398 */
2399message PhysicalDropDetected {
2400 // Confidence that the event was actually a drop, 0 -> 100
2401 optional int32 confidence_pctg = 1;
2402 // Peak acceleration of the drop, in 1/1000s of a g.
2403 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002404 // Duration of freefall in ms
2405 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002406}
2407
2408/**
2409 * Log bucketed battery charge cycles.
2410 *
2411 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002412 * a given charge point. For example, if 10 cycle buckets are
2413 * initialized, bucket 1 is the lowest 1/10th of the battery,
2414 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002415 *
2416 * Logged from:
2417 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2418 */
2419message ChargeCyclesReported {
2420 optional int32 cycle_bucket_1 = 1;
2421 optional int32 cycle_bucket_2 = 2;
2422 optional int32 cycle_bucket_3 = 3;
2423 optional int32 cycle_bucket_4 = 4;
2424 optional int32 cycle_bucket_5 = 5;
2425 optional int32 cycle_bucket_6 = 6;
2426 optional int32 cycle_bucket_7 = 7;
2427 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002428 optional int32 cycle_bucket_9 = 9;
2429 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002430}
2431
2432/**
Howard Roa46b6582018-09-18 16:45:02 -07002433 * Log battery health snapshot.
2434 *
2435 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2436 * are snapshotted periodically over 24hrs.
2437 */
2438message BatteryHealthSnapshot {
2439 enum BatterySnapshotType {
2440 UNKNOWN = 0;
2441 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2442 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2443 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2444 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2445 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2446 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2447 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2448 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2449 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2450 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2451 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2452 }
2453 optional BatterySnapshotType type = 1;
2454 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002455 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002456 // Voltage Battery Voltage, in microVolts.
2457 optional int32 voltage_micro_volt = 3;
2458 // Current Battery current, in microAmps.
2459 optional int32 current_micro_amps = 4;
2460 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2461 optional int32 open_circuit_micro_volt = 5;
2462 // Resistance Battery Resistance, in microOhms.
2463 optional int32 resistance_micro_ohm = 6;
2464 // Level Battery Level, as % of full.
2465 optional int32 level_percent = 7;
2466}
2467
2468/**
2469 * Log slow I/O operations on the primary storage.
2470 */
2471message SlowIo {
2472 // Classifications of IO Operations.
2473 enum IoOperation {
2474 UNKNOWN = 0;
2475 READ = 1;
2476 WRITE = 2;
2477 UNMAP = 3;
2478 SYNC = 4;
2479 }
2480 optional IoOperation operation = 1;
2481
2482 // The number of slow IO operations of this type over 24 hours.
2483 optional int32 count = 2;
2484}
2485
2486/**
2487 * Log battery caused shutdown with the last recorded voltage.
2488 */
2489message BatteryCausedShutdown {
2490 // The last recorded battery voltage prior to shutdown.
2491 optional int32 last_recorded_micro_volt = 1;
2492}
2493
2494/**
Tej Singha72344992019-04-17 18:55:08 -07002495 * Logs when ThermalService receives throttling events.
2496 *
2497 * Logged from:
2498 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2499 */
2500message ThermalThrottlingSeverityStateChanged {
2501 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2502 optional android.os.TemperatureTypeEnum sensor_type = 1;
2503
2504 // The name of the temperature source. Eg. CPU0
2505 optional string sensor_name = 2;
2506
2507 // Temperature in tenths of a degree C.
2508 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2509 optional int32 temperature_deci_celsius = 3;
2510
2511 // Relative severity of the throttling, see enum definition.
2512 optional android.os.ThrottlingSeverityEnum severity = 4;
2513}
2514
2515/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002516 * Logs the duration of a davey (jank of >=700ms) when it occurs
2517 *
2518 * Logged from:
2519 * frameworks/base/libs/hwui/JankTracker.cpp
2520 */
2521message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002522 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002523 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002524
Tej Singhbb8554a2018-01-26 11:59:14 -08002525 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002526 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002527}
2528
2529/**
Bookatze5885242017-10-24 20:10:31 -07002530 * Logs phone signal strength changes.
2531 *
2532 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002533 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002534 */
2535message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002536 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2537 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002538}
2539
Yangster4ccebea2018-10-09 17:09:02 -07002540
2541/**
2542 * Logs when the phone state, sim state or signal strength changes
2543 *
2544 * Logged from:
2545 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2546 */
2547message PhoneServiceStateChanged {
2548 optional android.telephony.ServiceStateEnum state = 1;
2549 optional android.telephony.SimStateEnum sim_state = 2;
2550 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2551}
2552
2553/**
2554 * Logs when the phone becomes on or off.
2555 *
2556 * Logged from:
2557 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2558 */
2559message PhoneStateChanged {
2560 enum State {
2561 OFF = 0;
2562 ON = 1;
2563 }
2564 optional State state = 1;
2565}
2566
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002567message BackGesture {
2568 enum BackType {
2569 DEFAULT_BACK_TYPE = 0;
2570 COMPLETED = 1;
2571 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2572 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2573 INCOMPLETE = 4;
2574 }
2575 optional BackType type = 1;
2576
2577 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2578 enum WindowHorizontalLocation {
2579 DEFAULT_LOCATION = 0;
2580 LEFT = 1;
2581 RIGHT = 2;
2582 }
2583 optional WindowHorizontalLocation x_location = 3;
2584}
2585
2586message ExclusionRectStateChanged {
2587 optional string component_name = 1; // if not available, simply packageName
2588 optional int32 requested_height = 2; // px
2589 optional int32 rejected_height = 3; // px
2590
2591 enum WindowHorizontalLocation {
2592 DEFAULT_LOCATION = 0;
2593 LEFT = 1;
2594 RIGHT = 2;
2595 }
2596 optional WindowHorizontalLocation x_location = 4;
2597 optional bool landscape = 5;
2598 optional bool splitscreen = 6;
2599 optional int32 duration_millis = 7;
2600}
2601
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002602message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002603 optional android.stats.launcher.LauncherAction action = 1;
2604 optional android.stats.launcher.LauncherState src_state = 2;
2605 optional android.stats.launcher.LauncherState dst_state = 3;
2606 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002607 optional bool is_swipe_up_enabled = 5;
2608}
2609
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002610message StyleUIChanged {
2611 optional android.stats.style.Action action = 1;
2612 optional int32 color_package_hash = 2;
2613 optional int32 font_package_hash = 3;
2614 optional int32 shape_package_hash = 4;
2615 optional int32 clock_package_hash = 5;
2616 optional int32 launcher_grid = 6;
2617 optional int32 wallpaper_category_hash = 7;
2618 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002619 optional int32 color_preference = 9;
2620 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002621}
2622
David Chenc28b2bb2017-10-24 12:52:52 -07002623/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002624 * Logs when Settings UI has changed.
2625 *
2626 * Logged from:
2627 * packages/apps/Settings
2628 */
2629message SettingsUIChanged {
2630 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002631 * Where this SettingsUIChange event comes from. For example, if
2632 * it's a PAGE_VISIBLE event, where the page is opened from.
2633 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002634 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002635
2636 /**
2637 * What the UI action is.
2638 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002639 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002640
2641 /**
2642 * Where the action is happening
2643 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002644 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002645
2646 /**
2647 * What preference changed in this event.
2648 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002649 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002650
2651 /**
2652 * The new value of the changed preference.
2653 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002654 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002655}
2656
2657/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002658 * Logs basic timing information about touch events.
2659 * Reported at most every 5 minutes while device is being interacted with.
2660 *
2661 * Logged from:
2662 * frameworks/native/services/inputflinger
2663 */
2664message TouchEventReported {
2665 /**
2666 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002667 * and the standard deviation of the time spent processing touchscreen events
2668 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002669 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002670 * On supported devices, the starting point is taken during the hard interrupt inside the
2671 * kernel touch driver. On all other devices, the starting point is taken inside
2672 * the kernel's input event subsystem upon receipt of the input event.
2673 * The ending point is taken inside InputDispatcher, just after the input event
2674 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002675 */
2676 // Minimum value
2677 optional float latency_min_micros = 1;
2678 // Maximum value
2679 optional float latency_max_micros = 2;
2680 // Average value
2681 optional float latency_mean_micros = 3;
2682 // Standard deviation
2683 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002684 // Number of touch events (input_event) in this report
2685 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002686}
2687
2688/**
Philip Quinn0eded622019-01-29 12:46:28 -08002689 * Logs gesture classification and timing information for touch events.
2690 *
2691 * Logged from:
2692 * frameworks/base/core/java/android/view/GestureDetector.java
2693 * frameworks/base/core/java/android/view/View.java
2694 */
2695message TouchGestureClassified {
2696 // The source of the classification (e.g. Java class name).
2697 optional string source = 1;
2698
2699 enum Classification {
2700 UNKNOWN_CLASSIFICATION = 0;
2701 SINGLE_TAP = 1;
2702 DOUBLE_TAP = 2;
2703 LONG_PRESS = 3;
2704 DEEP_PRESS = 4;
2705 SCROLL = 5;
2706 }
2707 // The classification of the gesture.
2708 optional Classification classification = 2;
2709
2710 // The interval from the start of a touch event stream until the
2711 // classification was made.
2712 optional int32 latency_millis = 3;
2713
2714 // The distance from the location of the first touch event to the
2715 // location of the touch event when the classification was made.
2716 optional float displacement_px = 4;
2717}
2718
2719/**
David Chenc28b2bb2017-10-24 12:52:52 -07002720 * Logs that a setting was updated.
2721 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002722 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002723 * The tag and is_default allow resetting of settings to default values based on the specified
2724 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2725 */
2726message SettingChanged {
2727 // The name of the setting.
2728 optional string setting = 1;
2729
2730 // The change being imposed on this setting. May represent a number, eg "3".
2731 optional string value = 2;
2732
2733 // The new value of this setting. For most settings, this is same as value. For some settings,
2734 // value is +X or -X where X represents an element in a set. For example, if the previous value
2735 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2736 // The +/- feature is currently only used for location_providers_allowed.
2737 optional string new_value = 3;
2738
2739 // The previous value of this setting.
2740 optional string prev_value = 4;
2741
2742 // The tag used with the is_default for resetting sets of settings. This is generally null.
2743 optional string tag = 5;
2744
Bookatz90867622018-01-31 15:05:57 -08002745 // True if this setting with tag should be resettable.
2746 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002747
David Chenbd789912018-03-16 17:19:55 -07002748 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002749 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002750
2751 enum ChangeReason {
2752 UPDATED = 1; // Updated can be an insertion or an update.
2753 DELETED = 2;
2754 }
2755 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002756}
Chenjie Yub3dda412017-10-24 13:41:59 -07002757
Chenjie Yu05013b32017-11-21 10:21:41 -08002758/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002759 * Logs activity going to foreground or background
2760 *
2761 * Logged from:
2762 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2763 */
2764message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002765 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002766 optional string pkg_name = 2;
2767 optional string class_name = 3;
2768
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002769 enum State {
2770 BACKGROUND = 0;
2771 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002772 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002773 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002774}
David Chenc8a43242017-10-17 16:23:28 -07002775
2776/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002777 * Logs when a volume entered low Storage state.
2778 * Logged from:
2779 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2780 */
2781message LowStorageStateChanged {
2782 // Volume that ran out of storage.
2783 optional string volume_description = 1;
2784
2785 enum State {
2786 UNKNOWN = 0;
2787 OFF = 1;
2788 ON = 2;
2789 }
2790 optional State state = 2;
2791}
2792
2793/**
2794 * Logs when an app is downgraded.
2795 * Logged from:
2796 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2797 */
2798message AppDowngraded {
2799 optional string package_name = 1;
2800 // Size of the package (all data) before being downgraded.
2801 optional int64 size_in_bytes_before = 2;
2802 // Size of the package (all data) after being downgraded.
2803 optional int64 size_in_bytes_after = 3;
2804
2805 optional bool aggressive = 4;
2806}
2807
2808/**
2809 * Logs when an app is optimized after being downgraded.
2810 * Logged from:
2811 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2812 */
2813message AppOptimizedAfterDowngraded {
2814 optional string package_name = 1;
2815}
2816
2817/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002818 * Logs whenever an app is installed on external storage.
2819 * Logged from:
2820 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2821 */
2822message AppInstallOnExternalStorageReported {
2823 // The type of external storage.
2824 optional android.stats.storage.ExternalStorageType storage_type = 1;
2825 // The name of the package that is installed on the sd card.
2826 optional string package_name = 2;
2827}
2828
2829/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002830 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002831 * Logged from:
2832 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2833 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002834message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002835 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002836
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002837 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002838
2839 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002840 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002841 optional string process_name = 3;
2842
2843 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002844 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002845
2846 optional string package_name = 5;
2847
2848 enum InstantApp {
2849 UNAVAILABLE = 0;
2850 FALSE = 1;
2851 TRUE = 2;
2852 }
2853 optional InstantApp is_instant_app = 6;
2854
2855 enum ForegroundState {
2856 UNKNOWN = 0;
2857 BACKGROUND = 1;
2858 FOREGROUND = 2;
2859 }
2860 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002861
2862 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002863}
David Chen9e3808c2017-11-20 17:25:34 -08002864
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002865/**
2866 * Logs when a WTF (What a Terrible Failure) happened.
2867 * Logged from:
2868 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2869 */
2870message WTFOccurred {
2871 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002872
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002873 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002874
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002875 // The name of the process.
2876 // system_server if it is not by an app
2877 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002878
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002879 // The pid if available. -1 means not available.
2880 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002881
2882 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002883}
2884
2885/**
2886 * Logs when system server reports low memory.
2887 * Logged from:
2888 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2889 */
2890message LowMemReported {
2891}
2892
2893/**
2894 * Logs when an app ANR (App Not Responding) occurs.
2895 * Logged from:
2896 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2897 */
2898message ANROccurred {
2899 optional int32 uid = 1 [(is_uid) = true];
2900
2901 optional string process_name = 2;
2902
2903 optional string short_component_name = 3;
2904
2905 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002906
2907 enum InstantApp {
2908 UNAVAILABLE = 0;
2909 FALSE = 1;
2910 TRUE = 2;
2911 }
2912 optional InstantApp is_instant_app = 5;
2913
2914 enum ForegroundState {
2915 UNKNOWN = 0;
2916 BACKGROUND = 1;
2917 FOREGROUND = 2;
2918 }
2919 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002920
2921 optional android.server.ErrorSource error_source = 7;
2922
2923 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002924}
2925
Bookatza7020bd2018-08-28 16:29:35 -07002926/**
2927 * Logs when the vibrator state changes.
2928 * Logged from:
2929 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2930 */
2931message VibratorStateChanged {
2932 repeated AttributionNode attribution_node = 1;
2933
2934 enum State {
2935 OFF = 0;
2936 ON = 1;
2937 }
2938 optional State state = 2;
2939
2940 // Duration (in milliseconds) requested to keep the vibrator on.
2941 // Only applicable for State == ON.
2942 optional int64 duration_millis = 3;
2943}
2944
David Chen0a368b22017-12-06 16:28:16 -08002945/*
2946 * Allows other apps to push events into statsd.
2947 * Logged from:
2948 * frameworks/base/core/java/android/util/StatsLog.java
2949 */
David Chen0b5c90c2018-01-25 16:51:49 -08002950message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002951 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002952 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002953
2954 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2955 optional int32 label = 2;
2956
2957 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2958 // predicates for the metrics).
2959 enum State {
2960 UNKNOWN = 0;
2961 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2962 STOP = 2;
2963 START = 3;
2964 }
2965 optional State state = 3;
2966}
2967
David Chen9e3808c2017-11-20 17:25:34 -08002968/**
Bookatz7948c872018-09-04 12:58:33 -07002969 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2970 * For example, this could be due to the user manually changing the time.
2971 *
2972 * Logged from:
2973 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2974 */
2975message WallClockTimeShifted {
2976 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2977 optional int64 wall_clock_timestamp_millis = 1;
2978}
2979
2980/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002981 * Logs when statsd detects an anomaly.
2982 *
2983 * Logged from:
2984 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2985 */
2986message AnomalyDetected {
2987 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002988 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002989
Yangster-mac94e197c2018-01-02 16:03:03 -08002990 // Id of the config whose anomaly detection alert fired.
2991 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002992
Yangster-mac94e197c2018-01-02 16:03:03 -08002993 // Id of the alert (i.e. name of the anomaly that was detected).
2994 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002995}
2996
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002997message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002998 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002999 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003000
3001 // The app package name.
3002 optional string pkg_name = 2;
3003
3004 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003005 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003006 WARM = 1;
3007 HOT = 2;
3008 COLD = 3;
3009 }
3010 // The transition type.
3011 optional TransitionType type = 3;
3012
3013 // The activity name.
3014 optional string activity_name = 4;
3015
3016 // The name of the calling app. Empty if not set.
3017 optional string calling_pkg_name = 5;
3018
3019 // Whether the app is an instant app.
3020 optional bool is_instant_app = 6;
3021
3022 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003023 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003024
Bookatz80d11a02018-01-16 10:46:35 -08003025 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003026
David Chen0b5c90c2018-01-25 16:51:49 -08003027 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003028 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003029 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003030 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003031 optional int32 bind_application_delay_millis = 11;
3032 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003033
3034 // Empty if not set.
3035 optional string launch_token = 13;
3036
Calin Juravle759fbda2018-02-20 19:52:30 +00003037 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003038 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003039
3040 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003041 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003042}
3043
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003044message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003045 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003046 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003047
3048 // The app package name.
3049 optional string pkg_name = 2;
3050
3051 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003052 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003053 WARM = 1;
3054 HOT = 2;
3055 COLD = 3;
3056 }
3057 // The transition type.
3058 optional TransitionType type = 3;
3059
3060 // The activity name.
3061 optional string activity_name = 4;
3062}
3063
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003064message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003065 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003066 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003067
3068 // The app package name.
3069 optional string pkg_name = 2;
3070
3071 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003072 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003073 WITH_BUNDLE = 1;
3074 WITHOUT_BUNDLE = 2;
3075 }
3076 // The transition type.
3077 optional TransitionType type = 3;
3078
3079 // The activity name.
3080 optional string activity_name = 4;
3081
3082 optional bool transition_process_running = 5;
3083
3084 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003085 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003086}
3087
Bookatz8fcd09a2017-12-18 13:01:10 -08003088/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003089 * Logs a picture-in-picture action
3090 * Logged from:
3091 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3092 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3093 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3094 */
3095message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003096 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003097 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003098
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003099 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003100
Chenjie Yu52cacc62017-12-08 18:11:45 -08003101 enum State {
3102 ENTERED = 1;
3103 EXPANDED_TO_FULL_SCREEN = 2;
3104 MINIMIZED = 3;
3105 DISMISSED = 4;
3106 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003107 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003108}
3109
3110/**
Chenjie Yue8904192017-12-08 19:12:57 -08003111 * Logs overlay action
3112 * Logged from:
3113 * services/core/java/com/android/server/wm/Session.java
3114 */
3115message OverlayStateChanged {
tsaichristine10978642019-09-10 14:12:49 -07003116 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003117
tsaichristine10978642019-09-10 14:12:49 -07003118 optional string package_name = 2 [(state_field_option).option = PRIMARY];
Chenjie Yue8904192017-12-08 19:12:57 -08003119
3120 optional bool using_alert_window = 3;
3121
3122 enum State {
3123 ENTERED = 1;
3124 EXITED = 2;
3125 }
tsaichristine10978642019-09-10 14:12:49 -07003126 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Chenjie Yue8904192017-12-08 19:12:57 -08003127}
3128
Chenjie Yuccfe6452018-01-30 11:33:21 -08003129/*
3130 * Logs foreground service starts and stops.
3131 * Note that this is not when a service starts or stops, but when it is
3132 * considered foreground.
3133 * Logged from
3134 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3135 */
3136message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003137 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003138 // package_name + "/" + class_name
3139 optional string short_name = 2;
3140
3141 enum State {
3142 ENTER = 1;
3143 EXIT = 2;
3144 }
3145 optional State state = 3;
3146}
3147
Chenjie Yue8904192017-12-08 19:12:57 -08003148/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003149 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3150 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3151 * attributed back to the parent (host) uid. One example is Chrome.
3152 *
3153 * Logged from:
3154 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3155 */
3156message IsolatedUidChanged {
3157 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003158 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003159 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003160 optional int32 parent_uid = 1;
3161
3162 optional int32 isolated_uid = 2;
3163
3164 // We expect an isolated uid to be removed before if it's used for another parent uid.
3165 enum Event {
3166 REMOVED = 0;
3167 CREATED = 1;
3168 }
3169 optional Event event = 3;
3170}
3171
3172/*
3173 * Logs the reception of an incoming network packet causing the main system to wake up for
3174 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3175 * and processed by WakeupController.cpp.
3176 */
3177message PacketWakeupOccurred {
3178 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3179 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003180 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003181 // The interface name on which the packet was received.
3182 optional string iface = 2;
3183 // The ethertype value of the packet.
3184 optional int32 ethertype = 3;
3185 // String representation of the destination MAC address of the packet.
3186 optional string destination_hardware_address = 4;
3187 // String representation of the source address of the packet if this was an IP packet.
3188 optional string source_ip = 5;
3189 // String representation of the destination address of the packet if this was an IP packet.
3190 optional string destination_ip = 6;
3191 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3192 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3193 // families.
3194 optional int32 ip_next_header = 7;
3195 // The source port if this was a TCP or UDP packet.
3196 optional int32 source_port = 8;
3197 // The destination port if this was a TCP or UDP packet.
3198 optional int32 destination_port = 9;
3199}
3200
3201/*
3202 * Logs the memory stats for an app on startup.
3203 * Logged from:
3204 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3205 */
3206message AppStartMemoryStateCaptured {
3207 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003208 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003209
3210 // The process name.
3211 optional string process_name = 2;
3212
3213 // The activity name.
3214 optional string activity_name = 3;
3215
3216 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003217 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003218
3219 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003220 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003221
3222 // RSS
3223 optional int64 rss_in_bytes = 6;
3224
3225 // CACHE
3226 optional int64 cache_in_bytes = 7;
3227
3228 // SWAP
3229 optional int64 swap_in_bytes = 8;
3230}
3231
3232/*
3233 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3234 * for LMK event.
3235 * Logged from:
3236 * system/core/lmkd/lmkd.c
3237 */
3238message LmkStateChanged {
3239 enum State {
3240 UNKNOWN = 0;
3241 START = 1;
3242 STOP = 2;
3243 }
3244 optional State state = 1;
3245}
3246
3247/*
3248 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3249 * Logged from:
3250 * system/core/lmkd/lmkd.c
3251 */
3252message LmkKillOccurred {
3253 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003254 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003255
3256 // The process name.
3257 optional string process_name = 2;
3258
3259 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003260 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003261
3262 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003263 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003264
3265 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003266 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003267
3268 // RSS
3269 optional int64 rss_in_bytes = 6;
3270
3271 // CACHE
3272 optional int64 cache_in_bytes = 7;
3273
3274 // SWAP
3275 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003276
3277 // The elapsed real time of start of the process.
3278 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003279
3280 // Min oom adj score considered by lmkd.
3281 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003282}
3283
Rajeev Kumar51b54602018-03-01 12:18:26 -08003284/*
3285 * Logs when the ActivityManagerService detects that an app died.
3286 *
3287 * Logged from:
3288 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3289 */
3290message AppDied {
3291 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003292 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003293}
3294
Howard Ro21a039c2018-08-06 14:55:47 -07003295/**
3296 * An atom for generic metrics logging. Available from Android Q.
3297 */
3298message GenericAtom {
3299 // The uid of the application that sent this custom atom.
3300 optional int32 uid = 1 [(is_uid) = true];
3301
3302 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003303 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003304}
3305
Tej Singhd6d6d772018-09-05 17:41:25 -07003306/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003307 * Atom for simple logging of user interaction and impression events, such as "the user touched
3308 * this button" or "this dialog was displayed".
3309 * Keep the UI event stream clean: don't use for system or background events.
3310 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
3311 */
3312message UiEventReported {
3313 // The event_id.
3314 optional int32 event_id = 1;
3315 // The event's source or target uid and package, if applicable.
3316 // For example, the package posting a notification, or the destination package of a share.
3317 optional int32 uid = 2 [(is_uid) = true];
3318 optional string package_name = 3;
3319}
3320
3321/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003322 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003323 *
3324 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003325 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003326 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003327message BiometricAcquired {
3328 // Biometric modality that was acquired.
3329 optional android.hardware.biometrics.ModalityEnum modality = 1;
3330 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3331 optional int32 user = 2;
3332 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3333 optional bool is_crypto = 3;
3334 // Action that the device is performing. Acquired messages are only expected for enroll and
3335 // authenticate. Other actions may indicate an error.
3336 optional android.hardware.biometrics.ActionEnum action = 4;
3337 // The client that this acquisition was received for.
3338 optional android.hardware.biometrics.ClientEnum client = 5;
3339 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3340 optional int32 acquire_info = 6;
3341 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3342 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003343 // Dictates if this message should trigger additional debugging.
3344 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003345}
3346
3347/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003348 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003349 *
3350 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003351 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003352 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003353message BiometricAuthenticated {
3354 // Biometric modality that was used.
3355 optional android.hardware.biometrics.ModalityEnum modality = 1;
3356 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3357 optional int32 user = 2;
3358 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3359 // storage.
3360 optional bool is_crypto = 3;
3361 // The client that this acquisition was received for.
3362 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003363 // If authentication requires user confirmation. See BiometricPrompt's
3364 // setRequireConfirmation(bool) method.
3365 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003366
Kevin Chyn1741a072019-01-17 11:54:40 -08003367 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003368 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003369 REJECTED = 1;
3370 PENDING_CONFIRMATION = 2;
3371 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003372 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003373
3374 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003375 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003376 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3377 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3378 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3379 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003380 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003381 // Dictates if this message should trigger additional debugging.
3382 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003383}
3384
3385/**
3386 * Logs when a biometric error occurs.
3387 *
3388 * Logged from:
3389 * frameworks/base/services/core/java/com/android/server/biometrics
3390 */
3391message BiometricErrorOccurred {
3392 // Biometric modality that was used.
3393 optional android.hardware.biometrics.ModalityEnum modality = 1;
3394 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3395 optional int32 user = 2;
3396 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3397 optional bool is_crypto = 3;
3398 // Action that the device is performing.
3399 optional android.hardware.biometrics.ActionEnum action = 4;
3400 // The client that this acquisition was received for.
3401 optional android.hardware.biometrics.ClientEnum client = 5;
3402 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3403 // are unique to modality.
3404 optional int32 error_info = 6;
3405 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3406 // by the vendor and not specified by the HIDL interface.
3407 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003408 // Dictates if this message should trigger additional debugging.
3409 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003410 // Time spent during the authentication attempt.
3411 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003412}
3413
3414/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003415 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003416 * Logged from:
3417 * frameworks/base/services/core/java/com/android/server/biometrics
3418 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003419message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003420 // Biometric modality.
3421 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003422 // Type of issue detected.
3423 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003424 // Dictates if this message should trigger additional debugging.
3425 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003426}
Howard Ro688ae182018-09-25 00:09:36 -07003427
joshmccloskey6f952b22019-03-25 20:59:35 -07003428/**
3429 * Logs when a biometric enrollment occurs.
3430 *
3431 * Logged from:
3432 * frameworks/base/services/core/java/com/android/server/biometrics
3433 */
3434message BiometricEnrolled {
3435 // Biometric modality that was used.
3436 optional android.hardware.biometrics.ModalityEnum modality = 1;
3437 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3438 optional int32 user = 2;
3439 // The amount of time the enrollment took in milliseconds.
3440 optional int64 latency_millis = 3;
3441 // Whether or not the enrollment was successful.
3442 optional bool success = 4;
3443}
3444
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003445/*
Tej Singh0d176952019-01-16 19:10:54 -08003446 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003447 */
Tej Singh0d176952019-01-16 19:10:54 -08003448message FlagFlipUpdateOccurred {
3449 // If the event is from a flag config package, specify the package name.
3450 optional string flag_flip_package_name = 1;
3451
3452 // The order id of the package
3453 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003454}
3455
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003456/**
3457 * Potential experiment ids that goes with a train install.
3458 */
3459message TrainExperimentIds {
3460 repeated int64 experiment_id = 1;
3461}
3462
Yangster-macb89807e2018-11-15 21:10:57 -08003463/*
3464 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003465 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003466 */
3467message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003468 // Name of the train.
3469 optional string train_name = 1;
3470 // Version code for a "train" of packages that need to be installed atomically
3471 optional int64 train_version_code = 2;
3472 // After installation of this package, device requires a restart.
3473 optional bool requires_staging = 3;
3474 // Rollback should be enabled for this install.
3475 optional bool rollback_enabled = 4;
3476 // Requires low latency monitoring if possible.
3477 optional bool requires_low_latency_monitor = 5;
3478
Yangster-macb89807e2018-11-15 21:10:57 -08003479 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003480 UNKNOWN = 0;
3481 INSTALL_REQUESTED = 1;
3482 INSTALL_STARTED = 2;
3483 INSTALL_STAGED_NOT_READY = 3;
3484 INSTALL_STAGED_READY = 4;
3485 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003486 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3487 // and INSTALL_FAILURE_COMMIT.
3488 INSTALL_FAILURE = 6 [deprecated = true];
3489 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003490 INSTALL_CANCELLED = 7;
3491 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003492 INSTALLER_ROLLBACK_INITIATED = 9;
3493 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3494 INSTALLER_ROLLBACK_STAGED = 11;
3495 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3496 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3497 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3498 INSTALLER_ROLLBACK_SUCCESS = 15;
3499 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003500 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3501 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3502 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3503 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3504 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3505 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003506 INSTALL_FAILURE_DOWNLOAD = 23;
3507 INSTALL_FAILURE_STATE_MISMATCH = 24;
3508 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003509 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003510 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003511 // Possible experiment ids for monitoring this push.
3512 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3513 // user id
3514 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003515}
3516
Tej Singhc9203082019-05-03 13:42:23 -07003517/* Test atom, is not logged anywhere */
3518message TestAtomReported {
3519 repeated AttributionNode attribution_node = 1;
3520 optional int32 int_field = 2;
3521 optional int64 long_field = 3;
3522 optional float float_field = 4;
3523 optional string string_field = 5;
3524 optional bool boolean_field = 6;
3525 enum State {
3526 UNKNOWN = 0;
3527 OFF = 1;
3528 ON = 2;
3529 }
3530 optional State state = 7;
3531 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3532}
3533
Maggie Whitefc1aa592018-11-28 21:55:23 -08003534/** Represents USB port overheat event. */
3535message UsbPortOverheatEvent {
3536 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3537 optional int32 plug_temperature_deci_c = 1;
3538
3539 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3540 optional int32 max_temperature_deci_c = 2;
3541
3542 /* Time between USB plug event and overheat threshold trip, in seconds. */
3543 optional int32 time_to_overheat_secs = 3;
3544
3545 /* Time between overheat threshold trip and hysteresis, in seconds. */
3546 optional int32 time_to_hysteresis_secs = 4;
3547
3548 /* Time between hysteresis and active mitigation ending, in seconds. */
3549 optional int32 time_to_inactive_secs = 5;
3550};
3551
Maggie White8735b852019-01-18 11:40:49 -08003552/**
3553 * Logs total effective full charge and discharge cycles on a battery.
3554 * Here are some examples of one effective cycle:
3555 * 1) the battery charges from 0% to 100% and drains back to 0%,
3556 * 2) charging from 50% to 100% and draining back to 50% twice.
3557 * Pulled from:
3558 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3559 */
3560message BatteryCycleCount {
3561 /* Number of total charge and discharge cycles on the system battery. */
3562 optional int32 cycle_count = 1;
3563}
3564
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003565/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003566 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3567 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003568 * Pulled from:
3569 * StatsCompanionService
3570 */
3571
Carmen Agimof12dec122019-03-06 16:14:38 +00003572message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003573
Carmen Agimof12dec122019-03-06 16:14:38 +00003574 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003575 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003576 PUBLIC = 1;
3577 PRIVATE = 2;
3578 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003579 }
3580
Carmen Agimof12dec122019-03-06 16:14:38 +00003581 // The type of external storage.
3582 optional android.stats.storage.ExternalStorageType storage_type = 1;
3583 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3584 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003585 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003586 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003587}
3588
Yangster-macb89807e2018-11-15 21:10:57 -08003589/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003590 * Logs when a connection becomes available and lost.
3591 * Logged in StatsCompanionService.java
3592 */
3593message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003594 // Id of the network.
3595 optional int32 net_id = 1;
3596
3597 enum State {
3598 UNKNOWN = 0;
3599 CONNECTED = 1;
3600 DISCONNECTED = 2;
3601 }
3602 // Connected state of a network.
3603 optional State state = 2;
3604}
3605
3606/**
3607 * Logs when a service starts and stops.
3608 * Logged from:
3609 * services/core/java/com/android/server/am/ActiveServices.java
3610 */
3611message ServiceStateChanged {
3612
3613 optional int32 uid = 1 [(is_uid) = true];
3614
3615 optional string package_name = 2;
3616
3617 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003618
3619 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003620 START = 1;
3621 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003622 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003623
3624 optional State state = 4;
3625}
3626
3627/**
3628 * Logs when a service is launched.
3629 * Logged from:
3630 * services/core/java/com/android/server/am/ActiveServices.java
3631 */
3632message ServiceLaunchReported {
3633
3634 optional int32 uid = 1 [(is_uid) = true];
3635
3636 optional string package_name = 2;
3637
3638 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003639}
Howard Ro688ae182018-09-25 00:09:36 -07003640
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003641/**
3642 * Logs when a hidden API is used.
3643 *
3644 * Logged from:
3645 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3646 */
3647message HiddenApiUsed {
3648 // The uid of the app making the hidden access.
3649 optional int32 uid = 1 [(is_uid) = true];
3650
3651 // Signature of the method or field accessed.
3652 optional string signature = 2;
3653
3654 enum AccessMethod {
3655 NONE = 0;
3656 REFLECTION = 1;
3657 JNI = 2;
3658 LINKING = 3;
3659 }
3660
3661 // Type of access.
3662 optional AccessMethod access_method = 3;
3663
3664 // Whether the access was prevented or not.
3665 optional bool access_denied = 4;
3666}
3667
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003668/**
3669 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3670 * - When user sees privacy chip
3671 * - When user clicks privacy chip
3672 * - How does the user exit the Privacy Dialog
3673 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003674 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3675 */
3676message PrivacyIndicatorsInteracted {
3677
3678 enum Type {
3679 UNKNOWN = 0;
3680 CHIP_VIEWED = 1;
3681 CHIP_CLICKED = 2;
3682 DIALOG_PRIVACY_SETTINGS = 3;
3683 DIALOG_DISMISS = 4;
3684 DIALOG_LINE_ITEM = 5;
3685 }
3686
3687 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3688
3689 // Used if the type is LINE_ITEM
3690 optional string package_name = 2;
3691}
3692
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003693/**
3694 * Logs information about a package that is moved from the internal to external storage and vice
3695 * versa.
3696 * It logs the package name, the type of the external storage where the package is installed
3697 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3698 * and the move type: if it's from internal to external or the other way around.
3699 *
3700 * Logged from:
3701 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3702 */
3703message AppMovedStorageReported {
3704 enum MoveType {
3705 UNKNOWN = 0;
3706 TO_EXTERNAL = 1;
3707 TO_INTERNAL = 2;
3708 }
3709 // The type of the external storage.
3710 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3711 // The type of move.
3712 optional MoveType move_type = 2;
3713 // The name of the package that was moved.
3714 optional string package_name = 3;
3715}
3716
jianjin8f2dee02019-03-29 14:03:08 -07003717/**
3718 * Logs when system server watchdog occurs.
3719 * Logged from:
3720 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3721 */
3722message SystemServerWatchdogOccurred {
3723 optional string subject = 1;
3724}
3725
3726/**
3727 * Logs when new file added to tombstones.
3728 * Logged from:
3729 * frameworks/base/core/java/com/android/server/BootReceiver.java
3730 */
3731message TombStoneOccurred {
3732}
3733
Hai Zhang5d3328d2019-04-13 21:25:06 +08003734/*
3735 * Information about a role request
3736 *
3737 * Logged from:
3738 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3739 */
3740message RoleRequestResultReported {
3741 // UID of application requesting the role
3742 optional int32 requesting_uid = 1;
3743
3744 // Package name of application requesting the role
3745 optional string requesting_package_name = 2;
3746
3747 // The role to be granted
3748 optional string role_name = 3;
3749
3750 // The count of applications qualifying for the role
3751 optional int32 qualifying_count = 4;
3752
3753 // UID of application current granted the role
3754 optional int32 current_uid = 5;
3755
3756 // Package name of application current granted the role
3757 optional string current_package_name = 6;
3758
3759 // UID of another application that user chose to grant the role to, instead of the requesting
3760 // application
3761 optional int32 granted_another_uid = 7;
3762
3763 // Package name of another application that user chose to grant the role to, instead of the
3764 // requesting application
3765 optional string granted_another_package_name = 8;
3766
3767 enum Result {
3768 UNDEFINED = 0;
3769 // role request was ignored
3770 IGNORED = 1;
3771 // role request was ignored because it's already granted
3772 IGNORED_ALREADY_GRANTED = 2;
3773 // role request was ignored because the application isn't qualified
3774 IGNORED_NOT_QUALIFIED = 3;
3775 // role request was ignored because user said it should be always denied
3776 IGNORED_USER_ALWAYS_DENIED = 4;
3777 // role was granted by user action
3778 USER_GRANTED = 5;
3779 // role was denied by user action
3780 USER_DENIED = 6;
3781 // role was denied by user granting another application the role
3782 USER_DENIED_GRANTED_ANOTHER = 7;
3783 // role was denied and set to be always denied by the user
3784 USER_DENIED_WITH_ALWAYS = 8;
3785 }
3786 // The result of the role request
3787 optional Result result = 9;
3788}
3789
Mark Tabrya824a642019-11-05 12:26:12 -08003790/**
3791 * Logs when a Vehicle Maps Service client's connection state has changed
3792 *
3793 * Logged from:
3794 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
3795 */
3796message VmsClientConnectionStateChanged {
3797 // The UID of the VMS client app
3798 optional int32 uid = 1 [(is_uid) = true];
3799
3800 enum State {
3801 UNKNOWN = 0;
3802 // Attempting to connect to the client
3803 CONNECTING = 1;
3804 // Client connection established
3805 CONNECTED = 2;
3806 // Client connection closed unexpectedly
3807 DISCONNECTED = 3;
3808 // Client connection closed by VMS
3809 TERMINATED = 4;
3810 // Error establishing the client connection
3811 CONNECTION_ERROR = 5;
3812 }
3813
3814 optional State state = 2;
3815}
3816
Jeff Sharkey6bd21572019-11-15 20:45:33 -07003817/**
3818 * Logs when MediaProvider has successfully finished scanning a storage volume.
3819 *
3820 * Logged from:
3821 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
3822 */
3823message MediaProviderScanEvent {
3824 enum Reason {
3825 // Scan triggered due to unknown reason
3826 UNKNOWN = 0;
3827 // Scan triggered due to storage volume being mounted
3828 MOUNTED = 1;
3829 // Scan triggered due to explicit user action or app request
3830 DEMAND = 2;
3831 // Scan triggered due to idle maintenance
3832 IDLE = 3;
3833 }
3834
3835 // Volume type that this event pertains to
3836 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3837 // Reason why this scan was triggered
3838 optional Reason reason = 2;
3839 // Total number of files scanned
3840 optional int64 item_count = 3;
3841 // Duration of scan, normalized per file
3842 optional float normalized_duration_millis = 4;
3843 // Number of database inserts, normalized per file
3844 optional float normalized_insert_count = 5;
3845 // Number of database updates, normalized per file
3846 optional float normalized_update_count = 6;
3847 // Number of database deletes, normalized per file
3848 optional float normalized_delete_count = 7;
3849}
3850
3851/**
3852 * Logs when an app has asked MediaProvider to delete media belonging to the user.
3853 *
3854 * Logged from:
3855 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
3856 */
3857message MediaProviderDeletionEvent {
3858 // Volume type that this event pertains to
3859 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3860 // Device timestamp when this deletion event occurred
3861 optional int64 timestamp_millis = 2;
3862 // App that requested deletion
3863 optional string package_name = 3;
3864 // Number of items that were deleted
3865 optional int32 item_count = 4;
3866}
3867
3868/**
3869 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
3870 *
3871 * Logged from:
3872 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
3873 */
3874message MediaProviderPermissionEvent {
3875 enum Result {
3876 UNKNOWN = 0;
3877 USER_GRANTED = 1;
3878 AUTO_GRANTED = 2;
3879 USER_DENIED = 3;
3880 USER_DENIED_WITH_PREJUDICE = 4;
3881 AUTO_DENIED = 5;
3882 }
3883
3884 // Volume type that this event pertains to
3885 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3886 // Device timestamp when this permission event occurred
3887 optional int64 timestamp_millis = 2;
3888 // App that requested permission
3889 optional string package_name = 3;
3890 // Number of items that were requested
3891 optional int32 item_count = 4;
3892 // Result of this request
3893 optional Result result = 5;
3894}
3895
3896/**
3897 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
3898 *
3899 * Logged from:
3900 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
3901 */
3902message MediaProviderSchemaChange {
3903 // Volume type that this event pertains to
3904 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3905 // Old database version code
3906 optional int32 version_from = 2;
3907 // New database version code
3908 optional int32 version_to = 3;
3909 // Total number of files in database
3910 optional int64 item_count = 4;
3911 // Duration of schema change, normalized per file
3912 optional float normalized_duration_millis = 5;
3913}
3914
3915/**
3916 * Logs when MediaProvider has finished an idle maintenance job.
3917 *
3918 * Logged from:
3919 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
3920 */
3921message MediaProviderIdleMaintenance {
3922 // Volume type that this event pertains to
3923 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3924
3925 // Total number of files in database
3926 optional int64 item_count = 2;
3927 // Duration of idle maintenance, normalized per file
3928 optional float normalized_duration_millis = 3;
3929 // Number of thumbnails found to be stale, normalized per file
3930 optional float normalized_stale_thumbnails = 4;
3931 // Number of items found to be expired, normalized per file
3932 optional float normalized_expired_media = 5;
3933}
3934
Keun young Park3e033cb2019-12-18 11:27:35 -08003935/**
3936 * Represents boot time event with duration in ms.
3937 *
3938 * Logged from: bootstat and various system server components. Check each enums for details.
3939 */
3940message BootTimeEventDuration {
3941 enum DurationEvent {
3942 UNKNOWN = 0;
3943 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
3944 ABSOLUTE_BOOT_TIME = 1;
3945 // Bootloader's 1st stage execution time.
3946 // Logged from bootstat.
3947 BOOTLOADER_FIRST_STAGE_EXEC = 2;
3948 // Bootloader's 1st stage loading time.
3949 // Logged from bootstat.
3950 BOOTLOADER_FIRST_STAGE_LOAD = 3;
3951 // Bootloader's kernel loading time.
3952 // Logged from bootstat.
3953 BOOTLOADER_KERNEL_LOAD = 4;
3954 // Bootloader's 2nd stage execution time.
3955 // Logged from bootstat.
3956 BOOTLOADER_SECOND_STAGE_EXEC = 5;
3957 // Bootloader's 2nd stage loading time.
3958 // Logged from bootstat.
3959 BOOTLOADER_SECOND_STAGE_LOAD = 6;
3960 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
3961 // for locked device.
3962 // Logged from bootstat.
3963 BOOTLOADER_UI_WAIT = 7;
3964 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
3965 // Logged from bootstat.
3966 BOOTLOADER_TOTAL = 8;
3967 // Shutdown duration inside init for the reboot before the current boot up.
3968 // Logged from f/b/services/.../BootReceiver.java.
3969 SHUTDOWN_DURATION = 9;
3970 // Total time for mounting of disk devices during bootup.
3971 // Logged from f/b/services/.../BootReceiver.java.
3972 MOUNT_DEFAULT_DURATION = 10;
3973 // Total time for early stage mounting of disk devices during bootup.
3974 // Logged from f/b/services/.../BootReceiver.java.
3975 MOUNT_EARLY_DURATION = 11;
3976 // Total time for late stage mounting of disk devices during bootup.
3977 // Logged from f/b/services/.../BootReceiver.java.
3978 MOUNT_LATE_DURATION = 12;
3979 // Average time to scan non-system app after OTA
3980 // Logged from f/b/services/.../PackageManagerService.java
3981 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
3982 // Time to initialize Package manager after OTA
3983 // Logged from f/b/services/.../PackageManagerService.java
3984 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
3985 // Time to scan all system app from Package manager after OTA
3986 // Logged from f/b/services/.../PackageManagerService.java
3987 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
3988 // Init's total time for cold boot stage.
3989 // Logged from bootstat.
3990 COLDBOOT_WAIT = 16;
3991 // Init's total time for initializing selinux.
3992 // Logged from bootstat.
3993 SELINUX_INIT = 17;
3994 // Time since last factory reset.
3995 // Logged from bootstat.
3996 FACTORY_RESET_TIME_SINCE_RESET = 18;
3997 }
3998
3999 // Type of the event.
4000 optional DurationEvent event = 1;
4001 // Duration of the event in ms.
4002 optional int64 duration_millis = 2;
4003}
4004
4005/**
4006 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4007 * since boot-up.
4008 *
4009 * Logged from: bootstat and various system server components. Check each enums for details.
4010 */
4011message BootTimeEventElapsedTime {
4012 enum ElapsedTimeEvent {
4013 UNKNOWN = 0;
4014 // Time when init starts 1st stage. Logged from bootstat.
4015 ANDROID_INIT_STAGE_1 = 1;
4016 // Time when sys.boot_completed prop is set.
4017 // Logged from bootstat.
4018 BOOT_COMPLETE = 2;
4019 // BOOT_COMPLETE for encrypted device.
4020 BOOT_COMPLETE_ENCRYPTION = 3;
4021 // BOOT_COMPLETE for device with no encryption.
4022 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4023 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
4024 BOOT_COMPLETE_POST_DESCRYPT = 5;
4025 // BOOT_COMPLETE after factory reset.
4026 FACTORY_RESET_BOOT_COMPLETE = 6;
4027 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4028 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
4029 // BOOT_COMPLETE_POST_DESCRYPT after factory reset.
4030 FACTORY_RESET_BOOT_COMPLETE_POST_DESCRYPT = 8;
4031 // BOOT_COMPLETE after OTA.
4032 OTA_BOOT_COMPLETE = 9;
4033 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4034 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
4035 // BOOT_COMPLETE_POST_DESCRYPT after OTA.
4036 OTA_BOOT_COMPLETE_POST_DESCRYPT = 11;
4037 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4038 // Logged from f/b/services/.../UserController.java
4039 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4040 // Time when the system starts sending BOOT_COMPLETED broadcast.
4041 // Logged from f/b/services/.../UserController.java
4042 FRAMEWORK_BOOT_COMPLETED = 13;
4043 // Time when the package manager starts init.
4044 // Logged from f/b/services/.../SystemServer.java
4045 PACKAGE_MANAGER_INIT_START = 14;
4046 // Time when package manager is ready
4047 // Logged from f/b/services/.../SystemServer.java
4048 PACKAGE_MANAGER_INIT_READY = 15;
4049 // Represents the time when user has entered unlock credential for system with user pin.
4050 // Logged from bootstat.
4051 POST_DECRYPT = 16;
4052 // Represents the start of zygote's init.
4053 // Logged from zygote itself.
4054 ZYGOTE_INIT_START = 17;
4055 // Represents the start of secondary zygote's init.
4056 // TODO: add logging to zygote
4057 SECONDARY_ZYGOTE_INIT_START = 18;
4058 // Represents the start of system server's init.
4059 // Logged from f/b/services/.../SystemServer.java
4060 SYSTEM_SERVER_INIT_START = 19;
4061 // Represents the completion of system server's init.
4062 // Logged from f/b/services/.../SystemServer.java
4063 SYSTEM_SERVER_READY = 20;
4064 // Represents the start of launcher during boot-up.
4065 // TODO: add logging
4066 LAUNCHER_START = 21;
4067 // Represents the completion of launcher's initial rendering. User can use other apps from
4068 // launcher from this point.
4069 // TODO: add logging
4070 LAUNCHER_SHOWN = 22;
4071 }
4072
4073 // Type of the event.
4074 optional ElapsedTimeEvent event = 1;
4075 // Time since bootup for the event.
4076 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4077 optional int64 time_millis = 2;
4078}
4079
4080/**
4081 * Boot time events with UTC time.
4082 *
4083 * Logged from: bootstat and various system server components. Check each enums for details.
4084 */
4085message BootTimeEventUtcTime {
4086 enum UtcTimeEvent {
4087 UNKNOWN = 0;
4088 // Time of the bootstat's marking of 1st boot after the last factory reset.
4089 // Logged from bootstat.
4090 FACTORY_RESET_RESET_TIME = 1;
4091 // The time when bootstat records FACTORY_RESET_* events. This is close to
4092 // BOOT_COMPLETE time for the current bootup.
4093 // Logged from bootstat.
4094 FACTORY_RESET_CURRENT_TIME = 2;
4095 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4096 // Logged from bootstat.
4097 FACTORY_RESET_RECORD_VALUE = 3;
4098 }
4099
4100 // Type of the event.
4101 optional UtcTimeEvent event = 1;
4102 // UTC time for the event.
4103 optional int64 utc_time_secs = 2;
4104}
4105
4106/**
4107 * Boot time events representing specific error code during bootup.
4108 * Meaning of error code can be different per each event type.
4109 *
4110 * Logged from: bootstat and various system server components. Check each enums for details.
4111 */
4112message BootTimeEventErrorCode {
4113 enum ErrorCodeEvent {
4114 UNKNOWN = 0;
4115 // Linux error code for time() call to get the current UTC time.
4116 // Logged from bootstat.
4117 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4118 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4119 // as UMOUNT_STAT_* from init/reboot.cpp.
4120 // Logged from f/b/services/.../BootReceiver.java.
4121 SHUTDOWN_UMOUNT_STAT = 2;
4122 // Reprepsents fie system mounting error code for the current boot. Error codes defined
4123 // as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
4124 // Logged from f/b/services/.../BootReceiver.java.
4125 FS_MGR_FS_STAT = 3;
4126 }
4127
4128 // Type of the event.
4129 optional ErrorCodeEvent event = 1;
4130 // error code defined per each event type.
4131 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4132 // FS_MGR_FS_STAT.
4133 optional int32 error_code = 2;
4134}
4135
Chenjie Yubbcbc602018-02-05 16:51:52 -08004136//////////////////////////////////////////////////////////////////////
4137// Pulled atoms below this line //
4138//////////////////////////////////////////////////////////////////////
4139
4140/**
David Chenc8a43242017-10-17 16:23:28 -07004141 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4142 *
4143 * Pulled from:
4144 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4145 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004146message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004147 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004148
4149 optional int64 rx_bytes = 2;
4150
4151 optional int64 rx_packets = 3;
4152
4153 optional int64 tx_bytes = 4;
4154
4155 optional int64 tx_packets = 5;
4156}
4157
4158/**
4159 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4160 *
4161 * Pulled from:
4162 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4163 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004164message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004165 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004166
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004167 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4168 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004169
4170 optional int64 rx_bytes = 3;
4171
4172 optional int64 rx_packets = 4;
4173
4174 optional int64 tx_bytes = 5;
4175
4176 optional int64 tx_packets = 6;
4177}
4178
4179/**
4180 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4181 *
4182 * Pulled from:
4183 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4184 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004185message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004186 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004187
4188 optional int64 rx_bytes = 2;
4189
4190 optional int64 rx_packets = 3;
4191
4192 optional int64 tx_bytes = 4;
4193
4194 optional int64 tx_packets = 5;
4195}
4196
4197/**
4198 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4199 *
4200 * Pulled from:
4201 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4202 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004203message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004204 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004205
Yao Chenc40a19d2018-03-15 16:48:25 -07004206 // 1 denotes foreground and 0 denotes background. This is called Set in
4207 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004208 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004209
4210 optional int64 rx_bytes = 3;
4211
4212 optional int64 rx_packets = 4;
4213
4214 optional int64 tx_bytes = 5;
4215
4216 optional int64 tx_packets = 6;
4217}
4218
4219/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004220 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4221 *
4222 * Pulled from:
4223 * StatsCompanionService
4224 */
4225message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004226 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004227
4228 optional int64 rx_bytes = 2;
4229
4230 optional int64 tx_bytes = 3;
4231}
4232
4233/**
David Chenc8a43242017-10-17 16:23:28 -07004234 * Pulls the kernel wakelock durations. This atom is adapted from
4235 * android/internal/os/KernelWakelockStats.java
4236 *
4237 * Pulled from:
4238 * StatsCompanionService using KernelWakelockReader.
4239 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004240message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004241 optional string name = 1;
4242
4243 optional int32 count = 2;
4244
4245 optional int32 version = 3;
4246
Yangster-maca8a30442018-10-13 23:46:34 -07004247 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004248}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004249
Chenjie Yu05013b32017-11-21 10:21:41 -08004250/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004251 * Pulls low power state information. If power.stats HAL is not available, this
4252 * includes platform and subsystem sleep state information,
4253 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4254 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004255 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004256 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004257 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4258 * as defined in:
4259 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004260 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004261message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004262 // Subsystem name
4263 optional string subsystem_name = 1;
4264 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4265 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004266 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4267 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004268 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004269 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004270 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004271 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004272 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004273}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004274
Chenjie Yu05013b32017-11-21 10:21:41 -08004275/**
Bookatz92da2832018-11-01 18:10:03 -07004276 * Pulls on-device power measurement information.
4277 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4278 * Pulled from:
4279 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4280 */
4281message OnDevicePowerMeasurement {
4282 // Name of the subsystem (to which the rail belongs).
4283 optional string subsystem_name = 1;
4284
4285 // Rail name. The rail lies within the subsystem.
4286 optional string rail_name = 2;
4287
4288 // Time (in ms since boot) at which the rail energy value was measured.
4289 // This may differ slightly from the time that statsd logs this information.
4290 optional uint64 measurement_timestamp_millis = 3;
4291
4292 // Accumulated energy used via the rail since device boot in uWs.
4293 optional uint64 energy_microwatt_secs = 4;
4294}
4295
4296/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004297 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004298 * Pulls the time the cpu spend on the frequency index. Frequency index
4299 * starts from highest to lowest. The value should be monotonically
4300 * increasing since boot. However, if there is a cpu
4301 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004302 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004303message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004304 optional uint32 cluster = 1;
4305 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004306 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004307}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004308
Chenjie Yu05013b32017-11-21 10:21:41 -08004309/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004310 * Pulls Cpu Time Per Uid.
4311 * Note that isolated process uid time should be attributed to host uids.
4312 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004313message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004314 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004315 optional uint64 user_time_micros = 2;
4316 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004317}
4318
4319/**
4320 * Pulls Cpu Time Per Uid per frequency.
4321 * Note that isolated process uid time should be attributed to host uids.
4322 * For each uid, we order the time by descending frequencies.
4323 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004324message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004325 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004326 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004327 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004328}
Hugo Benichi884970e2017-11-14 22:42:46 +09004329
Chenjie Yu05013b32017-11-21 10:21:41 -08004330/**
4331 * Pulls Wifi Controller Activity Energy Info
4332 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004333message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004334 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004335 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004336 // stack reported state
4337 // TODO: replace this with proto enum
4338 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004339 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004340 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004341 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004342 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004343 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004344 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004345 // product of current(mA), voltage(V) and time(ms)
4346 optional uint64 controller_energy_used = 6;
4347}
4348
4349/**
4350 * Pulls Modem Activity Energy Info
4351 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004352message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004353 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004354 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004355 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004356 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004357 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004358 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004359 /**
4360 * Tx power index
4361 * index 0 = tx_power < 0dBm
4362 * index 1 = 0dBm < tx_power < 5dBm
4363 * index 2 = 5dBm < tx_power < 15dBm
4364 * index 3 = 15dBm < tx_power < 20dBm
4365 * index 4 = tx_power > 20dBm
4366 */
4367 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004368 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004369 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004370 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004371 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004372 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004373 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004374 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004375 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004376 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004377 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004378 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004379 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004380 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004381}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004382
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004383/**
4384 * Pulls Bluetooth Activity Energy Info
4385 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4386 */
4387message BluetoothActivityInfo {
4388 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004389 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004390 // bluetooth stack state
4391 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004392 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004393 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004394 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004395 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004396 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004397 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004398 // product of current(mA), voltage(V) and time(ms)
4399 optional uint64 energy_used = 6;
4400}
4401
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004402/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004403 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004404 *
4405 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004406 */
4407message ProcessMemoryState {
4408 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004409 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004410
4411 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004412 // Usually package name, "system" for system server.
4413 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004414 optional string process_name = 2;
4415
Rafal Slawikda51b932018-12-13 16:31:33 +00004416 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004417 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004418
4419 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004420 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004421
4422 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004423 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004424
Rajeev Kumar90235992018-01-29 11:06:48 -08004425 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004426 // Value is read from memory.stat, field total_rss if per-app memory
4427 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004428 optional int64 rss_in_bytes = 6;
4429
4430 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004431 // Value is read from memory.stat, field total_cache if per-app memory
4432 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004433 optional int64 cache_in_bytes = 7;
4434
4435 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004436 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004437 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004438 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004439
Rafal Slawik203c3db2019-09-25 19:53:01 +01004440 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004441 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004442
Rafal Slawik203c3db2019-09-25 19:53:01 +01004443 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4444 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004445
Rafal Slawik203c3db2019-09-25 19:53:01 +01004446 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4447 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004448}
4449
4450/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004451 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004452 *
4453 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4454 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004455 *
4456 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004457 */
4458message ProcessMemoryHighWaterMark {
4459 // The uid if available. -1 means not available.
4460 optional int32 uid = 1 [(is_uid) = true];
4461
Rafal Slawikda51b932018-12-13 16:31:33 +00004462 // The process name.
4463 // Usually package name or process cmdline.
4464 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004465 optional string process_name = 2;
4466
Rafal Slawik239b6802019-09-09 18:46:01 +01004467 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4468 // computed by converting kilobytes to bytes.
4469 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4470
Rafal Slawik3bea8952018-11-15 12:39:33 +00004471 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4472 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004473 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004474}
4475
4476/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004477 * Logs the memory stats for a process.
4478 *
4479 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4480 * and for selected native processes.
4481 */
4482message ProcessMemorySnapshot {
4483 // The uid if available. -1 means not available.
4484 optional int32 uid = 1 [(is_uid) = true];
4485
4486 // The process name.
4487 // Usually package name or process cmdline.
4488 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4489 optional string process_name = 2;
4490
4491 // The pid of the process.
4492 // Allows to disambiguate instances of the process.
4493 optional int32 pid = 3;
4494
4495 // The current OOM score adjustment value.
4496 // Read from ProcessRecord for managed processes.
4497 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4498 optional int32 oom_score_adj = 4;
4499
4500 // The current RSS of the process.
4501 // VmRSS from /proc/pid/status.
4502 optional int32 rss_in_kilobytes = 5;
4503
4504 // The current anon RSS of the process.
4505 // RssAnon from /proc/pid/status.
4506 optional int32 anon_rss_in_kilobytes = 6;
4507
4508 // The current swap size of the process.
4509 // VmSwap from /proc/pid/status.
4510 optional int32 swap_in_kilobytes = 7;
4511
4512 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4513 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4514}
4515
4516/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004517 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004518 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004519message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004520 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004521}
4522
4523/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004524 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004525 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004526message SystemUptime {
4527 // Milliseconds since the system was booted.
4528 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4529 // for external input).
4530 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004531 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004532}
4533
4534/*
4535 * Reads from /proc/uid_concurrent_active_time which has the format:
4536 * active: X (X is # cores)
4537 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4538 * [uid1]: [time-0] [time-1] [time-2] ... ...
4539 * ...
4540 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4541 * The file contains a monotonically increasing count of time for a single boot.
4542 */
4543message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004544 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004545 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004546}
4547
4548/**
4549 * Reads from /proc/uid_concurrent_policy_time which has the format:
4550 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4551 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4552 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4553 * ...
4554 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4555 * The file contains a monotonically increasing count of time for a single boot.
4556 */
4557message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004558 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004559 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004560 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004561}
4562
4563/*
4564 * Pulls free disk space, for data, system partition and temporary directory.
4565 */
4566message DiskSpace {
4567 // available bytes in data partition
4568 optional uint64 data_available_bytes = 1;
4569 // available bytes in system partition
4570 optional uint64 system_available_bytes = 2;
4571 // available bytes in download cache or temp directories
4572 optional uint64 temp_available_bytes = 3;
4573}
Tej Singhbf972d92018-01-10 20:51:13 -08004574
4575/**
4576 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004577 *
4578 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004579 */
4580message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004581 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004582}
4583
4584/**
4585 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004586 * Pulled from:
4587 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004588 */
4589message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004590 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004591}
4592
4593/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004594 * Pulls battery voltage.
4595 * Pulled from:
4596 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4597 */
4598message BatteryVoltage {
4599 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004600 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004601}
4602
4603/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004604 * Pulls battery level (percent full, from 0 to 100).
4605 *
4606 * Pulled from:
4607 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4608 */
4609message BatteryLevel {
4610 // Battery level. Should be in [0, 100].
4611 optional int32 battery_level = 1;
4612}
4613
4614/**
Tej Singhd89137e2018-03-26 14:51:40 -07004615 * Pulls the temperature of various parts of the device.
4616 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004617 *
Maggie White442b6312019-04-05 16:26:44 -07004618 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004619 */
4620message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004621 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004622 optional android.os.TemperatureTypeEnum sensor_location = 1;
4623
4624 // The name of the temperature source. Eg. CPU0
4625 optional string sensor_name = 2;
4626
Tej Singhd89137e2018-03-26 14:51:40 -07004627 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004628 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004629 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004630
4631 // Relative severity of the throttling, see enum definition.
4632 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004633}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004634
4635/**
4636 * Pulls the statistics of calls to Binder.
4637 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004638 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4639 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004640 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004641 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004642 */
4643message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004644 // UID of the process responsible for the binder transaction. It will be set if the process
4645 // executing the binder transaction attribute the transaction to another uid using
4646 // Binder.setThreadWorkSource().
4647 //
4648 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004649 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004650 // UID of the process executing the binder transaction.
4651 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004652 // Fully qualified class name of the API call.
4653 //
4654 // This is a system server class name.
4655 //
4656 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4657 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4658 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4659 // commonly used APIs.
4660 optional string service_class_name = 2;
4661 // Method name of the API call. It can also be a transaction code if we cannot
4662 // resolve it to a name. See Binder#getTransactionName.
4663 //
4664 // This is a system server method name.
4665 optional string service_method_name = 3;
4666 // Total number of API calls.
4667 optional int64 call_count = 4;
4668 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4669 optional bool screen_interactive = 13;
4670 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4671 // call_count will be equal to recorded_call_count.
4672 //
4673 // If recorded_call_count is different than call_count, it means data collection has been
4674 // sampled. All the fields below will be sampled in this case.
4675 optional int64 recorded_call_count = 12;
4676 // Number of exceptions thrown by the API.
4677 optional int64 recorded_exception_count = 5;
4678 // Total latency of all API calls.
4679 // Average can be computed using total_latency_micros / recorded_call_count.
4680 optional int64 recorded_total_latency_micros = 6;
4681 // Maximum latency of one API call.
4682 optional int64 recorded_max_latency_micros = 7;
4683 // Total CPU usage of all API calls.
4684 // Average can be computed using total_cpu_micros / recorded_call_count.
4685 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4686 optional int64 recorded_total_cpu_micros = 8;
4687 // Maximum CPU usage of one API call.
4688 optional int64 recorded_max_cpu_micros = 9;
4689 // Maximum parcel reply size of one API call.
4690 optional int64 recorded_max_reply_size_bytes = 10;
4691 // Maximum parcel request size of one API call.
4692 optional int64 recorded_max_request_size_bytes = 11;
4693}
4694
4695/**
4696 * Pulls the statistics of exceptions during calls to Binder.
4697 *
4698 * Binder stats are cumulative from boot unless somebody reset the data using
4699 * > adb shell dumpsys binder_calls_stats --reset
4700 */
4701message BinderCallsExceptions {
4702 // Exception class name, e.g. java.lang.IllegalArgumentException.
4703 //
4704 // This is an exception class name thrown by the system server.
4705 optional string exception_class_name = 1;
4706 // Total number of exceptions.
4707 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004708}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004709
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004710/**
4711 * Pulls the statistics of message dispatching on HandlerThreads.
4712 *
4713 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4714 * config on the device.
4715 *
4716 * Next tag: 11
4717 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004718message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004719 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004720 optional int32 uid = 1 [(is_uid) = true];
4721
4722 // Fully qualified class name of the handler target class.
4723 //
4724 // This field does not contain PII. This is a system server class name.
4725 optional string handler_class_name = 2;
4726
4727 // The name of the thread that runs the Looper.
4728 //
4729 // This field does not contain PII. This is a system server thread name.
4730 optional string looper_thread_name = 3;
4731
4732 // The name of the dispatched message.
4733 //
4734 // This field does not contain PII. This is a system server constant or class
4735 // name.
4736 optional string message_name = 4;
4737
4738 // Total number of successfully dispatched messages.
4739 optional int64 message_count = 5;
4740
4741 // Total number of messages that failed dispatching.
4742 optional int64 exception_count = 6;
4743
4744 // Total number of processed messages we have data recorded for. If we
4745 // collected data for all the messages, message_count will be equal to
4746 // recorded_message_count.
4747 //
4748 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004749 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004750 optional int64 recorded_message_count = 7;
4751
4752 // Total latency of all processed messages.
4753 // Average can be computed using recorded_total_latency_micros /
4754 // recorded_message_count.
4755 optional int64 recorded_total_latency_micros = 8;
4756
4757 // Total CPU usage of all processed message.
4758 // Average can be computed using recorded_total_cpu_micros /
4759 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004760 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004761 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004762
4763 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4764 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004765
4766 // Max recorded CPU usage of all processed messages.
4767 optional int64 recorded_max_cpu_micros = 11;
4768
4769 // Max recorded latency of all processed messages.
4770 optional int64 recorded_max_latency_micros = 12;
4771
4772 // Total number of messages we tracked the dispatching delay for. If we
4773 // collected data for all the messages, message_count will be equal to
4774 // recorded_delay_message_count.
4775 //
4776 // If recorded_delay_message_count is different than message_count, it means data
4777 // collection has been sampled or/and not all messages specified the target dispatch time.
4778 // The fields below will be sampled in this case.
4779 optional int64 recorded_delay_message_count = 13;
4780
4781 // Total dispatching delay of all processed messages.
4782 // Calculated as a difference between the target dispatching time (Message.when)
4783 // and the actual dispatching time.
4784 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4785 optional int64 recorded_total_delay_millis = 14;
4786
4787 // Max dispatching delay of all processed messages.
4788 // Calculated as a difference between the target dispatching time (Message.when)
4789 // and the actual dispatching time.
4790 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004791}
Tej Singh86dc9db2018-09-06 00:39:57 +00004792
4793/**
4794 * Pulls disk information, such as write speed and latency.
4795 */
4796message DiskStats {
4797 // Time taken to open, write 512B to, and close a file.
4798 // -1 if error performing the check.
4799 optional int64 data_write_latency_millis = 1;
4800
4801 optional bool file_based_encryption = 2;
4802
4803 // Recent disk write speed in kB/s.
4804 // -1 if error querying storageed.
4805 // 0 if data is unavailable.
4806 optional int32 recent_disk_write_speed = 3;
4807}
4808
4809
4810/**
4811 * Free and total bytes of the Data, Cache, and System partition.
4812 */
4813message DirectoryUsage {
4814 enum Directory {
4815 UNKNOWN = 0;
4816 DATA = 1;
4817 CACHE = 2;
4818 SYSTEM = 3;
4819 }
4820 optional Directory directory = 1;
4821 optional int64 free_bytes = 2;
4822 optional int64 total_bytes = 3;
4823}
4824
4825
4826/**
4827 * Size of an application: apk size, data size, and cache size.
4828 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4829 * Information is only reported for apps with the primary user (user 0).
4830 * Sizes are aggregated by package name.
4831 */
4832message AppSize {
4833 // Including uids will involve modifying diskstats logic.
4834 optional string package_name = 1;
4835 // App size in bytes. -1 if unavailable.
4836 optional int64 app_size_bytes = 2;
4837 // App data size in bytes. -1 if unavailable.
4838 optional int64 app_data_size_bytes = 3;
4839 // App cache size in bytes. -1 if unavailable.
4840 optional int64 app_cache_size_bytes = 4;
4841 // Time that the cache file was produced.
4842 // Uses System.currentTimeMillis(), which is wall clock time.
4843 optional int64 cache_time_millis = 5;
4844}
4845
4846
4847/**
4848 * Size of a particular category. Eg: photos, videos.
4849 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4850 */
4851message CategorySize {
4852 enum Category {
4853 UNKNOWN = 0;
4854 APP_SIZE = 1;
4855 APP_DATA_SIZE = 2;
4856 APP_CACHE_SIZE = 3;
4857 PHOTOS = 4;
4858 VIDEOS = 5;
4859 AUDIO = 6;
4860 DOWNLOADS = 7;
4861 SYSTEM = 8;
4862 OTHER = 9;
4863 }
4864 optional Category category = 1;
4865 // Category size in bytes.
4866 optional int64 size_bytes = 2;
4867 // Time that the cache file was produced.
4868 // Uses System.currentTimeMillis(), which is wall clock time.
4869 optional int64 cache_time_millis = 3;
4870}
Tej Singhd6d6d772018-09-05 17:41:25 -07004871
4872/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004873 * Pulls per uid I/O stats. The stats are cumulative since boot.
4874 *
4875 * Read/write bytes are I/O events from a storage device
4876 * Read/write chars are data requested by read/write syscalls, and can be
4877 * satisfied by caching.
4878 *
4879 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4880 */
4881message DiskIo {
4882 optional int32 uid = 1 [(is_uid) = true];
4883 optional int64 fg_chars_read = 2;
4884 optional int64 fg_chars_write = 3;
4885 optional int64 fg_bytes_read = 4;
4886 optional int64 fg_bytes_write = 5;
4887 optional int64 bg_chars_read = 6;
4888 optional int64 bg_chars_write = 7;
4889 optional int64 bg_bytes_read = 8;
4890 optional int64 bg_bytes_write = 9;
4891 optional int64 fg_fsync = 10;
4892 optional int64 bg_fsync= 11;
4893}
4894
4895
4896/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004897 * Pulls the number of fingerprints for each user.
4898 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004899 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004900 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004901message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004902 // The associated user. Eg: 0 for owners, 10+ for others.
4903 // Defined in android/os/UserHandle.java
4904 optional int32 user = 1;
4905 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004906 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004907}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004908
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004909/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004910 * Pulls the number of faces for each user.
4911 *
4912 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4913 */
4914message NumFacesEnrolled {
4915 // The associated user. Eg: 0 for owners, 10+ for others.
4916 // Defined in android/os/UserHandle.java
4917 optional int32 user = 1;
4918 // Number of faces registered to that user.
4919 optional int32 num_faces_enrolled = 2;
4920}
4921/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004922 * A mapping of role holder -> role
4923 */
4924message RoleHolder {
4925 // uid of the role holder
4926 optional int32 uid = 1 [(is_uid) = true];
4927
4928 // package name of the role holder
4929 optional string package_name = 2;
4930
4931 // the role held
4932 optional string role = 3;
4933}
4934
Yangsteraf9aee72018-10-12 09:26:16 -07004935message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004936 // These are all in byte resolution.
4937 optional int64 min = 1 [deprecated = true];
4938 optional int64 average = 2 [deprecated = true];
4939 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07004940
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004941 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
4942 // int64 fields.
4943 optional int32 mean_kb = 4;
4944 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07004945}
4946
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004947// A reduced subset of process states; reducing the number of possible states allows more
4948// aggressive device-side aggregation of statistics and hence reduces metric upload size.
4949enum ProcessStateAggregated {
4950 PROCESS_STATE_UNKNOWN = 0;
4951 // Persistent system process.
4952 PROCESS_STATE_PERSISTENT = 1;
4953 // Top activity; actually any visible activity.
4954 PROCESS_STATE_TOP = 2;
4955 // Process binding to top or a foreground service.
4956 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
4957 // Processing running a foreground service.
4958 PROCESS_STATE_FGS = 4;
4959 // Important foreground process (ime, wallpaper, etc).
4960 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
4961 // Important background process.
4962 PROCESS_STATE_BACKGROUND = 6;
4963 // Process running a receiver.
4964 PROCESS_STATE_RECEIVER = 7;
4965 // All kinds of cached processes.
4966 PROCESS_STATE_CACHED = 8;
4967}
4968
4969// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07004970message ProcessStatsStateProto {
4971 optional android.service.procstats.ScreenState screen_state = 1;
4972
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004973 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07004974
4975 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4976 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004977 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
4978
4979 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07004980
4981 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004982 optional int64 duration_millis = 4 [deprecated = true];
4983 // Same as above, but with minute resolution so it fits into an int32.
4984 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07004985
4986 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004987 optional int64 realtime_duration_millis = 9 [deprecated = true];
4988 // Same as above, but with minute resolution so it fits into an int32.
4989 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07004990
4991 // # of samples taken
4992 optional int32 sample_size = 5;
4993
4994 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004995 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07004996
4997 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004998 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07004999
5000 // RSS is memory resident for this process
5001 optional AggStats rss = 8;
5002}
5003
5004// Next Tag: 7
5005message ProcessStatsProto {
5006 // Name of process.
5007 optional string process = 1;
5008
5009 // Uid of the process.
5010 optional int32 uid = 2;
5011
5012 // Information about how often kills occurred
5013 message Kill {
5014 // Count of excessive CPU kills
5015 optional int32 cpu = 1;
5016
5017 // Count of kills when cached
5018 optional int32 cached = 2;
5019
5020 // PSS stats during cached kill
5021 optional AggStats cached_pss = 3;
5022 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005023 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005024
5025 // Time and memory spent in various states.
5026 repeated ProcessStatsStateProto states = 5;
5027
5028 // Total time process has been running... screen_state, memory_state, and process_state
5029 // will not be set.
5030 optional ProcessStatsStateProto total_running_state = 6;
5031}
5032
5033message PackageServiceOperationStatsProto {
5034 // Operate enum: Started, Foreground, Bound, Executing
5035 optional android.service.procstats.ServiceOperationState operation = 1;
5036
5037 // Number of times the service was in this operation.
5038 optional int32 count = 2;
5039
5040 // Information about a state the service can be in.
5041 message StateStats {
5042 // Screen state enum.
5043 optional android.service.procstats.ScreenState screen_state = 1;
5044 // Memory state enum.
5045 optional android.service.procstats.MemoryState memory_state = 2;
5046
5047 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005048 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005049 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005050 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005051 }
5052 repeated StateStats state_stats = 3;
5053}
5054
5055message PackageServiceStatsProto {
5056 // Name of service component.
5057 optional string service_name = 1;
5058
5059 // The operation stats.
5060 // The package_name, package_uid, package_version, service_name will not be set to save space.
5061 repeated PackageServiceOperationStatsProto operation_stats = 2;
5062}
5063
5064message PackageAssociationSourceProcessStatsProto {
5065 // Uid of the process.
5066 optional int32 process_uid = 1;
5067 // Process name.
5068 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005069 // Package name.
5070 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005071 // Total count of the times this association appeared.
5072 optional int32 total_count = 3;
5073
5074 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005075 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005076
5077 // Total count of the times this association became actively impacting its target process.
5078 optional int32 active_count = 5;
5079
5080 // Information on one source in this association.
5081 message StateStats {
5082 // Process state enum.
5083 optional android.service.procstats.ProcessState process_state = 1;
5084 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005085 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005086 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005087 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005088 }
5089 repeated StateStats active_state_stats = 6;
5090}
5091
5092message PackageAssociationProcessStatsProto {
5093 // Name of the target component.
5094 optional string component_name = 1;
5095 // Information on one source in this association.
5096 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5097}
5098
5099
5100message ProcessStatsPackageProto {
5101 // Name of package.
5102 optional string package = 1;
5103
5104 // Uid of the package.
5105 optional int32 uid = 2;
5106
5107 // Version of the package.
5108 optional int64 version = 3;
5109
5110 // Stats for each process running with the package loaded in to it.
5111 repeated ProcessStatsProto process_stats = 4;
5112
5113 // Stats for each of the package's services.
5114 repeated PackageServiceStatsProto service_stats = 5;
5115
5116 // Stats for each association with the package.
5117 repeated PackageAssociationProcessStatsProto association_stats = 6;
5118}
5119
5120message ProcessStatsSectionProto {
5121 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005122 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005123
5124 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005125 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005126
5127 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005128 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005129
5130 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005131 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005132
5133 // System runtime library. e.g. "libdvm.so", "libart.so".
5134 optional string runtime = 5;
5135
5136 // whether kernel reports swapped pss.
5137 optional bool has_swapped_pss = 6;
5138
5139 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5140 enum Status {
5141 STATUS_UNKNOWN = 0;
5142 STATUS_COMPLETE = 1;
5143 STATUS_PARTIAL = 2;
5144 STATUS_SHUTDOWN = 3;
5145 STATUS_SYSPROPS = 4;
5146 }
5147 repeated Status status = 7;
5148
Chenjie Yub2ecc792019-01-17 10:27:26 -08005149 // Number of pages available of various types and sizes, representation fragmentation.
5150 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5151
Yangsteraf9aee72018-10-12 09:26:16 -07005152 // Stats for each process.
5153 repeated ProcessStatsProto process_stats = 8;
5154
5155 // Stats for each package.
5156 repeated ProcessStatsPackageProto package_stats = 9;
5157}
5158
Chenjie Yub2ecc792019-01-17 10:27:26 -08005159message ProcessStatsAvailablePagesProto {
5160 // Node these pages are in (as per /proc/pagetypeinfo)
5161 optional int32 node = 1;
5162
5163 // Zone these pages are in (as per /proc/pagetypeinfo)
5164 optional string zone = 2;
5165
5166 // Label for the type of these pages (as per /proc/pagetypeinfo)
5167 optional string label = 3;
5168
5169 // Distribution of number of pages available by order size. First entry in array is
5170 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5171 repeated int32 pages_per_order = 4;
5172}
5173
Chenjie Yu12e5e672018-09-14 15:54:59 -07005174/**
5175 * Pulled from ProcessStatsService.java
5176 */
5177message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005178 optional ProcessStatsSectionProto proc_stats_section = 1;
5179}
5180
Chenjie Yuf910b7802019-01-11 16:08:20 -08005181/**
5182 * Pulled from ProcessStatsService.java
5183 */
5184message ProcStatsPkgProc {
5185 optional ProcessStatsSectionProto proc_stats_section = 1;
5186}
5187
Chris Wrencdea3b72019-11-22 16:58:17 -05005188// Next Tag: 2
5189message PackageRemoteViewInfoProto {
5190 optional string package_name = 1;
5191 // add per-package additional info here (like channels)
5192}
5193
5194// Next Tag: 2
5195message NotificationRemoteViewsProto {
5196 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5197}
5198
5199/**
5200 * Pulled from NotificationManagerService.java
5201 */
5202message NotificationRemoteViews {
5203 optional NotificationRemoteViewsProto notification_remote_views = 1;
5204}
5205
Yangsteraf9aee72018-10-12 09:26:16 -07005206message PowerProfileProto {
5207 optional double cpu_suspend = 1;
5208
5209 optional double cpu_idle = 2;
5210
5211 optional double cpu_active = 3;
5212
5213 message CpuCluster {
5214 optional int32 id = 1;
5215 optional double cluster_power = 2;
5216 optional int32 cores = 3;
5217 repeated int64 speed = 4;
5218 repeated double core_power = 5;
5219 }
5220
5221 repeated CpuCluster cpu_cluster = 40;
5222
5223 optional double wifi_scan = 4;
5224
5225 optional double wifi_on = 5;
5226
5227 optional double wifi_active = 6;
5228
5229 optional double wifi_controller_idle = 7;
5230
5231 optional double wifi_controller_rx = 8;
5232
5233 optional double wifi_controller_tx = 9;
5234
5235 repeated double wifi_controller_tx_levels = 10;
5236
5237 optional double wifi_controller_operating_voltage = 11;
5238
5239 optional double bluetooth_controller_idle = 12;
5240
5241 optional double bluetooth_controller_rx = 13;
5242
5243 optional double bluetooth_controller_tx = 14;
5244
5245 optional double bluetooth_controller_operating_voltage = 15;
5246
5247 optional double modem_controller_sleep = 16;
5248
5249 optional double modem_controller_idle = 17;
5250
5251 optional double modem_controller_rx = 18;
5252
5253 repeated double modem_controller_tx = 19;
5254
5255 optional double modem_controller_operating_voltage = 20;
5256
5257 optional double gps_on = 21;
5258
5259 repeated double gps_signal_quality_based = 22;
5260
5261 optional double gps_operating_voltage = 23;
5262
5263 optional double bluetooth_on = 24;
5264
5265 optional double bluetooth_active = 25;
5266
5267 optional double bluetooth_at_cmd = 26;
5268
5269 optional double ambient_display = 27;
5270
5271 optional double screen_on = 28;
5272
5273 optional double radio_on = 29;
5274
5275 optional double radio_scanning = 30;
5276
5277 optional double radio_active = 31;
5278
5279 optional double screen_full = 32;
5280
5281 optional double audio = 33;
5282
5283 optional double video = 34;
5284
5285 optional double flashlight = 35;
5286
5287 optional double memory = 36;
5288
5289 optional double camera = 37;
5290
5291 optional double wifi_batched_scan = 38;
5292
5293 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005294}
Chenjie Yuab530202018-09-26 12:39:20 -07005295
5296/**
5297 * power_profile.xml and other constants for power model calculations.
5298 * Pulled from PowerProfile.java
5299 */
5300message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005301 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005302}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005303
5304/**
arangelovd5db50e2018-10-12 20:24:39 +01005305 * Logs when a user restriction was added or removed.
5306 *
5307 * Logged from:
5308 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5309 */
5310message UserRestrictionChanged {
5311 // The raw string of the user restriction as defined in UserManager.
5312 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5313 optional string restriction = 1;
5314 // Whether the restriction is enabled or disabled.
5315 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005316}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005317
5318/**
5319 * Pulls process user time and system time. Puller takes a snapshot of all pids
5320 * in the system and returns cpu stats for those that are working at the time.
5321 * Dead pids will be dropped. Kernel processes are excluded.
5322 * Min cool-down is 5 sec.
5323 */
5324message ProcessCpuTime {
5325 optional int32 uid = 1 [(is_uid) = true];
5326
5327 optional string process_name = 2;
5328 // Process cpu time in user space, cumulative from boot/process start
5329 optional int64 user_time_millis = 3;
5330 // Process cpu time in system space, cumulative from boot/process start
5331 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005332}
Misha Wagner5a51e002018-10-03 15:04:09 +01005333
5334/**
5335 * Pulls the CPU usage for each thread.
5336 *
5337 * Read from /proc/$PID/task/$TID/time_in_state files.
5338 *
5339 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5340 * time_in_state files not being present on some phones, have not been addressed. These should be
5341 * considered before a public release.
5342 */
5343message CpuTimePerThreadFreq {
5344 // UID that owns the process.
5345 optional int32 uid = 1 [(is_uid) = true];
5346 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005347 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005348 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005349 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005350 // Name of the process taken from `/proc/$PID/cmdline`.
5351 optional string process_name = 4;
5352 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5353 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005354
5355 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5356 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5357 // frequencies are given here as the alternative is sending eight separate atoms. This method
5358 // significantly reduces the amount of data created
5359 optional int32 frequency1_khz = 6;
5360 optional int32 time1_millis = 7;
5361 optional int32 frequency2_khz = 8;
5362 optional int32 time2_millis = 9;
5363 optional int32 frequency3_khz = 10;
5364 optional int32 time3_millis = 11;
5365 optional int32 frequency4_khz = 12;
5366 optional int32 time4_millis = 13;
5367 optional int32 frequency5_khz = 14;
5368 optional int32 time5_millis = 15;
5369 optional int32 frequency6_khz = 16;
5370 optional int32 time6_millis = 17;
5371 optional int32 frequency7_khz = 18;
5372 optional int32 time7_millis = 19;
5373 optional int32 frequency8_khz = 20;
5374 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005375}
Bookatz75ee60422018-11-09 12:27:37 -08005376
5377/**
Bookatz366a4432018-11-20 09:42:33 -08005378 * Pulls information about the device's build.
5379 */
5380message BuildInformation {
5381 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5382 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5383 optional string fingerprint = 1;
5384
5385 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5386 optional string brand = 2;
5387
5388 // Build.PRODUCT. The name of the overall product.
5389 optional string product = 3;
5390
5391 // Build.DEVICE. The name of the industrial design.
5392 optional string device = 4;
5393
5394 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5395 optional string version_release = 5;
5396
5397 // Build.ID. E.g. a label like "M4-rc20".
5398 optional string id = 6;
5399
5400 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5401 // represent this build.
5402 optional string version_incremental = 7;
5403
5404 // Build.TYPE. The type of build, like "user" or "eng".
5405 optional string type = 8;
5406
5407 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5408 optional string tags = 9;
5409}
5410
5411/**
Adam He420947c2019-01-23 15:59:09 -08005412 * Logs information about mismatched caller for content capture.
5413 *
5414 * Logged from:
5415 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5416 */
5417message ContentCaptureCallerMismatchReported {
5418 optional string intended_package = 1;
5419 optional string calling_package = 2;
5420}
5421
5422/**
5423 * Logs information about content capture service events.
5424 *
5425 * Logged from:
5426 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5427 */
5428message ContentCaptureServiceEvents {
5429 // The type of event.
5430 enum Event {
5431 UNKNOWN = 0;
5432 ON_CONNECTED = 1;
5433 ON_DISCONNECTED = 2;
5434 SET_WHITELIST = 3;
5435 SET_DISABLED = 4;
5436 ON_USER_DATA_REMOVED = 5;
5437 }
5438 optional Event event = 1;
5439 // component/package of content capture service.
5440 optional string service_info = 2;
5441 // component/package of target.
5442 // it's a concatenated list of component/package for SET_WHITELIST event
5443 // separated by " ".
5444 optional string target_info = 3;
5445}
5446
5447/**
5448 * Logs information about content capture session events.
5449 *
5450 * Logged from:
5451 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5452 */
5453message ContentCaptureSessionEvents {
5454 // The type of event.
5455 enum Event {
5456 UNKNOWN = 0;
5457 ON_SESSION_STARTED = 1;
5458 ON_SESSION_FINISHED = 2;
5459 SESSION_NOT_CREATED = 3;
5460 }
5461 optional int32 session_id = 1;
5462 optional Event event = 2;
5463 // (n/a on session finished)
5464 optional int32 state_flags = 3;
5465 // component/package of content capture service.
5466 optional string service_info = 4;
5467 // component/package of app.
5468 // (n/a on session finished)
5469 optional string app_info = 5;
5470 optional bool is_child_session = 6;
5471}
5472
5473/**
5474 * Logs information about session being flushed.
5475 *
5476 * Logged from:
5477 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5478 */
5479message ContentCaptureFlushed {
5480 optional int32 session_id = 1;
5481 // component/package of content capture service.
5482 optional string service_info = 2;
5483 // component/package of app.
5484 optional string app_info = 3;
5485 // session start/finish events
5486 optional int32 child_session_started = 4;
5487 optional int32 child_session_finished = 5;
5488 // count of view events.
5489 optional int32 view_appeared_count = 6;
5490 optional int32 view_disappeared_count = 7;
5491 optional int32 view_text_changed_count = 8;
5492
5493 // Flush stats.
5494 optional int32 max_events = 9;
5495 optional int32 idle_flush_freq = 10;
5496 optional int32 text_flush_freq = 11;
5497 optional int32 flush_reason = 12;
5498}
5499
5500/**
Bookatz75ee60422018-11-09 12:27:37 -08005501 * Pulls on-device BatteryStats power use calculations for the overall device.
5502 */
5503message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005504 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5505 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5506 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5507 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005508}
5509
5510/**
5511 * Pulls on-device BatteryStats power use calculations broken down by uid.
5512 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5513 * that is attributed to non-uid items. They must all be included to get the total power use.
5514 */
5515message DeviceCalculatedPowerBlameUid {
5516 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5517 optional int32 uid = 1 [(is_uid) = true];
5518
Bookatz3dbc13a2018-12-21 12:16:51 -08005519 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5520 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5521 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005522}
5523
5524/**
5525 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5526 * drain type.
5527 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5528 * is attributed uids. They must all be included to get the total power use.
5529 */
5530message DeviceCalculatedPowerBlameOther {
5531 // The type of item whose power use is being reported.
5532 enum DrainType {
5533 AMBIENT_DISPLAY = 0;
5534 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5535 BLUETOOTH = 2;
5536 CAMERA = 3;
5537 // Cell-standby
5538 CELL = 4;
5539 FLASHLIGHT = 5;
5540 IDLE = 6;
5541 MEMORY = 7;
5542 // Amount that total computed drain exceeded the drain estimated using the
5543 // battery level changes and capacity.
5544 OVERCOUNTED = 8;
5545 PHONE = 9;
5546 SCREEN = 10;
5547 // Amount that total computed drain was below the drain estimated using the
5548 // battery level changes and capacity.
5549 UNACCOUNTED = 11;
5550 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5551 WIFI = 13;
5552 }
5553 optional DrainType drain_type = 1;
5554
Bookatz3dbc13a2018-12-21 12:16:51 -08005555 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5556 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5557 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005558}
arangelov4e994062018-11-13 16:12:38 +00005559
5560/**
5561 * Logs device policy features.
5562 *
5563 * Logged from:
5564 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5565 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5566 */
5567message DevicePolicyEvent {
5568 // The event id - unique for each event.
5569 optional android.stats.devicepolicy.EventId event_id = 1;
5570 // The admin package name.
5571 optional string admin_package_name = 2;
5572 // A generic integer parameter.
5573 optional int32 integer_value = 3;
5574 // A generic boolean parameter.
5575 optional bool boolean_value = 4;
5576 // A parameter specifying a time period in milliseconds.
5577 optional uint64 time_period_millis = 5;
5578 // A parameter specifying a list of package names, bundle extras or string parameters.
5579 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5580}
shawnlinea5b66b2018-11-13 15:05:29 +08005581
5582/**
5583 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5584 *
5585 * Logged from:
5586 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5587 */
5588message DocsUILaunchReported {
5589 optional android.stats.docsui.LaunchAction launch_action = 1;
5590 optional bool has_initial_uri = 2;
5591 optional android.stats.docsui.MimeType mime_type = 3;
5592 optional android.stats.docsui.Root initial_root = 4;
5593}
5594
5595/**
5596 * Logs root/app visited event in file managers/picker. Call this when the user
5597 * taps on root/app in hamburger menu.
5598 *
5599 * Logged from:
5600 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5601 */
5602message DocsUIRootVisitedReported {
5603 optional android.stats.docsui.ContextScope scope = 1;
5604 optional android.stats.docsui.Root root = 2;
5605}
5606
5607/**
5608 * Logs file operation stats. Call this when a file operation has completed.
5609 *
5610 * Logged from:
5611 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5612 */
5613message DocsUIFileOperationReported {
5614 optional android.stats.docsui.Provider provider = 1;
5615 optional android.stats.docsui.FileOperation file_op = 2;
5616}
5617
5618/**
5619 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5620 * mode.
5621 *
5622 * Logged from:
5623 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5624 */
5625message DocsUIFileOperationCopyMoveModeReported {
5626 optional android.stats.docsui.FileOperation file_op = 1;
5627 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5628}
5629
5630
5631/**
5632 * Logs file sub operation stats. Call this when a file operation has failed.
5633 *
5634 * Logged from:
5635 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5636 */
5637message DocsUIFileOperationFailureReported {
5638 optional android.stats.docsui.Authority authority = 1;
5639 optional android.stats.docsui.SubFileOperation sub_op = 2;
5640}
5641
5642/**
5643* Logs the cancellation of a file operation. Call this when a job is canceled
5644*
5645* Logged from:
5646* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5647*/
5648message DocsUIFileOperationCanceledReported {
5649 optional android.stats.docsui.FileOperation file_op = 1;
5650}
5651
5652/**
5653 * Logs startup time in milliseconds.
5654 *
5655 * Logged from:
5656 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5657 */
5658message DocsUIStartupMsReported {
5659 optional int32 startup_millis = 1;
5660}
5661
5662/**
5663 * Logs the action that was started by user.
5664 *
5665 * Logged from:
5666 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5667 */
5668message DocsUIUserActionReported {
5669 optional android.stats.docsui.UserAction action = 1;
5670}
5671
5672/**
5673 * Logs the invalid type when invalid scoped access is requested.
5674 *
5675 * Logged from:
5676 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5677 */
5678message DocsUIInvalidScopedAccessRequestReported {
5679 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005680}
Ben Murdochbab399f62018-12-06 11:01:38 +00005681
5682/**
shawnlina75e82d2019-01-07 10:31:12 +08005683 * Logs the package name that launches docsui picker mode.
5684 *
5685 * Logged from:
5686 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5687 */
5688message DocsUIPickerLaunchedFromReported {
5689 optional string package_name = 1;
5690}
5691
5692/**
5693 * Logs the search type.
5694 *
5695 * Logged from:
5696 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5697 */
5698message DocsUISearchTypeReported {
5699 optional android.stats.docsui.SearchType search_type = 1;
5700}
5701
5702/**
5703 * Logs the search mode.
5704 *
5705 * Logged from:
5706 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5707 */
5708message DocsUISearchModeReported {
5709 optional android.stats.docsui.SearchMode search_mode = 1;
5710}
5711
5712/**
5713 * Logs the pick result information.
5714 *
5715 * Logged from:
5716 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5717 */
5718message DocsUIPickResultReported {
5719 optional int32 total_action_count = 1;
5720 optional int64 duration_millis = 2;
5721 optional int32 file_count= 3;
5722 optional bool is_searching = 4;
5723 optional android.stats.docsui.Root picked_from = 5;
5724 optional android.stats.docsui.MimeType mime_type = 6;
5725 optional int32 repeatedly_pick_times = 7;
5726}
5727
5728/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005729 * Logs when an app's memory is compacted.
5730 *
5731 * Logged from:
5732 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5733 */
5734message AppCompacted {
5735 // The pid of the process being compacted.
5736 optional int32 pid = 1;
5737
5738 // The name of the process being compacted.
5739 optional string process_name = 2;
5740
5741 // The type of compaction.
5742 enum Action {
5743 UNKNOWN = 0;
5744 SOME = 1;
5745 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005746 PERSISTENT = 3;
5747 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005748 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005749 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005750
5751 // Total RSS in kilobytes consumed by the process prior to compaction.
5752 optional int64 before_rss_total_kilobytes = 4;
5753
5754 // File RSS in kilobytes consumed by the process prior to compaction.
5755 optional int64 before_rss_file_kilobytes = 5;
5756
5757 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5758 optional int64 before_rss_anon_kilobytes = 6;
5759
5760 // Swap in kilobytes consumed by the process prior to compaction.
5761 optional int64 before_swap_kilobytes = 7;
5762
5763 // Total RSS in kilobytes consumed by the process after compaction.
5764 optional int64 after_rss_total_kilobytes = 8;
5765
5766 // File RSS in kilobytes consumed by the process after compaction.
5767 optional int64 after_rss_file_kilobytes = 9;
5768
5769 // Anonymous RSS in kilobytes consumed by the process after compaction.
5770 optional int64 after_rss_anon_kilobytes = 10;
5771
5772 // Swap in kilobytes consumed by the process after compaction.
5773 optional int64 after_swap_kilobytes = 11;
5774
5775 // The time taken to perform compaction in milliseconds.
5776 optional int64 time_to_compact_millis = 12;
5777
5778 // The last compaction action performed for this app.
5779 optional Action last_action = 13;
5780
Ben Murdoch01720b82018-12-19 18:03:44 +00005781 // The last time that compaction was attempted on this process in milliseconds
5782 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5783 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005784
Ben Murdoch885c21b2019-03-15 18:02:04 +00005785 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005786 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005787
5788 // The process state at the time of compaction.
5789 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005790
5791 // Free ZRAM in kilobytes before compaction.
5792 optional int64 before_zram_free_kilobytes = 17;
5793
5794 // Free ZRAM in kilobytes after compaction.
5795 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005796}
lifr157fc552018-12-12 16:38:04 +08005797
5798/**
lifrb6b90b62019-03-29 00:40:17 +08005799 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5800 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5801 *
lifr1f74b052019-04-16 22:16:30 +08005802 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5803 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5804 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5805 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005806 */
5807message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005808 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005809
lifr1f74b052019-04-16 22:16:30 +08005810 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005811
5812 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005813 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005814
lifr1f74b052019-04-16 22:16:30 +08005815 // Only valid for event_type = EVENT_GETADDRINFO.
5816 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005817
lifr1f74b052019-04-16 22:16:30 +08005818 // Flags passed to android_res_nsend() defined in multinetwork.h
5819 // Only valid for event_type = EVENT_RESNSEND.
5820 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005821
lifrad9becc2019-05-20 11:04:41 +08005822 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005823
5824 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005825 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005826
5827 // Additional pass-through fields opaque to statsd.
5828 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005829 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005830
5831 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5832 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005833}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005834
5835/**
5836 * Logs when a data stall event occurs.
5837 *
5838 * Log from:
5839 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5840 */
5841message DataStallEvent {
5842 // Data stall evaluation type.
5843 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5844 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5845 optional int32 evaluation_type = 1;
5846 // See definition in data_stall_event.proto.
5847 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5848 // See definition in data_stall_event.proto.
5849 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5850 // See definition in data_stall_event.proto.
5851 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5852 // See definition in data_stall_event.proto.
5853 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5854 // See definition in data_stall_event.proto.
5855 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5856}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005857
5858/*
5859 * Logs when RescueParty resets some set of experiment flags.
5860 *
5861 * Logged from:
5862 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5863 */
5864message RescuePartyResetReported {
5865 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5866 optional int32 rescue_level = 1;
5867}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005868
5869/**
5870 * Logs when signed config is received from an APK, and if that config was applied successfully.
5871 * Logged from:
5872 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5873 */
5874message SignedConfigReported {
5875 enum Type {
5876 UNKNOWN_TYPE = 0;
5877 GLOBAL_SETTINGS = 1;
5878 }
5879 optional Type type = 1;
5880
5881 // The final status of the signed config received.
5882 enum Status {
5883 UNKNOWN_STATUS = 0;
5884 APPLIED = 1;
5885 BASE64_FAILURE_CONFIG = 2;
5886 BASE64_FAILURE_SIGNATURE = 3;
5887 SECURITY_EXCEPTION = 4;
5888 INVALID_CONFIG = 5;
5889 OLD_CONFIG = 6;
5890 SIGNATURE_CHECK_FAILED = 7;
5891 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005892 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005893 }
5894 optional Status status = 2;
5895
5896 // The version of the signed config processed.
5897 optional int32 version = 3;
5898
5899 // The package name that the config was extracted from.
5900 optional string from_package = 4;
5901
5902 enum Key {
5903 NO_KEY = 0;
5904 DEBUG = 1;
5905 PRODUCTION = 2;
5906 }
5907 // Which key was used to verify the config.
5908 optional Key verified_with = 5;
5909}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005910
5911/*
5912 * Logs GNSS Network-Initiated (NI) location events.
5913 *
5914 * Logged from:
5915 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5916 */
5917message GnssNiEventReported {
5918 // The type of GnssNiEvent.
5919 enum EventType {
5920 UNKNOWN = 0;
5921 NI_REQUEST = 1;
5922 NI_RESPONSE = 2;
5923 }
5924 optional EventType event_type = 1;
5925
5926 // An ID generated by HAL to associate NI notifications and UI responses.
5927 optional int32 notification_id = 2;
5928
5929 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005930 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005931
5932 // NI requires notification.
5933 optional bool need_notify = 4;
5934
5935 // NI requires verification.
5936 optional bool need_verify = 5;
5937
5938 // NI requires privacy override, no notification/minimal trace.
5939 optional bool privacy_override = 6;
5940
5941 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5942 // seconds.
5943 optional int32 timeout = 7;
5944
5945 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005946 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005947
5948 // String representing the requester of the network inititated location request.
5949 optional string requestor_id = 9;
5950
5951 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5952 // network initiated location request.
5953 optional string text = 10;
5954
5955 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005956 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005957
5958 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005959 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005960
5961 // True if SUPL ES is enabled.
5962 optional bool is_supl_es_enabled = 13;
5963
5964 // True if GNSS location is enabled.
5965 optional bool is_location_enabled = 14;
5966
5967 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005968 optional android.server.location.GnssUserResponseType user_response = 15;
5969}
5970
5971/**
5972 * Logs GNSS non-framework (NFW) location notification.
5973 *
5974 * Logged from:
5975 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5976 */
5977message GnssNfwNotificationReported {
5978 // Package name of the Android proxy application representing the non-framework entity that
5979 // requested location. Set to empty string if unknown.
5980 optional string proxy_app_package_name = 1;
5981
5982 // Protocol stack that initiated the non-framework location request.
5983 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5984
5985 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5986 // set to empty string. This field is opaque to the framework and used for logging purposes.
5987 optional string other_protocol_stack_name = 3;
5988
5989 // Source initiating/receiving the location information.
5990 optional android.server.location.NfwRequestor requestor = 4;
5991
5992 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5993 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5994 // and used for logging purposes.
5995 optional string requestor_id = 5;
5996
5997 // Indicates whether location information was provided for this request.
5998 optional android.server.location.NfwResponseType response_type = 6;
5999
6000 // True if the device is in user initiated emergency session.
6001 optional bool in_emergency_mode = 7;
6002
6003 // True if cached location is provided.
6004 optional bool is_cached_location = 8;
6005
6006 // True if proxy app permission mismatch between framework and GNSS HAL.
6007 optional bool is_permission_mismatched = 9;
6008}
6009
6010/**
6011 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6012 *
6013 * Logged from:
6014 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6015 */
6016message GnssConfigurationReported {
6017 // SUPL host name.
6018 optional string supl_host = 1;
6019
6020 // SUPL port number.
6021 optional int32 supl_port = 2;
6022
6023 // C2K host name.
6024 optional string c2k_host = 3;
6025
6026 // C2K port number.
6027 optional int32 c2k_port = 4;
6028
6029 // The SUPL version requested by Carrier.
6030 optional int32 supl_ver = 5;
6031
6032 // The SUPL mode.
6033 optional android.server.location.SuplMode supl_mode = 6;
6034
6035 // True if NI emergency SUPL restrictions is enabled.
6036 optional bool supl_es = 7;
6037
6038 // LTE Positioning Profile settings
6039 optional android.server.location.LppProfile lpp_profile = 8;
6040
6041 // Positioning protocol on A-Glonass system.
6042 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6043
6044 // True if emergency PDN is used. Otherwise, regular PDN is used.
6045 optional bool use_emergency_pdn_for_emergency_supl= 10;
6046
6047 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6048 optional android.server.location.GpsLock gps_lock = 11;
6049
6050 // Number of seconds to extend the emergency session duration post emergency call.
6051 optional int32 es_extension_sec = 12;
6052
6053 // The full list of package names of proxy Android applications representing the non-framework
6054 // location access entities (on/off the device) for which the framework user has granted
6055 // non-framework location access permission. The package names are concatenated in one string
6056 // with spaces as separators.
6057 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006058}
Jack Yu95b64f32018-12-13 18:26:11 +08006059
6060/**
6061 * Logs when a NFC device's error occurred.
6062 * Logged from:
6063 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6064 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6065 */
6066message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006067 enum Type {
6068 UNKNOWN = 0;
6069 CMD_TIMEOUT = 1;
6070 ERROR_NOTIFICATION = 2;
6071 AID_OVERFLOW = 3;
6072 }
6073 optional Type type = 1;
6074 // If it's nci cmd timeout, log the timeout command.
6075 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006076
Alex Salod7c3eef2019-01-25 14:43:27 -08006077 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006078}
6079
6080/**
6081 * Logs when a NFC device's state changed event
6082 * Logged from:
6083 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6084 */
6085message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006086 enum State {
6087 UNKNOWN = 0;
6088 OFF = 1;
6089 ON = 2;
6090 ON_LOCKED = 3; // Secure Nfc enabled.
6091 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6092 }
6093 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006094}
6095
6096/**
6097 * Logs when a NFC Beam Transaction occurred.
6098 * Logged from:
6099 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6100 */
6101message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006102 enum Operation {
6103 UNKNOWN = 0;
6104 SEND = 1;
6105 RECEIVE = 2;
6106 }
6107 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006108}
6109
6110/**
6111 * Logs when a NFC Card Emulation Transaction occurred.
6112 * Logged from:
6113 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6114 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6115 */
6116message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006117 enum Category {
6118 UNKNOWN = 0;
6119 HCE_PAYMENT = 1;
6120 HCE_OTHER = 2;
6121 OFFHOST = 3;
6122 }
6123 // Transaction belongs to HCE payment or HCE other category, or offhost.
6124 optional Category category = 1;
6125 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6126 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006127}
6128
6129/**
6130 * Logs when a NFC Tag event occurred.
6131 * Logged from:
6132 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6133 */
6134message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006135 enum Type {
6136 UNKNOWN = 0;
6137 URL = 1;
6138 BT_PAIRING = 2;
6139 PROVISION = 3;
6140 WIFI_CONNECT = 4;
6141 APP_LAUNCH = 5;
6142 OTHERS = 6;
6143 }
6144 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006145}
6146
6147/**
6148 * Logs when Hce transaction triggered
6149 * Logged from:
6150 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6151 */
6152message NfcHceTransactionOccurred {
6153 // The latency period(in microseconds) it took for the first HCE data
6154 // exchange.
6155 optional uint32 latency_micros = 1;
6156}
6157
6158/**
6159 * Logs when SecureElement state event changed
6160 * Logged from:
6161 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6162 */
6163message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006164 enum State {
6165 UNKNOWN = 0;
6166 INITIALIZED = 1;
6167 DISCONNECTED = 2;
6168 CONNECTED = 3;
6169 HALCRASH = 4;
6170 }
6171 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006172
Alex Salod7c3eef2019-01-25 14:43:27 -08006173 optional string state_change_reason = 2;
6174 // SIMx or eSEx.
6175 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006176}
6177
6178/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006179 * Information about a permission grant request
6180 */
6181message PermissionGrantRequestResultReported {
6182 // unique value identifying an API call. A API call might result in multiple of these atoms
6183 optional int64 request_id = 1;
6184
6185 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006186 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006187
6188 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006189 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006190
6191 // The permission to be granted
6192 optional string permission_name = 4;
6193
6194 // If the permission was explicitly requested via the API or added by the system
6195 optional bool is_implicit = 5;
6196
6197 enum Result {
6198 UNDEFINED = 0;
6199 // permission request was ignored
6200 IGNORED = 1;
6201 // permission request was ignored because it was user fixed
6202 IGNORED_USER_FIXED = 2;
6203 // permission request was ignored because it was policy fixed
6204 IGNORED_POLICY_FIXED = 3;
6205 // permission was granted by user action
6206 USER_GRANTED = 4;
6207 // permission was automatically granted
6208 AUTO_GRANTED = 5;
6209 // permission was denied by user action
6210 USER_DENIED = 6;
6211 // permission was denied with prejudice by the user
6212 USER_DENIED_WITH_PREJUDICE = 7;
6213 // permission was automatically denied
6214 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006215 // permission request was ignored because permission is restricted
6216 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006217 // one time permission was granted by user action
6218 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006219 // user ignored request by leaving the request screen without choosing any option
6220 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006221 // user granted the permission after being linked to settings
6222 USER_GRANTED_IN_SETTINGS = 12;
6223 // user denied the permission after being linked to settings
6224 USER_DENIED_IN_SETTINGS = 13;
6225 // user denied the permission with prejudice after being linked to settings
6226 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6227 // permission was automatically revoked after one-time permission expired
6228 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006229 }
6230 // The result of the permission grant
6231 optional Result result = 6;
6232}
6233
6234/**
Jack Yu95b64f32018-12-13 18:26:11 +08006235 * Logs when Omapi API used
6236 * Logged from:
6237 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6238 */
6239message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006240 enum Operation {
6241 UNKNOWN = 0;
6242 OPEN_CHANNEL = 1;
6243 }
6244 optional Operation operation = 1;
6245 // SIMx or eSEx.
6246 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006247
Alex Salod7c3eef2019-01-25 14:43:27 -08006248 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006249}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006250
6251/**
Alex Saloa060aee2019-01-21 14:36:41 -08006252 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6253 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006254 * Logged from:
6255 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6256 */
6257message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006258 optional int64 dispatch_latency_millis = 1;
6259}
6260
6261/**
6262 * Logs AttentionManagerService attention check result.
6263 *
6264 * Logged from:
6265 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6266 */
6267message AttentionManagerServiceResultReported {
6268 // See core/java/android/service/attention/AttentionService.java
6269 enum AttentionCheckResult {
6270 UNKNOWN = 20;
6271 ATTENTION_SUCCESS_ABSENT = 0;
6272 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006273 ATTENTION_FAILURE_UNKNOWN = 2;
6274 ATTENTION_FAILURE_CANCELLED = 3;
6275 ATTENTION_FAILURE_PREEMPTED = 4;
6276 ATTENTION_FAILURE_TIMED_OUT = 5;
6277 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006278 }
6279 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006280}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006281
6282/**
6283 * Logs when an adb connection changes state.
6284 *
6285 * Logged from:
6286 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6287 */
6288message AdbConnectionChanged {
6289 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6290 // previously selected for this system.
6291 optional int64 last_connection_time_millis = 1;
6292
6293 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6294 // to reconnect via adb without user interaction.
6295 optional int64 auth_window_millis = 2;
6296
6297 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6298 optional android.debug.AdbConnectionStateEnum state = 3;
6299
6300 // True if the 'always allow' option was selected for this system.
6301 optional bool always_allow = 4;
6302}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006303
6304/*
6305 * Logs the reported speech DSP status.
6306 *
6307 * Logged from:
6308 * Vendor audio implementation.
6309 */
6310message SpeechDspStatReported {
6311 // The total Speech DSP uptime in milliseconds.
6312 optional int32 total_uptime_millis = 1;
6313 // The total Speech DSP downtime in milliseconds.
6314 optional int32 total_downtime_millis = 2;
6315 optional int32 total_crash_count = 3;
6316 optional int32 total_recover_count = 4;
6317}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006318
6319/**
6320 * Logs USB connector contaminant status.
6321 *
6322 * Logged from: USB Service.
6323 */
6324message UsbContaminantReported {
6325 optional string id = 1;
6326 optional android.service.usb.ContaminantPresenceStatus status = 2;
6327}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006328
6329/**
6330 * This atom is for debugging purpose.
6331 */
6332message DebugElapsedClock {
6333 // Monotically increasing value for each pull.
6334 optional int64 pull_count = 1;
6335 // Time from System.elapsedRealtime.
6336 optional int64 elapsed_clock_millis = 2;
6337 // Time from System.elapsedRealtime.
6338 optional int64 same_elapsed_clock_millis = 3;
6339 // Diff between current elapsed time and elapsed time from previous pull.
6340 optional int64 elapsed_clock_diff_millis = 4;
6341
6342 enum Type {
6343 TYPE_UNKNOWN = 0;
6344 ALWAYS_PRESENT = 1;
6345 PRESENT_ON_ODD_PULLS = 2;
6346 }
6347 // Type of behavior for the pulled data.
6348 optional Type type = 5;
6349}
6350
6351/**
6352 * This atom is for debugging purpose.
6353 */
6354message DebugFailingElapsedClock {
6355 // Monotically increasing value for each pull.
6356 optional int64 pull_count = 1;
6357 // Time from System.elapsedRealtime.
6358 optional int64 elapsed_clock_millis = 2;
6359 // Time from System.elapsedRealtime.
6360 optional int64 same_elapsed_clock_millis = 3;
6361 // Diff between current elapsed time and elapsed time from previous pull.
6362 optional int64 elapsed_clock_diff_millis = 4;
6363}
Steven Wuacef6bb2019-01-23 14:21:17 -05006364
6365/** Logs System UI bubbles event changed.
6366 *
6367 * Logged from:
6368 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6369 */
6370message BubbleUIChanged {
6371
6372 // The app package that is posting the bubble.
6373 optional string package_name = 1;
6374
6375 // The notification channel that is posting the bubble.
6376 optional string notification_channel = 2;
6377
6378 // The notification id associated with the posted bubble.
6379 optional int32 notification_id = 3;
6380
6381 // The position of the bubble within the bubble stack.
6382 optional int32 position = 4;
6383
6384 // The total number of bubbles within the bubble stack.
6385 optional int32 total_number = 5;
6386
6387 // User interactions with the bubble.
6388 enum Action {
6389 UNKNOWN = 0;
6390 POSTED = 1;
6391 UPDATED = 2;
6392 EXPANDED = 3;
6393 COLLAPSED = 4;
6394 DISMISSED = 5;
6395 STACK_DISMISSED = 6;
6396 STACK_MOVED = 7;
6397 HEADER_GO_TO_APP = 8;
6398 HEADER_GO_TO_SETTINGS = 9;
6399 PERMISSION_OPT_IN = 10;
6400 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006401 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006402 SWIPE_LEFT = 13;
6403 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006404 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006405 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006406 }
6407 optional Action action = 6;
6408
6409 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6410 optional float normalized_x_position = 7;
6411 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006412
6413 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6414 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006415
6416 // Whether the bubble is an on-going one.
6417 optional bool is_ongoing = 10;
6418
6419 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006420 // This is deprecated and the value should be ignored.
6421 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006422}
Kweku Adams8845d012018-12-11 20:06:45 -08006423
6424/**
Steven Wu552f63f2019-02-05 13:41:36 -05006425 * Logs System UI bubbles developer errors.
6426 *
6427 * Logged from:
6428 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6429 */
6430message BubbleDeveloperErrorReported {
6431
6432 // The app package that is posting the bubble.
6433 optional string package_name = 1;
6434
6435 // Bubble developer error type enums.
6436 enum Error {
6437 UNKNOWN = 0;
6438 ACTIVITY_INFO_MISSING = 1;
6439 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6440 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6441 }
6442 optional Error error = 2 [default = UNKNOWN];
6443}
6444
6445/**
Kweku Adams8845d012018-12-11 20:06:45 -08006446 * Logs that a constraint for a scheduled job has changed.
6447 *
6448 * Logged from:
6449 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6450 */
6451message ScheduledJobConstraintChanged {
6452 repeated AttributionNode attribution_node = 1;
6453
6454 // Name of the job.
6455 optional string job_name = 2;
6456
6457 optional com.android.server.job.ConstraintEnum constraint = 3;
6458
6459 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006460 UNKNOWN = 0;
6461 UNSATISFIED = 1;
6462 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006463 }
6464 optional State state = 4;
6465}
Alex Salod7c3eef2019-01-25 14:43:27 -08006466
6467/**
6468 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6469 * returns true.
6470 *
6471 * Logged from:
6472 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6473 */
6474message ScreenTimeoutExtensionReported {
6475 // Describes how many times in a row did the power manager reset the screen off timeout.
6476 optional uint32 consecutive_timeout_extended_count = 1;
6477}
Hui Yu885aca12019-01-10 17:11:34 -08006478
6479/*
6480* Logs number of milliseconds it takes to start a process.
6481* The definition of app process start time is from the app launch time to
6482* the time that Zygote finished forking the app process and loaded the
6483* application package's java classes.
6484
6485* This metric is different from AppStartOccurred which is for foreground
6486* activity only.
6487
6488* ProcessStartTime can report all processes (both foreground and background)
6489* start time.
6490*
6491* Logged from:
6492* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6493*/
6494message ProcessStartTime {
6495 // The uid of the ProcessRecord.
6496 optional int32 uid = 1 [(is_uid) = true];
6497
6498 // The process pid.
6499 optional int32 pid = 2;
6500
6501 // The process name.
6502 // Usually package name, "system" for system server.
6503 // Provided by ActivityManagerService.
6504 optional string process_name = 3;
6505
6506 enum StartType {
6507 UNKNOWN = 0;
6508 WARM = 1;
6509 HOT = 2;
6510 COLD = 3;
6511 }
6512
6513 // The start type.
6514 optional StartType type = 4;
6515
6516 // The elapsed realtime at the start of the process.
6517 optional int64 process_start_time_millis = 5;
6518
6519 // Number of milliseconds it takes to reach bind application.
6520 optional int32 bind_application_delay_millis = 6;
6521
6522 // Number of milliseconds it takes to finish start of the process.
6523 optional int32 process_start_delay_millis = 7;
6524
6525 // hostingType field in ProcessRecord, the component type such as "activity",
6526 // "service", "content provider", "broadcast" or other strings.
6527 optional string hosting_type = 8;
6528
6529 // hostingNameStr field in ProcessRecord. The component class name that runs
6530 // in this process.
6531 optional string hosting_name = 9;
6532}
6533
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006534/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006535 * Track Media Codec usage
6536 * Logged from:
6537 * frameworks/av/media/libstagefright/MediaCodec.cpp
6538 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6539 */
6540message MediametricsCodecReported {
6541 optional int64 timestamp_nanos = 1;
6542 optional string package_name = 2;
6543 optional int64 package_version_code = 3;
6544 optional int64 media_apex_version = 4;
6545
6546 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6547}
6548
6549/**
6550 * Track Media Extractor (pulling video/audio streams out of containers) usage
6551 * Logged from:
6552 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6553 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6554 */
6555message MediametricsExtractorReported {
6556 optional int64 timestamp_nanos = 1;
6557 optional string package_name = 2;
6558 optional int64 package_version_code = 3;
6559 optional int64 media_apex_version = 4;
6560
6561 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6562}
6563
6564/**
6565 * Track how we arbitrate between microphone/input requests.
6566 * Logged from
6567 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6568 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6569 */
6570message MediametricsAudiopolicyReported {
6571 optional int64 timestamp_nanos = 1;
6572 optional string package_name = 2;
6573 optional int64 package_version_code = 3;
6574 optional int64 media_apex_version = 4;
6575
6576 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6577}
6578
6579/**
6580 * Track how we arbitrate between microphone requests.
6581 * Logged from
6582 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6583 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6584 */
6585message MediametricsAudiorecordReported {
6586 optional int64 timestamp_nanos = 1;
6587 optional string package_name = 2;
6588 optional int64 package_version_code = 3;
6589 optional int64 media_apex_version = 4;
6590
6591 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6592}
6593
6594/**
6595 * Track how we arbitrate between microphone/input requests.
6596 * Logged from
6597 * frameworks/av/media/libnblog/ReportPerformance.cpp
6598 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6599 */
6600message MediametricsAudiothreadReported {
6601 optional int64 timestamp_nanos = 1;
6602 optional string package_name = 2;
6603 optional int64 package_version_code = 3;
6604 optional int64 media_apex_version = 4;
6605
6606 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6607}
6608
6609/**
6610 * Track how we arbitrate between microphone/input requests.
6611 * Logged from
6612 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6613 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6614 */
6615message MediametricsAudiotrackReported {
6616 optional int64 timestamp_nanos = 1;
6617 optional string package_name = 2;
6618 optional int64 package_version_code = 3;
6619 optional int64 media_apex_version = 4;
6620
6621 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6622}
6623
6624/**
6625 * Track information about DRM framework performance
6626 * Logged from
6627 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6628 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6629 */
6630message MediametricsMediadrmReported {
6631 optional int64 timestamp_nanos = 1;
6632 optional string package_name = 2;
6633 optional int64 package_version_code = 3;
6634 optional int64 media_apex_version = 4;
6635
6636 // vendor+description tell about which DRM plugin is in use on this device
6637 optional string vendor = 5;
6638 optional string description = 6;
6639 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6640 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6641}
6642
6643/**
6644 * Track information about the widevine DRM plugin performance
6645 * Logged from
6646 * vendor/widevine/libwvdrmengine/cdm/metrics
6647 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6648 */
6649message MediametricsDrmWidevineReported {
6650 optional int64 timestamp_nanos = 1;
6651 optional string package_name = 2;
6652 optional int64 package_version_code = 3;
6653 optional int64 media_apex_version = 4;
6654
6655 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6656}
6657
6658/**
6659 * Track information about recordings (e.g. camcorder)
6660 * Logged from
6661 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6662 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6663 */
6664message MediametricsRecorderReported {
6665 optional int64 timestamp_nanos = 1;
6666 optional string package_name = 2;
6667 optional int64 package_version_code = 3;
6668 optional int64 media_apex_version = 4;
6669
6670 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6671}
6672
6673/**
6674 * Track Media Player usage
6675 * Logged from:
6676 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6677 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6678 */
6679message MediametricsNuPlayerReported {
6680 optional int64 timestamp_nanos = 1;
6681 optional string package_name = 2;
6682 optional int64 package_version_code = 3;
6683 optional int64 media_apex_version = 4;
6684
6685 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6686}
6687
6688/**
Robert Shiha4beed32019-08-19 14:15:23 -07006689 * Track Legacy DRM usage
6690 * Logged from
6691 * frameworks/av/drm/drmserver/DrmManager.cpp
6692 */
6693message MediametricsDrmManagerReported {
6694 optional int64 timestamp_nanos = 1;
6695 optional string package_name = 2;
6696 optional int64 package_version_code = 3;
6697 optional int64 media_apex_version = 4;
6698
6699 enum Method {
6700 METHOD_NOT_FOUND = -1;
6701 GET_CONSTRAINTS = 0;
6702 GET_METADATA = 1;
6703 CAN_HANDLE = 2;
6704 PROCESS_DRM_INFO = 3;
6705 ACQUIRE_DRM_INFO = 4;
6706 SAVE_RIGHTS = 5;
6707 GET_ORIGINAL_MIME_TYPE = 6;
6708 GET_DRM_OBJECT_TYPE = 7;
6709 CHECK_RIGHTS_STATUS = 8;
6710 REMOVE_RIGHTS = 9;
6711 REMOVE_ALL_RIGHTS = 10;
6712 OPEN_CONVERT_SESSION = 11;
6713 OPEN_DECRYPT_SESSION = 12;
6714 }
6715
6716 // plugin_id+description inform which Legacy DRM plugins are still in use on device
6717 optional string plugin_id = 5;
6718 optional string description = 6;
6719 optional Method method = 7;
6720 optional string mime_types = 8;
6721}
6722
6723/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006724 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00006725 * Pulled from: StatsCompanionService
6726*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006727message DangerousPermissionState {
6728 // Name of the permission
6729 optional string permission_name = 1;
6730
6731 // Uid of the package
6732 optional int32 uid = 2 [(is_uid) = true];
6733
6734 // Package requesting the permission
6735 optional string package_name = 3;
6736
6737 // If the permission is granted to the uid
6738 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006739
6740 // Permission flags as per android.content.pm.PermissionFlags
6741 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006742}
6743
Michael Groover4a0ca942019-01-24 17:41:25 -08006744/**
6745 * Logs when a package is denied access to a device identifier based on the new access requirements.
6746 *
6747 * Logged from:
6748 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6749 */
6750message DeviceIdentifierAccessDenied {
6751 // The name of the package denied access to the requested device identifier.
6752 optional string package_name = 1;
6753
6754 // The name of the device identifier method the package attempted to invoke.
6755 optional string method_name = 2;
6756
6757 // True if the package is preinstalled.
6758 optional bool is_preinstalled = 3;
6759
6760 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08006761 // Starting from Android 11, this boolean is not set and will always be false.
6762 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08006763}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006764
6765/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006766 * Pulls the ongoing mainline install train version code.
6767 * Pulled from StatsCompanionService
6768 */
6769message TrainInfo {
6770 optional int64 train_version_code = 1;
6771
6772 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006773
6774 optional string train_name = 3;
6775
6776 enum Status {
6777 UNKNOWN = 0;
6778 INSTALL_REQUESTED = 1;
6779 INSTALL_STARTED = 2;
6780 INSTALL_STAGED_NOT_READY = 3;
6781 INSTALL_STAGED_READY = 4;
6782 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006783 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6784 // and INSTALL_FAILURE_COMMIT.
6785 INSTALL_FAILURE = 6 [deprecated = true];
6786 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006787 INSTALL_CANCELLED = 7;
6788 INSTALLER_ROLLBACK_REQUESTED = 8;
6789 INSTALLER_ROLLBACK_INITIATED = 9;
6790 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6791 INSTALLER_ROLLBACK_STAGED = 11;
6792 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6793 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6794 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6795 INSTALLER_ROLLBACK_SUCCESS = 15;
6796 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006797 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6798 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6799 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6800 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6801 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6802 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006803 INSTALL_FAILURE_DOWNLOAD = 23;
6804 INSTALL_FAILURE_STATE_MISMATCH = 24;
6805 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006806 }
6807 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006808}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006809
6810/**
6811 * Logs the gesture stage changed event.
6812 *
6813 * Logged from:
6814 * frameworks/base/packages/SystemUI/
6815 */
6816message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006817 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006818}
6819
6820/**
6821 * Logs the feedback type.
6822 *
6823 * Logged from:
6824 * frameworks/base/packages/SystemUI/
6825 */
6826message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006827 // Whether or not the gesture was used.
6828 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006829}
6830
6831/**
6832 * Logs the progress.
6833 *
6834 * Logged from:
6835 * frameworks/base/packages/SystemUI/
6836 */
6837message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006838 // [0,100] progress for the assist gesture.
6839 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006840}
Neil Fullerdb14b482019-02-05 19:44:44 +00006841
6842/*
6843 * Information about the time zone data on a device.
6844 */
6845message TimeZoneDataInfo {
6846 // A version identifier for the data set on device. e.g. "2018i"
6847 optional string tzdb_version = 1;
6848}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006849
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006850/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006851 * Logs the GPU stats global health information.
6852 *
6853 * Logged from:
6854 * frameworks/native/services/gpuservice/gpustats/
6855 */
6856message GpuStatsGlobalInfo {
6857 // Package name of the gpu driver.
6858 optional string driver_package_name = 1;
6859
6860 // Version name of the gpu driver.
6861 optional string driver_version_name = 2;
6862
6863 // Version code of the gpu driver.
6864 optional int64 driver_version_code = 3;
6865
6866 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6867 optional int64 driver_build_time = 4;
6868
6869 // Total count of the gl driver gets loaded.
6870 optional int64 gl_loading_count = 5;
6871
6872 // Total count of the gl driver fails to be loaded.
6873 optional int64 gl_loading_failure_count = 6;
6874
6875 // Total count of the Vulkan driver gets loaded.
6876 optional int64 vk_loading_count = 7;
6877
6878 // Total count of the Vulkan driver fails to be loaded.
6879 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006880
6881 // Api version of the system Vulkan driver.
6882 optional int32 vulkan_version = 9;
6883
6884 // Api version of the system CPU Vulkan driver.
6885 optional int32 cpu_vulkan_version = 10;
6886
6887 // Api version of the system GLES driver.
6888 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006889
6890 // Total count of the angle driver gets loaded.
6891 optional int64 angle_loading_count = 12;
6892
6893 // Total count of the angle driver fails to be loaded.
6894 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006895}
6896
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006897/**
6898 * GPU driver loading time info.
6899 */
6900message GpuDriverLoadingTime {
6901 // List of all the driver loading times for this app. The list size is
6902 // capped at 50.
6903 repeated int64 driver_loading_time = 1;
6904}
6905
6906/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006907 * Logs the GPU stats per app health information.
6908 *
6909 * Logged from:
6910 * frameworks/native/services/gpuservice/gpustats/
6911 */
6912message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006913 // Package name of the application that loads the gpu driver. Total number
6914 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006915 optional string app_package_name = 1;
6916
6917 // Version code of the gpu driver this app loads.
6918 optional int64 driver_version_code = 2;
6919
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006920 // gl driver loading time info.
6921 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6922 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006923
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006924 // Vulkan driver loading time info.
6925 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6926 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006927
6928 // Angle driver loading time info.
6929 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6930 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006931
6932 // CPU Vulkan implementation is in use.
6933 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07006934
6935 // App is not doing pre-rotation correctly.
6936 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08006937
6938 // App creates GLESv1 context.
6939 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006940}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006941
6942/*
6943 * Logs the size of the system ion heap.
6944 *
6945 * Pulled from StatsCompanionService.
6946 */
6947message SystemIonHeapSize {
6948 // Size of the system ion heap in bytes.
6949 optional int64 size_in_bytes = 1;
6950}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006951
Rafal Slawik77987ed2019-06-17 12:28:23 +01006952/*
6953 * Logs the per-process size of the system ion heap.
6954 *
6955 * Pulled from StatsCompanionService.
6956 */
6957message ProcessSystemIonHeapSize {
6958 // The uid if available. -1 means not available.
6959 optional int32 uid = 1 [(is_uid) = true];
6960
6961 // The process name (from /proc/PID/cmdline).
6962 optional string process_name = 2;
6963
6964 // Sum of sizes of all allocations.
6965 optional int32 total_size_in_kilobytes = 3;
6966
6967 // Number of allocations.
6968 optional int32 allocation_count = 4;
6969
6970 // Size of the largest allocation.
6971 optional int32 max_size_in_kilobytes = 5;
6972}
6973
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006974/**
6975 * Push network stack events.
6976 *
6977 * Log from:
6978 * frameworks/base/packages/NetworkStack/
6979 */
6980message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006981 // The id that indicates the event reported from NetworkStack.
6982 optional int32 event_id = 1;
6983 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006984 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6985}
Carmen Agimofa769c152019-03-04 14:39:14 +00006986
6987/**
6988 * Logs the apps that are installed on the external storage.
6989 * Pulled from:
6990 * StatsCompanionService
6991 */
6992message AppsOnExternalStorageInfo {
6993 // The type of the external storage.
6994 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6995 // The name of the package that is installed on the external storage.
6996 optional string package_name = 2;
6997}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006998
6999/**
7000 * Logs the settings related to Face.
7001 * Logged from:
7002 * frameworks/base/services/core/java/com/android/server/stats
7003 */
7004message FaceSettings {
7005 // Whether or not face unlock is allowed on Keyguard.
7006 optional bool unlock_keyguard_enabled = 1;
7007 // Whether or not face unlock dismisses the Keyguard.
7008 optional bool unlock_dismisses_keyguard = 2;
7009 // Whether or not face unlock requires attention.
7010 optional bool unlock_attention_required = 3;
7011 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7012 optional bool unlock_app_enabled = 4;
7013 // Whether or not face unlock always requires user confirmation.
7014 optional bool unlock_always_require_confirmation = 5;
7015 // Whether or not a diverse set of poses are required during enrollment.
7016 optional bool unlock_diversity_required = 6;
7017}
Maggie White442b6312019-04-05 16:26:44 -07007018
7019/**
7020 * Logs cooling devices maintained by the kernel.
7021 *
7022 * Pulled from StatsCompanionService.java
7023 */
7024message CoolingDevice {
7025 // The type of cooling device being reported. Eg. CPU, GPU...
7026 optional android.os.CoolingTypeEnum device_location = 1;
7027 // The name of the cooling device source. Eg. CPU0
7028 optional string device_name = 2;
7029 // Current throttle state of the cooling device. The value can any unsigned
7030 // integer between 0 and max_state defined in its driver. 0 means device is
7031 // not in throttling, higher value means deeper throttling.
7032 optional int32 state = 3;
7033}
Ben Blount763a5d52019-04-10 11:48:58 -07007034
7035/**
7036 * Intelligence has several counter-type events that don't warrant a
7037 * full separate atom. These are primarily API call counters but also include
7038 * counters for feature usage and specific failure modes.
7039 *
7040 * Logged from the Intelligence mainline module.
7041 */
7042message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007043 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007044 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007045 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007046 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007047 // How many times the event occured (to report a batch of high frequency events).
7048 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007049 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007050 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007051}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007052
7053/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007054 * Logs when Car Power state changed.
7055 *
7056 * Logged from:
7057 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7058 */
7059message CarPowerStateChanged {
7060 // States come from CpmsState in CarPowerManagementService.java.
7061 enum State {
7062 WAIT_FOR_VHAL = 0;
7063 ON = 1;
7064 SHUTDOWN_PREPARE = 2;
7065 WAIT_FOR_FINISH = 3;
7066 SUSPEND = 4;
7067 SIMULATE_SLEEP = 5;
7068 }
7069 optional State state = 1;
7070}
7071
7072/**
7073 * Logs whether GarageMode is entered.
7074 *
7075 * Logged from:
7076 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7077 */
7078message GarageModeInfo {
7079 // Whether GarageMode is entered.
7080 optional bool is_garage_mode = 1;
7081}
Martijn Coenencd95d462019-04-25 17:09:45 +02007082
7083/**
7084 * Historical app ops data per package.
7085 */
7086message AppOps {
7087 // Uid of the package requesting the op
7088 optional int32 uid = 1 [(is_uid) = true];
7089
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007090 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007091 optional string package_name = 2;
7092
7093 // operation id; maps to the OP_* constants in AppOpsManager.java
7094 optional int32 op_id = 3;
7095
7096 // The number of times the op was granted while the app was in the
7097 // foreground (only for trusted requests)
7098 optional int64 trusted_foreground_granted_count = 4;
7099
7100 // The number of times the op was granted while the app was in the
7101 // background (only for trusted requests)
7102 optional int64 trusted_background_granted_count = 5;
7103
7104 // The number of times the op was rejected while the app was in the
7105 // foreground (only for trusted requests)
7106 optional int64 trusted_foreground_rejected_count = 6;
7107
7108 // The number of times the op was rejected while the app was in the
7109 // background (only for trusted requests)
7110 optional int64 trusted_background_rejected_count = 7;
7111
7112 // For long-running operations, total duration of the operation
7113 // while the app was in the foreground (only for trusted requests)
7114 optional int64 trusted_foreground_duration_millis = 8;
7115
7116 // For long-running operations, total duration of the operation
7117 // while the app was in the background (only for trusted requests)
7118 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007119
7120 // Whether AppOps is guarded by Runtime permission
7121 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007122}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007123
7124/**
7125 * Location Manager API Usage information(e.g. API under usage,
7126 * API call's parameters).
7127 * Logged from:
7128 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7129 */
7130message LocationManagerApiUsageReported {
7131
7132 // Indicating if usage starts or usage ends.
7133 optional android.stats.location.UsageState state = 1;
7134
7135 // LocationManagerService's API in use.
7136 // We can identify which API from LocationManager is
7137 // invoking current LMS API by the combination of
7138 // API parameter(e.g. is_listener_null, is_intent_null,
7139 // is_location_request_null)
7140 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7141
7142 // Name of the package calling the API.
7143 optional string calling_package_name = 3;
7144
7145 // Type of the location provider.
7146 optional android.stats.location.ProviderType provider = 4;
7147
7148 // Quality of the location request
7149 optional android.stats.location.LocationRequestQuality quality = 5;
7150
7151 // The desired interval for active location updates, in milliseconds.
7152 // Bucketized to reduce cardinality.
7153 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7154
7155 // Minimum distance between location updates, in meters.
7156 // Bucketized to reduce cardinality.
7157 optional android.stats.location.SmallestDisplacementBucket
7158 bucketized_smallest_displacement = 7;
7159
7160 // The number of location updates.
7161 optional int64 num_updates = 8;
7162
7163 // The request expiration time, in millisecond since boot.
7164 // Bucketized to reduce cardinality.
7165 optional android.stats.location.ExpirationBucket
7166 bucketized_expire_in = 9;
7167
7168 // Type of Callback passed in for this API.
7169 optional android.stats.location.CallbackType callback_type = 10;
7170
7171 // The radius of the central point of the alert
7172 // region, in meters. Only for API REQUEST_GEOFENCE.
7173 // Bucketized to reduce cardinality.
7174 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7175
7176 // Activity Importance of API caller.
7177 // Categorized to 3 types that are interesting from location's perspective.
7178 optional android.stats.location.ActivityImportance activiy_importance = 12;
7179}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007180
7181/**
7182 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7183 */
7184message ReviewPermissionsFragmentResultReported {
7185 // unique value identifying a permission group change. A permission group change might result
7186 // in multiple of these atoms
7187 optional int64 change_id = 1;
7188
7189 // UID of package the permission belongs to
7190 optional int32 uid = 2 [(is_uid) = true];
7191
7192 // Name of package the permission belongs to
7193 optional string package_name = 3;
7194
7195 // The permission to be granted
7196 optional string permission_name = 4;
7197
7198 // The result of the permission grant
7199 optional bool permission_granted = 5;
7200}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007201
7202/**
7203* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7204* Logged from: RuntimePermissionUpdgradeController
7205*/
7206message RuntimePermissionsUpgradeResult {
7207 // Permission granted as result of upgrade
7208 optional string permission_name = 1;
7209
7210 // UID of package granted permission
7211 optional int32 uid = 2 [(is_uid) = true];
7212
7213 // Name of package granted permission
7214 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007215}
7216
7217/**
7218* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7219*/
7220message GrantPermissionsActivityButtonActions {
7221 // Permission granted as result of upgrade
7222 optional string permission_group_name = 1;
7223
7224 // UID of package granted permission
7225 optional int32 uid = 2 [(is_uid) = true];
7226
7227 // Name of package requesting permission
7228 optional string package_name = 3;
7229
7230 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7231 // LABEL_ constants in GrantPermissionActivity.java
7232 optional int32 buttons_presented = 4;
7233
7234 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7235 optional int32 button_clicked = 5;
7236}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007237
7238/**
7239 * Information about LocationAccessCheck notification presented to user
7240 */
7241message LocationAccessCheckNotificationAction {
7242
7243 // id which identifies single session of user interacting with permission controller
7244 optional int64 session_id = 1;
7245
7246 // Uid of package for which location access check is presented
7247 optional int32 package_uid = 2;
7248
7249 // Name of package for which location access check is presented
7250 optional string package_name = 3;
7251
7252 enum Result {
7253 UNDEFINED = 0;
7254 // notification was presented to the user
7255 NOTIFICATION_PRESENTED = 1;
7256 // notification was declined by the user
7257 NOTIFICATION_DECLINED = 2;
7258 // notification was clicked by the user
7259 NOTIFICATION_CLICKED = 3;
7260 }
7261
7262 // View / interaction recorded
7263 optional Result result = 4;
7264}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007265
7266/**
7267 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7268 */
7269message AppPermissionFragmentActionReported {
7270 // id which identifies single session of user interacting with permission controller
7271 optional int64 session_id = 1;
7272
7273 // unique value identifying a permission group change. A permission group change might result
7274 // in multiple of these atoms
7275 optional int64 change_id = 2;
7276
7277 // UID of package the permission belongs to
7278 optional int32 uid = 3 [(is_uid) = true];
7279
7280 // Name of package the permission belongs to
7281 optional string package_name = 4;
7282
7283 // The permission to be granted
7284 optional string permission_name = 5;
7285
7286 // The result of the permission grant
7287 optional bool permission_granted = 6;
7288}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007289
7290/**
7291* Information about a AppPermissionFragment viewed by user
7292*/
7293message AppPermissionFragmentViewed {
7294 // id which identifies single session of user interacting with permission controller
7295 optional int64 session_id = 1;
7296
7297 // UID of package for which permissions are viewed
7298 optional int32 uid = 2 [(is_uid) = true];
7299
7300 // Name of package for which permissions are viewed
7301 optional string package_name = 3;
7302
7303 // Permission group viewed
7304 optional string permission_group_name = 4;
7305}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007306
7307/**
7308* Information about a AppPermissionsFragment viewed by user
7309*/
7310message AppPermissionsFragmentViewed {
7311 // id which identifies single session of user interacting with permission controller
7312 optional int64 session_id = 1;
7313
7314 // id which identifies single view as every view might have several logging records
7315 // with different package information attached
7316 optional int64 view_id = 2;
7317
7318 // Permission group viewed
7319 optional string permission_group_name = 3;
7320
7321 // UID of package for which permissions are viewed
7322 optional int32 uid = 4 [(is_uid) = true];
7323
7324 // Name of package for which permissions are viewed
7325 optional string package_name = 5;
7326
7327 // Category in which permission is included
7328 enum Category {
7329 UNDEFINED = 0;
7330 ALLOWED = 1;
7331 ALLOWED_FOREGROUND = 2;
7332 DENIED = 3;
7333 }
7334 optional Category category = 6;
7335}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007336
7337/**
7338* Information about a PermissionAppsFragment viewed by user.
7339* Logged from ui/handheld/PermissionAppsFragment.java
7340*/
7341message PermissionAppsFragmentViewed {
7342 // id which identifies single session of user interacting with permission controller
7343 optional int64 session_id = 1;
7344
7345 // id which identifies single view as every view might have several logging records
7346 // with different package information attached
7347 optional int64 view_id = 2;
7348
7349 // Permission group viewed
7350 optional string permission_group_name = 3;
7351
7352 // UID of package for which permissions are viewed
7353 optional int32 uid = 4 [(is_uid) = true];
7354
7355 // Name of package for which permissions are viewed
7356 optional string package_name = 5;
7357
7358 // Category in which app is included
7359 enum Category {
7360 UNDEFINED = 0;
7361 ALLOWED = 1;
7362 ALLOWED_FOREGROUND = 2;
7363 DENIED = 3;
7364 }
7365 optional Category category = 6;
7366}
Tony Make2b1b672019-07-29 16:59:47 +01007367
7368/**
7369 * Logs when there is a smart selection related event.
7370 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7371 * Logged from: TextClassifierEventLogger.java
7372 */
7373message TextSelectionEvent {
7374 // A session ID.
7375 optional string session_id = 1;
7376
7377 // Event type of this event.
7378 optional android.stats.textclassifier.EventType event_type = 2;
7379
Tony Mak9c84bd22019-12-09 07:27:25 +00007380 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007381 optional string model_name = 3;
7382
7383 // Type of widget that was involved in triggering this event.
7384 optional android.stats.textclassifier.WidgetType widget_type = 4;
7385
7386 // Index of this event in a session.
7387 optional int32 event_index = 5;
7388
7389 // Entity type that is involved.
7390 optional string entity_type = 6;
7391
7392 // Relative word index of the start of the selection.
7393 optional int32 relative_word_start_index = 7;
7394
7395 // Relative word (exclusive) index of the end of the selection.
7396 optional int32 relative_word_end_index = 8;
7397
7398 // Relative word index of the start of the smart selection.
7399 optional int32 relative_suggested_word_start_index = 9;
7400
7401 // Relative word (exclusive) index of the end of the smart selection.
7402 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007403
7404 // Name of source package.
7405 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007406}
7407
7408/**
7409 * Logs when there is a smart linkify related event.
7410 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7411 * Logged from: TextClassifierEventLogger.java
7412 */
7413message TextLinkifyEvent {
7414 // A session ID.
7415 optional string session_id = 1;
7416
7417 // Event type of this event.
7418 optional android.stats.textclassifier.EventType event_type = 2;
7419
Tony Mak9c84bd22019-12-09 07:27:25 +00007420 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007421 optional string model_name = 3;
7422
7423 // Type of widget that was involved in triggering this event.
7424 optional android.stats.textclassifier.WidgetType widget_type = 4;
7425
7426 // Index of this event in a session.
7427 optional int32 event_index = 5;
7428
7429 // Entity type that is involved.
7430 optional string entity_type = 6;
7431
7432 // Number of links detected.
7433 optional int32 num_links = 7;
7434
7435 // The total length of all links.
7436 optional int32 linked_text_length = 8;
7437
7438 // Length of input text.
7439 optional int32 text_length = 9;
7440
7441 // Time spent on generating links in ms.
7442 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007443
7444 // Name of source package.
7445 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007446}
7447
7448/**
7449 * Logs when there is a conversation actions related event.
7450 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7451 * Logged from: TextClassifierEventLogger.java
7452 */
7453message ConversationActionsEvent {
7454 // A session ID.
7455 optional string session_id = 1;
7456
7457 // Event type of this event.
7458 optional android.stats.textclassifier.EventType event_type = 2;
7459
Tony Mak9c84bd22019-12-09 07:27:25 +00007460 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007461 optional string model_name = 3;
7462
7463 // Type of widget that was involved in triggering this event.
7464 optional android.stats.textclassifier.WidgetType widget_type = 4;
7465
7466 // The first entity type that is involved.
7467 optional string first_entity_type = 5;
7468
7469 // The second entity type that is involved.
7470 optional string second_entity_type = 6;
7471
7472 // The third entity type that is involved.
7473 optional string third_entity_type = 7;
7474
7475 // The score of the first entity type.
7476 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007477
7478 // Name of source package.
7479 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00007480
7481 // Name of the annotator model that is involved in this event.
7482 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01007483}
7484
7485/**
7486 * Logs when there is a language detection related event.
7487 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7488 * Logged from: TextClassifierEventLogger.java
7489 */
7490message LanguageDetectionEvent {
7491 // A session ID.
7492 optional string session_id = 1;
7493
7494 // Event type of this event.
7495 optional android.stats.textclassifier.EventType event_type = 2;
7496
Tony Mak9c84bd22019-12-09 07:27:25 +00007497 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007498 optional string model_name = 3;
7499
7500 // Type of widget that was involved in triggering this event.
7501 optional android.stats.textclassifier.WidgetType widget_type = 4;
7502
7503 // Detected language.
7504 optional string language_tag = 5;
7505
7506 // Score of the detected language.
7507 optional float score = 6;
7508
7509 // Position of this action.
7510 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007511
7512 // Name of source package.
7513 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007514}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007515
7516/**
7517 * Information about an OTA update attempt by update_engine.
7518 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7519 */
7520message UpdateEngineUpdateAttemptReported {
7521 // The number of attempts for the update engine to apply a given payload.
7522 optional int32 attempt_number = 1;
7523
7524 optional android.stats.otaupdate.PayloadType payload_type = 2;
7525
7526 // The total time in minutes for the update engine to apply a given payload.
7527 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7528 // it's increased when the system is sleeping.
7529 optional int32 duration_boottime_in_minutes = 3;
7530
7531 // The total time in minutes for the update engine to apply a given payload.
7532 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7533 // and it's not increased when the system is sleeping.
7534 optional int32 duration_monotonic_in_minutes = 4;
7535
7536 // The size of the payload in MiBs.
7537 optional int32 payload_size_mib = 5;
7538
7539 // The attempt result reported by the update engine for an OTA update.
7540 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7541
7542 // The error code reported by the update engine after an OTA update attempt
7543 // on A/B devices.
7544 optional android.stats.otaupdate.ErrorCode error_code = 7;
7545
7546 // The build fingerprint of the source system. The value is read from a
7547 // system property when the device takes the update. e.g.
7548 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7549 optional string source_fingerprint = 8;
7550}
7551
7552/**
7553 * Information about all the attempts the device make before finishing the
7554 * successful update.
7555 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7556 */
7557message UpdateEngineSuccessfulUpdateReported {
7558 // The number of attempts for the update engine to apply the payload for a
7559 // successful update.
7560 optional int32 attempt_count = 1;
7561
7562 optional android.stats.otaupdate.PayloadType payload_type = 2;
7563
7564 optional int32 payload_size_mib = 3;
7565
7566 // The total number of bytes downloaded by update_engine since the last
7567 // successful update.
7568 optional int32 total_bytes_downloaded_mib = 4;
7569
7570 // The ratio in percentage of the over-downloaded bytes compared to the
7571 // total bytes needed to successfully install the update. e.g. 200 if we
7572 // download 200MiB in total for a 100MiB package.
7573 optional int32 download_overhead_percentage = 5;
7574
7575 // The total time in minutes for the update engine to apply the payload for a
7576 // successful update.
7577 optional int32 total_duration_minutes = 6;
7578
7579 // The number of reboot of the device during a successful update.
7580 optional int32 reboot_count = 7;
7581}
Alec Mourie088e762019-07-02 13:10:55 -07007582
7583/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08007584 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
7585 * key to indicate whether it was successful or not.
7586 *
7587 * Logged from:
7588 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
7589 */
7590message RebootEscrowRecoveryReported {
7591 optional bool successful = 1;
7592}
7593
7594/**
Alec Mourie088e762019-07-02 13:10:55 -07007595 * Global display pipeline metrics reported by SurfaceFlinger.
7596 * Pulled from:
7597 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7598 */
7599message SurfaceflingerStatsGlobalInfo {
7600 // Total number of frames presented during the tracing period
7601 optional int64 total_frames = 1;
7602 // Total number of frames missed
7603 optional int64 missed_frames = 2;
7604 // Total number of frames that fell back to client composition
7605 optional int64 client_composition_frames = 3;
7606 // Total time the display was turned on
7607 optional int64 display_on_millis = 4;
7608 // Total time that was spent performing animations.
7609 // This is derived from the present-to-present layer histogram
7610 optional int64 animation_millis = 5;
7611}
7612
7613/**
7614 * Per-layer display pipeline metrics reported by SurfaceFlinger.
7615 * The number of layers uploaded will be restricted due to size limitations.
7616 * Pulled from:
7617 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7618 */
7619message SurfaceflingerStatsLayerInfo {
7620 // The layer for this set of metrics
7621 // For now we can infer that the package name is included in the layer
7622 // name.
7623 optional string layer_name = 1;
7624 // Total number of frames presented
7625 optional int64 total_frames = 2;
7626 // Total number of dropped frames while latching a buffer for this layer.
7627 optional int64 dropped_frames = 3;
7628 // Set of timings measured between successive presentation timestamps.
7629 optional FrameTimingHistogram present_to_present = 4
7630 [(android.os.statsd.log_mode) = MODE_BYTES];
7631 // Set of timings measured from when an app queued a buffer for
7632 // presentation, until the buffer was actually presented to the
7633 // display.
7634 optional FrameTimingHistogram post_to_present = 5
7635 [(android.os.statsd.log_mode) = MODE_BYTES];
7636 // Set of timings measured from when a buffer is ready to be presented,
7637 // until the buffer was actually presented to the display.
7638 optional FrameTimingHistogram acquire_to_present = 6
7639 [(android.os.statsd.log_mode) = MODE_BYTES];
7640 // Set of timings measured from when a buffer was latched by
7641 // SurfaceFlinger, until the buffer was presented to the display
7642 optional FrameTimingHistogram latch_to_present = 7
7643 [(android.os.statsd.log_mode) = MODE_BYTES];
7644 // Set of timings measured from the desired presentation to the actual
7645 // presentation time
7646 optional FrameTimingHistogram desired_to_present = 8
7647 [(android.os.statsd.log_mode) = MODE_BYTES];
7648 // Set of timings measured from when an app queued a buffer for
7649 // presentation, until the buffer was ready to be presented.
7650 optional FrameTimingHistogram post_to_acquire = 9
7651 [(android.os.statsd.log_mode) = MODE_BYTES];
7652}
7653
7654/**
7655 * Histogram of frame counts bucketed by time in milliseconds.
7656 * Because of size limitations, we hard-cap the number of buckets, with
7657 * buckets for corresponding to larger milliseconds being less precise.
7658 */
7659message FrameTimingHistogram {
7660 // Timings in milliseconds that describes a set of histogram buckets
7661 repeated int32 time_millis_buckets = 1;
7662 // Number of frames that match to each time_millis, i.e. the bucket
7663 // contents
7664 // It's required that len(time_millis) == len(frame_count)
7665 repeated int64 frame_counts = 2;
7666}
Emilian Peev6729f372019-08-29 09:14:09 -07007667
Emilian Peev6729f372019-08-29 09:14:09 -07007668/**
7669 * Information about camera facing and API level usage.
7670 * Logged from:
7671 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
7672 */
7673message CameraActionEvent {
7674 // Camera session duration
7675 optional int64 duration = 1;
7676
7677 // Camera API level used
7678 optional int32 api_level = 2;
7679
7680 // Name of client package
7681 optional string package_name = 3;
7682
7683 // Camera facing
7684 enum Facing {
7685 UNKNOWN = 0;
7686 BACK = 1;
7687 FRONT = 2;
7688 EXTERNAL = 3;
7689 }
7690 optional Facing facing = 4;
7691}
atrost01a20932019-08-28 15:40:37 +01007692
7693/**
7694 * Logs when a compatibility change is affecting an app.
7695 *
7696 * Logged from:
7697 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
7698 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
7699 */
7700message AppCompatibilityChangeReported {
7701 // The UID of the app being affected by the compatibilty change.
7702 optional int32 uid = 1 [(is_uid) = true];
7703
7704 // The ID of the change affecting the app.
7705 optional int64 change_id = 2;
7706
7707 enum State {
7708 UNKNOWN_STATE = 0;
7709 ENABLED = 1;
7710 DISABLED = 2;
7711 LOGGED = 3;
7712 }
7713
7714 // The state of the change - if logged from gating whether it was enabled or disabled, or just
7715 // logged otherwise.
7716 optional State state = 3;
7717
7718 enum Source {
7719 UNKNOWN_SOURCE = 0;
7720 APP_PROCESS = 1;
7721 SYSTEM_SERVER = 2;
7722 }
7723
7724 // Where it was logged from.
7725 optional Source source = 4;
7726
7727}
Hector Dearman40579f62019-11-01 13:19:30 +00007728
7729/**
7730 * Logged from
7731 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
7732 */
7733message PerfettoUploaded {
7734 enum Event {
7735 PERFETTO_UNDEFINED = 0;
7736 PERFETTO_TRACE_BEGIN = 1;
7737 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
7738 PERFETTO_ON_CONNECT = 3;
7739 PERFETTO_ON_TRACING_DISABLED = 4;
7740 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
7741 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
7742 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
7743 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
7744 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
7745 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
7746 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
7747 PERFETTO_TRIGGER_BEGIN = 12;
7748 PERFETTO_TRIGGER_SUCCESS = 13;
7749 PERFETTO_TRIGGER_FAILURE = 14;
7750 PERFETTO_HIT_GUARDRAILS = 15;
7751 PERFETTO_ON_TIMEOUT = 16;
7752 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
7753 }
7754
7755 // Which stage of the pipeline we are reporting from.
7756 optional Event event = 1;
7757
7758 // UUID matching the one set inside the SystemInfo trace packet.
7759 optional int64 trace_uuid_lsb = 2;
7760 optional int64 trace_uuid_msb = 3;
7761}
Mark Tabrya824a642019-11-05 12:26:12 -08007762
7763/**
7764 * Pulls client metrics on data transferred via Vehicle Maps Service.
7765 * Metrics are keyed by uid + layer.
7766 *
7767 * Pulled from:
7768 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
7769 */
7770message VmsClientStats {
7771 // UID of the VMS client app
7772 optional int32 uid = 1 [(is_uid) = true];
7773
7774 // VMS layer definition
7775 optional int32 layer_type = 2;
7776 optional int32 layer_channel = 3;
7777 optional int32 layer_version = 4;
7778
7779 // Bytes and packets sent by the client for the layer
7780 optional int64 tx_bytes = 5;
7781 optional int64 tx_packets = 6;
7782
7783 // Bytes and packets received by the client for the layer
7784 optional int64 rx_bytes = 7;
7785 optional int64 rx_packets = 8;
7786
7787 // Bytes and packets dropped due to client error
7788 optional int64 dropped_bytes = 9;
7789 optional int64 dropped_packets = 10;
7790}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007791
7792/**
7793 * State of a dangerous permission requested by a package - sampled
7794 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
7795*/
7796message DangerousPermissionStateSampled {
7797 // Name of the permission
7798 optional string permission_name = 1;
7799
7800 // Uid of the package
7801 optional int32 uid = 2 [(is_uid) = true];
7802
7803 // If the permission is granted to the uid
7804 optional bool is_granted = 3;
7805
7806 // Permission flags as per android.content.pm.PermissionFlags
7807 optional int32 permission_flags = 4;
7808}
7809
Stan Iliev637ba5e2019-08-16 13:43:08 -04007810/**
7811 * HWUI renders pipeline type: GL (0) or Vulkan (1).
7812 */
7813enum PipelineType {
7814 GL = 0;
7815 VULKAN = 1;
7816}
7817
7818/**
7819 * HWUI stats for a given app.
7820 */
7821message GraphicsStats {
7822 // The package name of the app
7823 optional string package_name = 1;
7824
7825 // The version code of the app
7826 optional int64 version_code = 2;
7827
7828 // The start & end timestamps in UTC as
7829 // milliseconds since January 1, 1970
7830 // Compatible with java.util.Date#setTime()
7831 optional int64 stats_start = 3;
7832
7833 optional int64 stats_end = 4;
7834
7835 // HWUI renders pipeline type: GL or Vulkan.
7836 optional PipelineType pipeline = 5;
7837
7838 // Distinct frame count.
7839 optional int32 total_frames = 6;
7840
7841 // Number of "missed vsync" events.
7842 optional int32 missed_vsync_count = 7;
7843
7844 // Number of frames in triple-buffering scenario (high input latency)
7845 optional int32 high_input_latency_count = 8;
7846
7847 // Number of "slow UI thread" events.
7848 optional int32 slow_ui_thread_count = 9;
7849
7850 // Number of "slow bitmap upload" events.
7851 optional int32 slow_bitmap_upload_count = 10;
7852
7853 // Number of "slow draw" events.
7854 optional int32 slow_draw_count = 11;
7855
7856 // Number of frames that missed their deadline (aka, visibly janked)
7857 optional int32 missed_deadline_count = 12;
7858
7859 // The frame time histogram for the package
7860 optional FrameTimingHistogram cpu_histogram = 13
7861 [(android.os.statsd.log_mode) = MODE_BYTES];
7862
7863 // The gpu frame time histogram for the package
7864 optional FrameTimingHistogram gpu_histogram = 14
7865 [(android.os.statsd.log_mode) = MODE_BYTES];
7866
7867 // UI mainline module version.
7868 optional int64 version_ui_module = 15;
7869
7870 // If true, these are HWUI stats for up to a 24h period for a given app from today.
7871 // If false, these are HWUI stats for a 24h period for a given app from the last complete
7872 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
7873 // more apps are running / rendering.
7874 optional bool is_today = 16;
7875}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007876
7877/**
7878 * Message related to dangerous (runtime) app ops access
7879 */
7880message RuntimeAppOpsAccess {
7881 // Uid of the package accessing app op
7882 optional int32 uid = 1 [(is_uid) = true];
7883
7884 // Name of the package accessing app op
7885 optional string package_name = 2;
7886
7887 // operation id; maps to the OP_* constants in AppOpsManager.java
7888 optional int32 op_id = 3;
7889
7890 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
7891 // Features must be provided through manifest using <feature> tag available in R and above.
7892 optional string feature_id = 4;
7893
7894 // message related to app op access, limited to 600 chars by API
7895 optional string message = 5;
7896
7897 enum SamplingStrategy {
7898 DEFAULT = 0;
7899 UNIFORM = 1;
7900 RARELY_USED = 2;
7901 }
7902
7903 // sampling strategy used to collect this message
7904 optional SamplingStrategy sampling_strategy = 6;
7905}
7906
7907