blob: cbece78ec355b2819715b77299c9f38b568e2beb [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;
Nikita Ioffe41dd57e2020-01-10 16:05:08 +0000341 UserspaceRebootReported userspace_reboot_reported = 243;
Yao Chend54f9dd2017-10-17 17:37:48 +0000342 }
David Chenc8a43242017-10-17 16:23:28 -0700343
David Chen6e3e6cb2018-01-03 16:14:06 -0800344 // Pulled events will start at field 10000.
Stanislav Zholnin606454c2019-11-27 15:31:49 +0000345 // Next: 10070
David Chenc8a43242017-10-17 16:23:28 -0700346 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800347 WifiBytesTransfer wifi_bytes_transfer = 10000;
348 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
349 MobileBytesTransfer mobile_bytes_transfer = 10002;
350 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800351 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800352 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800353 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800354 CpuTimePerFreq cpu_time_per_freq = 10008;
355 CpuTimePerUid cpu_time_per_uid = 10009;
356 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800357 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800358 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800359 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800360 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800361 SystemElapsedRealtime system_elapsed_realtime = 10014;
362 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800363 CpuActiveTime cpu_active_time = 10016;
364 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000365 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800366 RemainingBatteryCapacity remaining_battery_capacity = 10019;
367 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800368 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100369 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100370 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100371 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000372 DiskStats disk_stats = 10025;
373 DirectoryUsage directory_usage = 10026;
374 AppSize app_size = 10027;
375 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700376 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700377 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800378 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700379 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700380 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800381 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700382 ProcessCpuTime process_cpu_time = 10035;
Misha Wagner5a51e002018-10-03 15:04:09 +0100383 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700384 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800385 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
386 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
387 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000388 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800389 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800390 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800391 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000392 DebugElapsedClock debug_elapsed_clock = 10046;
393 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800394 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800395 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800396 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800397 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000398 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000399 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800400 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
401 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000402 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000403 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700404 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700405 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200406 AppOps app_ops = 10060;
Rafal Slawik77987ed2019-06-17 12:28:23 +0100407 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
Alec Mourie088e762019-07-02 13:10:55 -0700408 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
409 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Rafal Slawik7efcefb2019-09-20 11:16:20 +0100410 ProcessMemorySnapshot process_memory_snapshot = 10064;
Mark Tabrya824a642019-11-05 12:26:12 -0800411 VmsClientStats vms_client_stats = 10065;
Chris Wrencdea3b72019-11-22 16:58:17 -0500412 NotificationRemoteViews notification_remote_views = 10066;
Stanislav Zholninccb82e42019-11-29 18:59:49 +0000413 DangerousPermissionStateSampled dangerous_permission_state_sampled = 10067;
Stan Iliev637ba5e2019-08-16 13:43:08 -0400414 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin606454c2019-11-27 15:31:49 +0000415 RuntimeAppOpsAccess runtime_app_ops_access = 10069;
David Chenc8a43242017-10-17 16:23:28 -0700416 }
yroa1fe77c2018-02-26 14:22:54 -0800417
Bookatz76aafcf2018-09-17 16:17:10 -0700418 // DO NOT USE field numbers above 100,000 in AOSP.
419 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
420 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100421
422 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700423}
424
Yao Chend54f9dd2017-10-17 17:37:48 +0000425/**
Yangster-mac20877162017-12-22 17:19:39 -0800426 * This proto represents a node of an attribution chain.
427 * Note: All attribution chains are represented as a repeated field of type
428 * AttributionNode. It is understood that in such arrays, the order is that
429 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000430 */
Yangster-mac20877162017-12-22 17:19:39 -0800431message AttributionNode {
432 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800433 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800434
Yangster-mac20877162017-12-22 17:19:39 -0800435 // The (optional) string tag for an element in the attribution chain. If the
436 // element has no tag, it is encoded as an empty string.
437 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700438}
439
Yangster-mac48b3d622018-08-18 12:38:11 -0700440message KeyValuePair {
441 optional int32 key = 1;
442 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700443 int32 value_int = 2;
444 int64 value_long = 3;
445 string value_str = 4;
446 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700447 }
448}
449
450message KeyValuePairsAtom {
451 optional int32 uid = 1;
452 repeated KeyValuePair pairs = 2;
453}
454
Yao Chend54f9dd2017-10-17 17:37:48 +0000455/*
456 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800457 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000458 *
459 * RULES:
460 * - The field ids for each atom must start at 1, and count upwards by 1.
461 * Skipping field ids is not allowed.
462 * - These form an API, so renaming, renumbering or removing fields is
463 * not allowed between android releases. (This is not currently enforced,
464 * but there will be a tool to enforce this restriction).
465 * - The types must be built-in protocol buffer types, namely, no sub-messages
466 * are allowed (yet). The bytes type is also not allowed.
467 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800468 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000469 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800470 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000471 * - A field that is a uid should be a string field, tagged with the [xxx]
472 * annotation. The generated code on android will be represented by UIDs,
473 * and those UIDs will be translated in xxx to those strings.
474 *
475 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700476 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000477 * - If there is a UID, it goes first. Think in an object-oriented fashion.
478 * *****************************************************************************
479 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700480
Yao Chend54f9dd2017-10-17 17:37:48 +0000481/**
Tej Singha72344992019-04-17 18:55:08 -0700482 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700483 * Logs when the Thermal service HAL notifies the throttling start/stop events.
484 *
485 * Logged from:
486 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
487 */
488message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700489 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700490 optional android.os.TemperatureTypeEnum sensor_type = 1;
491
Maggie White442b6312019-04-05 16:26:44 -0700492 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700493 enum State {
494 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700495 START = 1; // START indicated that throttling was triggered.
496 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700497 }
Yangster-mace16189a2018-08-26 12:20:16 -0700498 optional State state = 2;
499
500 optional float temperature = 3;
501}
502
503/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000504 * Logs when the screen state changes.
505 *
506 * Logged from:
507 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
508 */
509message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800510 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700511 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700512}
Yao Chend54f9dd2017-10-17 17:37:48 +0000513
514/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700515 * Logs that the process state of the uid, as determined by ActivityManager
516 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000517 *
518 * Logged from:
519 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
520 */
Bookatzc1a050a2017-10-10 15:49:28 -0700521message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700522 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000523
Bookatzdb026a22018-01-10 19:01:56 -0800524 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700525 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000526}
527
528/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700529 * Logs process state change of a process, as per the activity manager.
530 *
531 * Logged from:
532 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
533 */
534message ProcessStateChanged {
535 optional int32 uid = 1;
536 optional string process_name = 2;
537 optional string package_name = 3;
538 // TODO: remove this when validation is done
539 optional int64 version = 5;
540 // The state, from frameworks/base/core/proto/android/app/enums.proto.
541 optional android.app.ProcessStateEnum state = 4;
542}
543
544/**
545 * Logs when ActivityManagerService sleep state is changed.
546 *
547 * Logged from:
548 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
549 */
550message ActivityManagerSleepStateChanged {
551 // TODO: import frameworks proto
552 enum State {
553 UNKNOWN = 0;
554 ASLEEP = 1;
555 AWAKE = 2;
556 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700557 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700558}
559
560/**
561 * Logs when system memory state changes.
562 *
563 * Logged from:
564 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
565 */
566message MemoryFactorStateChanged {
567 // TODO: import frameworks proto
568 enum State {
569 MEMORY_UNKNOWN = 0;
570 NORMAL = 1; // normal.
571 MODERATE = 2; // moderate memory pressure.
572 LOW = 3; // low memory.
573 CRITICAL = 4; // critical memory.
574
575 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700576 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700577}
578
579/**
580 * Logs when app is using too much cpu, according to ActivityManagerService.
581 *
582 * Logged from:
583 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
584 */
585message ExcessiveCpuUsageReported {
586 optional int32 uid = 1;
587 optional string process_name = 2;
588 optional string package_name = 3;
589 // package version. TODO: remove this when validation is done
590 optional int64 version = 4;
591}
592
593/**
594 * Logs when a cached process is killed, along with its pss.
595 *
596 * Logged from:
597 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
598 */
599message CachedKillReported {
600 optional int32 uid = 1;
601 optional string process_name = 2;
602 optional string package_name = 3;
603 // TODO: remove this when validation is done
604 optional int64 version = 5;
605 optional int64 pss = 4;
606}
607
608/**
609 * Logs when memory stats of a process is reported.
610 *
611 * Logged from:
612 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
613 */
614message ProcessMemoryStatReported {
615 optional int32 uid = 1;
616 optional string process_name = 2;
617 optional string package_name = 3;
618 //TODO: remove this when validation is done
619 optional int64 version = 9;
620 optional int64 pss = 4;
621 optional int64 uss = 5;
622 optional int64 rss = 6;
623 enum Type {
624 ADD_PSS_INTERNAL_SINGLE = 0;
625 ADD_PSS_INTERNAL_ALL_MEM = 1;
626 ADD_PSS_INTERNAL_ALL_POLL = 2;
627 ADD_PSS_EXTERNAL = 3;
628 ADD_PSS_EXTERNAL_SLOW = 4;
629 }
630 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800631 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700632}
633
634/**
Bookatzc1a050a2017-10-10 15:49:28 -0700635 * Logs that a process started, finished, crashed, or ANRed.
636 *
637 * Logged from:
638 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
639 */
640message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700641 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700642
David Chen0b5c90c2018-01-25 16:51:49 -0800643 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800644 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700645
Bookatzddccf0a2017-11-28 16:48:14 -0800646 // What lifecycle state the process changed to.
647 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800648 enum State {
649 FINISHED = 0;
650 STARTED = 1;
651 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800652 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800653 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700654}
655
Bookatzc1a050a2017-10-10 15:49:28 -0700656/**
657 * Logs when the ble scan state changes.
658 *
659 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700660 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700661 */
662message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800663 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700664
665 enum State {
666 OFF = 0;
667 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700668 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
669 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700670 }
671 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700672
Bookatze5ec0b42018-03-26 13:34:56 -0700673 // Does the scan have a filter.
674 optional bool is_filtered = 3;
675 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
676 optional bool is_first_match = 4;
677 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
678 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700679}
680
681/**
682 * Logs reporting of a ble scan finding results.
683 *
684 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700685 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700686 */
Bookatzae6738e2018-09-13 11:38:56 -0700687// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700688message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800689 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700690
691 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800692 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700693}
694
695/**
696 * Logs when a sensor state changes.
697 *
698 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700699 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700700 */
701message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800702 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700703
Bookatzc1a050a2017-10-10 15:49:28 -0700704 // The id (int) of the sensor.
705 optional int32 sensor_id = 2;
706
707 enum State {
708 OFF = 0;
709 ON = 1;
710 }
711 optional State state = 3;
712}
713
Bookatzc1a050a2017-10-10 15:49:28 -0700714/**
715 * Logs when GPS state changes.
716 *
717 * Logged from:
718 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
719 */
720message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800721 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700722
723 enum State {
724 OFF = 0;
725 ON = 1;
726 }
727 optional State state = 2;
728}
729
Bookatz48d362e2018-11-06 15:49:08 -0800730/**
731 * Logs when GPS signal quality.
732 *
733 * Logged from:
734 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
735 */
736message GpsSignalQualityChanged {
737 optional android.server.location.GpsSignalQualityEnum level = 1;
738}
739
Blake Kragten212edc72019-10-15 13:26:50 -0700740/**
741 * Gps location status report
742 *
743 * Logged from:
744 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
745 */
746message GpsLocationStatusReported {
747 // Boolean stating if location was acquired
748 optional bool location_success = 1;
749}
750
751/**
752 * Gps log time to first fix report
753 *
754 * Logged from:
755 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
756 */
757message GpsTimeToFirstFixReported {
758 // int32 reporting the time to first fix in milliseconds
759 optional int32 time_to_first_fix_millis = 1;
760}
Bookatzc1a050a2017-10-10 15:49:28 -0700761
762/**
763 * Logs when a sync manager sync state changes.
764 *
765 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700766 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700767 */
768message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800769 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700770
David Chen0b5c90c2018-01-25 16:51:49 -0800771 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800772 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700773
774 enum State {
775 OFF = 0;
776 ON = 1;
777 }
778 optional State state = 3;
779}
780
Yangster-mac96353002018-09-05 11:18:55 -0700781/*
782 * Deferred job stats.
783 *
784 * Logged from:
785 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
786*/
787message DeferredJobStatsReported {
788 repeated AttributionNode attribution_node = 1;
789
790 // Number of jobs deferred.
791 optional int32 num_jobs_deferred = 2;
792
793 // Time since the last job runs.
794 optional int64 time_since_last_job_millis = 3;
795}
796
Bookatzc1a050a2017-10-10 15:49:28 -0700797/**
798 * Logs when a job scheduler job state changes.
799 *
800 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700801 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700802 */
803message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800804 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700805
806 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800807 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700808
809 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800810 FINISHED = 0;
811 STARTED = 1;
812 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700813 }
814 optional State state = 3;
815
Tej Singh33a412b2018-03-16 18:43:59 -0700816 // The reason a job has stopped.
817 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700818 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700819 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100820
821 // The standby bucket of the app that scheduled the job. These match the framework constants
822 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
823 // already assigned 0.
824 enum Bucket {
825 UNKNOWN = -1;
826 ACTIVE = 0;
827 WORKING_SET = 1;
828 FREQUENT = 2;
829 RARE = 3;
830 NEVER = 4;
831 }
832 optional Bucket standby_bucket = 5 [default = UNKNOWN];
833
834 // The job id (as assigned by the app).
835 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700836}
837
838/**
839 * Logs when the audio state changes.
840 *
841 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700842 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700843 */
844message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800845 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700846
847 enum State {
848 OFF = 0;
849 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700850 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
851 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700852 }
853 optional State state = 2;
854}
855
856/**
857 * Logs when the video codec state changes.
858 *
859 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700860 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700861 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800862message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800863 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700864
865 enum State {
866 OFF = 0;
867 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700868 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
869 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700870 }
871 optional State state = 2;
872}
873
874/**
875 * Logs when the flashlight state changes.
876 *
877 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700878 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700879 */
880message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800881 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700882
883 enum State {
884 OFF = 0;
885 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700886 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
887 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700888 }
889 optional State state = 2;
890}
891
892/**
893 * Logs when the camera state changes.
894 *
895 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700896 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700897 */
898message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800899 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700900
901 enum State {
902 OFF = 0;
903 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700904 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
905 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700906 }
907 optional State state = 2;
908}
909
910/**
911 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000912 *
913 * Logged from:
914 * TODO
915 */
Bookatzd6746242017-10-24 18:39:35 -0700916message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -0800917 repeated AttributionNode attribution_node = 1
918 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +0000919
Bookatz1a1b0462018-01-12 11:47:03 -0800920 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
921 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristineed615642020-01-02 12:53:41 -0800922 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY];
923 ;
Bookatzc1a050a2017-10-10 15:49:28 -0700924
925 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristineed615642020-01-02 12:53:41 -0800926 optional string tag = 3 [(state_field_option).option = PRIMARY];
Bookatzc1a050a2017-10-10 15:49:28 -0700927
928 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800929 RELEASE = 0;
930 ACQUIRE = 1;
931 CHANGE_RELEASE = 2;
932 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700933 }
tsaichristineed615642020-01-02 12:53:41 -0800934 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Bookatzc1a050a2017-10-10 15:49:28 -0700935}
936
937/**
Bookatzc1a050a2017-10-10 15:49:28 -0700938 * Logs when a partial wakelock is considered 'long' (over 1 min).
939 *
940 * Logged from:
941 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
942 */
943message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800944 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700945
Yao Chend54f9dd2017-10-17 17:37:48 +0000946 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
947 optional string tag = 2;
948
Bookatzc1a050a2017-10-10 15:49:28 -0700949 // TODO: I have no idea what this is.
950 optional string history_tag = 3;
951
952 enum State {
953 OFF = 0;
954 ON = 1;
955 }
956 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000957}
958
Bookatzc1a050a2017-10-10 15:49:28 -0700959/**
Bookatza66083f2018-09-20 17:24:00 -0700960 * Logs when the device is interactive, according to the PowerManager Notifier.
961 *
962 * Logged from:
963 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
964 */
965message InteractiveStateChanged {
966 enum State {
967 OFF = 0;
968 ON = 1;
969 }
970 optional State state = 1;
971}
972
973/**
Bookatzc1a050a2017-10-10 15:49:28 -0700974 * Logs Battery Saver state change.
975 *
976 * Logged from:
977 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
978 */
979message BatterySaverModeStateChanged {
980 enum State {
981 OFF = 0;
982 ON = 1;
983 }
984 optional State state = 1;
985}
986
987/**
988 * Logs Doze mode state change.
989 *
990 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800991 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700992 */
993message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800994 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800995}
996
997
998/**
999 * Logs state change of Doze mode including maintenance windows.
1000 *
1001 * Logged from:
1002 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1003 */
1004message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001005 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001006}
1007
1008/**
1009 * Logs screen brightness level.
1010 *
1011 * Logged from:
1012 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1013 */
1014message ScreenBrightnessChanged {
1015 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1016 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001017}
1018
1019/**
1020 * Logs battery level (percent full, from 0 to 100).
1021 *
1022 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001023 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001024 */
1025message BatteryLevelChanged {
1026 // Battery level. Should be in [0, 100].
1027 optional int32 battery_level = 1;
1028}
1029
1030/**
1031 * Logs change in charging status of the device.
1032 *
1033 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001034 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001035 */
1036message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001037 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1038 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001039}
1040
1041/**
1042 * Logs whether the device is plugged in, and what power source it is using.
1043 *
1044 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001045 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001046 */
1047message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001048 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1049 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001050}
1051
Bookatz8c6571b2017-10-24 15:04:41 -07001052/**
1053 * Logs when an app's wakeup alarm fires.
1054 *
1055 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001056 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001057 */
1058message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001059 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001060
1061 // Name of the wakeup alarm.
1062 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001063
1064 // Name of source package (for historical reasons, since BatteryStats tracked it).
1065 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001066
1067 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1068 enum Bucket {
1069 UNKNOWN = 0;
1070 EXEMPTED = 5;
1071 ACTIVE = 10;
1072 WORKING_SET = 20;
1073 FREQUENT = 30;
1074 RARE = 40;
1075 NEVER = 50;
1076 }
1077 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1078 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001079}
1080
1081/**
1082 * Logs when an an app causes the mobile radio to change state.
1083 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1084 *
1085 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001086 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001087 */
1088message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001089 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001090
Bookatz1a1b0462018-01-12 11:47:03 -08001091 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1092 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001093}
1094
1095/**
1096 * Logs when an an app causes the wifi radio to change state.
1097 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1098 *
1099 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001100 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001101 */
1102message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001103 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001104
Bookatz1a1b0462018-01-12 11:47:03 -08001105 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1106 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001107}
1108
1109/**
1110 * Logs kernel wakeup reasons and aborts.
1111 *
1112 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001113 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001114 */
1115message KernelWakeupReported {
1116 // Name of the kernel wakeup reason (or abort).
1117 optional string wakeup_reason_name = 1;
1118
1119 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001120 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001121}
1122
1123/**
Bookatzda1798c2018-12-13 14:16:00 -08001124 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001125 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001126 *
1127 * Logged from:
1128 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1129 */
1130message WifiEnabledStateChanged {
1131 enum State {
1132 OFF = 0;
1133 ON = 1;
1134 }
1135 optional State state = 1;
1136}
1137
1138/**
1139 * 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 -08001140 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1141 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001142 *
1143 * Logged from:
1144 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1145 */
1146message WifiRunningStateChanged {
1147 repeated AttributionNode attribution_node = 1;
1148
1149 enum State {
1150 OFF = 0;
1151 ON = 1;
1152 }
1153 optional State state = 2;
1154}
1155
1156/**
Bookatze5885242017-10-24 20:10:31 -07001157 * Logs wifi locks held by an app.
1158 *
1159 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001160 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001161 */
1162message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001163 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001164
1165 enum State {
1166 OFF = 0;
1167 ON = 1;
1168 }
1169 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001170
1171 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1172 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001173}
1174
1175/**
1176 * Logs wifi signal strength changes.
1177 *
1178 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001179 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001180 */
1181message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001182 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1183 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001184}
1185
1186/**
1187 * Logs wifi scans performed by an app.
1188 *
1189 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001190 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001191 */
1192message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001193 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001194
1195 enum State {
1196 OFF = 0;
1197 ON = 1;
1198 }
1199 optional State state = 2;
1200}
1201
1202/**
Tej Singh4503e102018-01-04 14:35:01 -08001203 * Logs wifi multicast locks held by an app
1204 *
1205 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001206 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001207 */
1208message WifiMulticastLockStateChanged {
1209 repeated AttributionNode attribution_node = 1;
1210
1211 enum State {
1212 OFF = 0;
1213 ON = 1;
1214 }
1215 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001216
1217 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001218}
1219
1220/**
Tej Singh1ea42892018-01-19 09:27:00 -08001221 * Logs shutdown reason and duration on next boot.
1222 *
1223 * Logged from:
1224 * frameworks/base/core/java/com/android/server/BootReceiver.java
1225 */
1226message ShutdownSequenceReported {
1227 // True if shutdown is for a reboot. Default: false if we do not know.
1228 optional bool reboot = 1;
1229
1230 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1231 optional string reason = 2;
1232
1233 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1234 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001235 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001236
1237 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001238 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001239}
1240
Tej Singh6483ea42018-01-25 17:45:49 -08001241
1242/**
1243 * Logs boot reason and duration.
1244 *
1245 * Logged from:
1246 * system/core/bootstat/bootstat.cpp
1247 */
1248message BootSequenceReported {
1249 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1250 // Default: "<EMPTY>" if not available.
1251 optional string bootloader_reason = 1;
1252
1253 // Reason for system boot. Eg. bootloader, reboot,userrequested
1254 // Default: "<EMPTY>" if not available.
1255 optional string system_reason = 2;
1256
1257 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001258 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001259
1260 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001261 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001262
1263 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001264 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001265
1266 // Time since last boot in ms. Default: 0 if not available.
1267 optional int64 time_since_last_boot = 6;
1268}
1269
Tej Singhc477d9c2018-02-05 18:31:39 -08001270
1271/**
1272 * Logs call state and disconnect cause (if applicable).
1273 *
1274 * Logged from:
1275 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1276 */
1277message CallStateChanged {
1278 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1279 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1280 optional android.telecom.CallStateEnum call_state = 1;
1281
1282 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1283 // This value is only applicable when the call_state is DISCONNECTED, and
1284 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1285 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1286 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1287
1288 // True if the call is self-managed, which are apps that use the
1289 // telecom infrastructure to make their own calls.
1290 optional bool self_managed = 3;
1291
1292 // True if call is external. External calls are calls on connected Wear
1293 // devices but show up in Telecom so the user can pull them onto the device.
1294 optional bool external_call = 4;
1295}
1296
Tej Singh1ea42892018-01-19 09:27:00 -08001297/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001298 * Logs keyguard state. The keyguard is the lock screen.
1299 *
1300 * Logged from:
1301 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1302 */
1303message KeyguardStateChanged {
1304 enum State {
1305 UNKNOWN = 0;
1306 // The keyguard is hidden when the phone is unlocked.
1307 HIDDEN = 1;
1308 // The keyguard is shown when the phone is locked (screen turns off).
1309 SHOWN= 2;
1310 // The keyguard is occluded when something is overlaying the keyguard.
1311 // Eg. Opening the camera while on the lock screen.
1312 OCCLUDED = 3;
1313 }
1314 optional State state = 1;
1315}
1316
1317/**
1318 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1319 * prompts the user to enter a password (pattern, pin, etc).
1320 *
1321 * Logged from:
1322 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1323 */
1324
1325message KeyguardBouncerStateChanged {
1326 enum State {
1327 UNKNOWN = 0;
1328 // Bouncer is hidden, either as a result of successfully entering the
1329 // password, screen timing out, or user going back to lock screen.
1330 HIDDEN = 1;
1331 // This is when the user is being prompted to enter the password.
1332 SHOWN = 2;
1333 }
1334 optional State state = 1;
1335}
1336
1337/**
1338 * Logs the result of entering a password into the keyguard bouncer.
1339 *
1340 * Logged from:
1341 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1342 */
1343message KeyguardBouncerPasswordEntered {
1344 enum BouncerResult {
1345 UNKNOWN = 0;
1346 // The password entered was incorrect.
1347 FAILURE = 1;
1348 // The password entered was correct.
1349 SUCCESS = 2;
1350 }
1351 optional BouncerResult result = 1;
1352}
1353
Tej Singha883b372018-02-15 11:30:01 -08001354/*
1355 * Logs changes to the configuration of the device. The configuration is defined
1356 * in frameworks/base/core/java/android/content/res/Configuration.java
1357 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1358 * Please go there to interpret the possible values each field can be.
1359 *
1360 * Logged from:
1361 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1362 */
1363message ResourceConfigurationChanged {
1364 // Bit mask of color capabilities of the screen.
1365 // Contains information about the color gamut and hdr mode of the screen.
1366 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001367 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001368
1369 // The target screen density being rendered to.
1370 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001371 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001372
1373 // Current user preference for the scaling factor for fonts,
1374 // relative to the base density scaling.
1375 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001376 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001377
1378 // Flag indicating whether the hard keyboard is hidden.
1379 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001380 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001381
1382 // The type of keyboard attached to the device.
1383 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1384 optional int32 keyboard = 5;
1385
1386 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1387 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001388 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001389
1390 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1391 // 0 if undefined.
1392 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1393 optional int32 mcc = 7;
1394
1395 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1396 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1397 // MNC_ZERO symbol defined in Configuration.java.
1398 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1399 optional int32 mnc = 8;
1400
1401 // The kind of navigation available on the device.
1402 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1403 optional int32 navigation = 9;
1404
1405 // Flag indicating whether the navigation is available.
1406 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001407 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001408
1409 // Overall orientation of the screen.
1410 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1411 optional int32 orientation = 11;
1412
1413 // The current height of the available screen space, in dp units.
1414 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001415 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001416
1417 // Bit mask of overall layout of the screen.
1418 // Contains information about screen size, whether the screen is wider/taller
1419 // than normal, whether the screen layout is right-tl-left or left-to-right,
1420 // and whether the screen has a rounded shape.
1421 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001422 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001423
1424 // Current width of the available screen space, in dp units.
1425 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001426 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001427
1428 // The smallest screen size an application will see in normal operation.
1429 // This is the smallest value of both screenWidthDp and screenHeightDp
1430 // in portrait and landscape.
1431 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001432 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001433
1434 // The type of touch screen attached to the device.
1435 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1436 optional int32 touchscreen = 16;
1437
1438 // Bit mask of the ui mode.
1439 // Contains information about the overall ui mode of the device.
1440 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1441 // Also contains information about whether the device is in night mode.
1442 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001443 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001444}
1445
Tej Singheee317b2018-03-07 19:28:05 -08001446
1447/**
1448 * Logs changes in the connection state of the mobile radio.
1449 *
1450 * Logged from:
1451 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1452 */
1453message MobileConnectionStateChanged {
1454 // States are from the state machine DataConnection.java.
1455 enum State {
1456 UNKNOWN = 0;
1457 // The connection is inactive, or disconnected.
1458 INACTIVE = 1;
1459 // The connection is being activated, or connecting.
1460 ACTIVATING = 2;
1461 // The connection is active, or connected.
1462 ACTIVE = 3;
1463 // The connection is disconnecting.
1464 DISCONNECTING = 4;
1465 // The connection is disconnecting after creating a connection.
1466 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1467 }
1468 optional State state = 1;
1469 // For multi-sim phones, this distinguishes between the sim cards.
1470 optional int32 sim_slot_index = 2;
1471 // Used to identify the connection. Starts at 0 and increments by 1 for
1472 // every new network created. Resets whenever the device reboots.
1473 optional int32 data_connection_id = 3;
1474 // A bitmask for the capabilities of this connection.
1475 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1476 // Default value (if we have no information): 0
1477 optional int64 capabilities = 4;
1478 // If this connection has internet.
1479 // This just checks if the DEFAULT bit of capabilities is set.
1480 optional bool has_internet = 5;
1481}
1482
1483/**
1484 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1485 *
1486 * Logged from:
1487 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1488 */
1489message MobileRadioTechnologyChanged {
1490 optional android.telephony.NetworkTypeEnum state = 1;
1491 // For multi-sim phones, this distinguishes between the sim cards.
1492 optional int32 sim_slot_index = 2;
1493}
1494
Andrew Chantb56388b2018-03-22 21:07:33 -07001495/**
1496 * Logs the VID and PID of any connected USB devices.
1497 *
1498 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1499 *
1500 * Logged by Vendor.
1501 */
1502message UsbDeviceAttached {
1503 optional int32 vid = 1;
1504 optional int32 pid = 2;
1505 optional bool has_audio = 3;
1506 optional bool has_hid = 4;
1507 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001508 enum State {
1509 STATE_DISCONNECTED = 0;
1510 STATE_CONNECTED = 1;
1511 }
1512 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001513 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001514}
1515
Tej Singheee317b2018-03-07 19:28:05 -08001516
Tej Singhdd7bd352018-02-09 19:33:15 -08001517/**
Tej Singh5d991e12018-03-09 19:48:11 -08001518 * Logs when Bluetooth is enabled and disabled.
1519 *
1520 * Logged from:
1521 * services/core/java/com/android/server/BluetoothManagerService.java
1522 */
1523message BluetoothEnabledStateChanged {
1524 repeated AttributionNode attribution_node = 1;
1525 // Whether or not bluetooth is enabled on the device.
1526 enum State {
1527 UNKNOWN = 0;
1528 ENABLED = 1;
1529 DISABLED = 2;
1530 }
1531 optional State state = 2;
1532 // The reason for being enabled/disabled.
1533 // Eg. Airplane mode, crash, application request.
1534 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1535 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001536 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001537}
1538
1539/**
Jack Hed9837c82019-01-09 01:19:13 -08001540 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001541 *
1542 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001543 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1544 *
1545 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001546 */
1547message BluetoothConnectionStateChanged {
1548 // The state of the connection.
1549 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1550 optional android.bluetooth.ConnectionStateEnum state = 1;
1551 // An identifier that can be used to match connect and disconnect events.
1552 // Currently is last two bytes of a hash of a device level ID and
1553 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001554 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001555 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001556 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1557 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001558 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001559 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001560 // An identifier that can be used to match events for this device.
1561 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1562 // Salt: Randomly generated 256 bit value
1563 // Hash algorithm: HMAC-SHA256
1564 // Size: 32 byte
1565 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001566 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001567}
1568
1569/**
1570 * Logs when a Bluetooth device connects and disconnects over ACL
1571 *
1572 * Logged from:
1573 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1574 *
1575 * Next Tag: 3
1576 */
1577message BluetoothAclConnectionStateChanged {
1578 // An identifier that can be used to match events for this device.
1579 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1580 // Salt: Randomly generated 256 bit value
1581 // Hash algorithm: HMAC-SHA256
1582 // Size: 32 byte
1583 // Default: null or empty if the device identifier is not known
1584 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1585 // The state of the connection.
1586 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1587 optional android.bluetooth.ConnectionStateEnum state = 2;
1588}
1589
1590/**
1591 * Logs when a Bluetooth device connects and disconnects over SCO
1592 *
1593 * Logged from:
1594 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1595 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1596 *
1597 * Next Tag: 4
1598 */
1599message BluetoothScoConnectionStateChanged {
1600 // An identifier that can be used to match events for this device.
1601 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1602 // Salt: Randomly generated 256 bit value
1603 // Hash algorithm: HMAC-SHA256
1604 // Size: 32 byte
1605 // Default: null or empty if the device identifier is not known
1606 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1607 // The state of the connection.
1608 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1609 optional android.bluetooth.ConnectionStateEnum state = 2;
1610 // Codec used for this SCO connection
1611 // Default: UNKNOWN
1612 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001613}
1614
Jack Hec27040a2019-01-09 20:54:41 -08001615/**
1616 * Logged when active device of a profile changes
1617 *
1618 * Logged from:
1619 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1620 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1621 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1622 */
1623message BluetoothActiveDeviceChanged {
1624 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1625 // From android.bluetooth.BluetoothProfile
1626 optional int32 bt_profile = 1;
1627 // An identifier that can be used to match events for this new active device.
1628 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1629 // Salt: Randomly generated 256 bit value
1630 // Hash algorithm: HMAC-SHA256
1631 // Size: 32 byte
1632 // Default: null or empty if there is no active device for this profile
1633 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1634}
1635
Jack Heab86dbd22018-12-18 15:43:27 -08001636// Logs when there is an event affecting Bluetooth device's link layer connection.
1637// - This event is triggered when there is a related HCI command or event
1638// - Users of this metrics can deduce Bluetooth device's connection state from these events
1639// - HCI commands are logged before the command is sent, after receiving command status, and after
1640// receiving command complete
1641// - HCI events are logged when they arrive
1642//
1643// Low level log from system/bt
1644//
1645// Bluetooth classic commands:
1646// - CMD_CREATE_CONNECTION
1647// - CMD_DISCONNECT
1648// - CMD_CREATE_CONNECTION_CANCEL
1649// - CMD_ACCEPT_CONNECTION_REQUEST
1650// - CMD_REJECT_CONNECTION_REQUEST
1651// - CMD_SETUP_ESCO_CONNECTION
1652// - CMD_ACCEPT_ESCO_CONNECTION
1653// - CMD_REJECT_ESCO_CONNECTION
1654// - CMD_ENH_SETUP_ESCO_CONNECTION
1655// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1656//
1657// Bluetooth low energy commands:
1658// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1659// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1660// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1661// - CMD_BLE_CLEAR_WHITE_LIST
1662// - CMD_BLE_ADD_WHITE_LIST
1663// - CMD_BLE_REMOVE_WHITE_LIST
1664//
1665// Bluetooth classic events:
1666// - EVT_CONNECTION_COMP
1667// - EVT_CONNECTION_REQUEST
1668// - EVT_DISCONNECTION_COMP
1669// - EVT_ESCO_CONNECTION_COMP
1670// - EVT_ESCO_CONNECTION_CHANGED
1671//
1672// Bluetooth low energy meta events:
1673// - BLE_EVT_CONN_COMPLETE_EVT
1674// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1675//
1676// Next tag: 10
1677message BluetoothLinkLayerConnectionEvent {
1678 // An identifier that can be used to match events for this device.
1679 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1680 // Salt: Randomly generated 256 bit value
1681 // Hash algorithm: HMAC-SHA256
1682 // Size: 32 byte
1683 // Default: null or empty if the device identifier is not known
1684 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1685 // Connection handle of this connection if available
1686 // Range: 0x0000 - 0x0EFF (12 bits)
1687 // Default: 0xFFFF if the handle is unknown
1688 optional int32 connection_handle = 2;
1689 // Direction of the link
1690 // Default: DIRECTION_UNKNOWN
1691 optional android.bluetooth.DirectionEnum direction = 3;
1692 // Type of this link
1693 // Default: LINK_TYPE_UNKNOWN
1694 optional android.bluetooth.LinkTypeEnum type = 4;
1695
1696 // Reason metadata for this link layer connection event, rules for interpretation:
1697 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1698 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1699 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1700 // set and valid, ignore hci_ble_event
1701
1702 // HCI command associated with this event
1703 // Default: CMD_UNKNOWN
1704 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1705 // HCI event associated with this event
1706 // Default: EVT_UNKNOWN
1707 optional android.bluetooth.hci.EventEnum hci_event = 6;
1708 // HCI BLE meta event associated with this event
1709 // Default: BLE_EVT_UNKNOWN
1710 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1711 // HCI command status code if this is triggerred by hci_cmd
1712 // Default: STATUS_UNKNOWN
1713 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1714 // HCI reason code associated with this event
1715 // Default: STATUS_UNKNOWN
1716 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1717}
1718
Howard Roe103fe22019-01-17 16:52:16 -08001719/**
1720 * Logs when a module is rolled back by Watchdog.
1721 *
1722 * Logged from: Rollback Manager
1723 */
1724message WatchdogRollbackOccurred {
1725 enum RollbackType {
1726 UNKNOWN = 0;
1727 ROLLBACK_INITIATE = 1;
1728 ROLLBACK_SUCCESS = 2;
1729 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001730 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001731 }
1732 optional RollbackType rollback_type = 1;
1733
1734 optional string package_name = 2;
1735
1736 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001737
1738 enum RollbackReasonType {
1739 REASON_UNKNOWN = 0;
1740 REASON_NATIVE_CRASH = 1;
1741 REASON_EXPLICIT_HEALTH_CHECK = 2;
1742 REASON_APP_CRASH = 3;
1743 REASON_APP_NOT_RESPONDING = 4;
1744 }
1745 optional RollbackReasonType rollback_reason = 4;
1746
1747 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1748 // is initiated. Empty if the package is unknown.
1749 optional string failing_package_name = 5;
Howard Roe103fe22019-01-17 16:52:16 -08001750}
1751
Jack Hec27040a2019-01-09 20:54:41 -08001752/**
1753 * Logs when there is a change in Bluetooth A2DP playback state
1754 *
1755 * Logged from:
1756 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1757 */
1758message BluetoothA2dpPlaybackStateChanged {
1759 // An identifier that can be used to match events for this device.
1760 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1761 // Salt: Randomly generated 256 bit value
1762 // Hash algorithm: HMAC-SHA256
1763 // Size: 32 byte
1764 // Default: null or empty if the device identifier is not known
1765 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1766 // Current playback state
1767 // Default: PLAYBACK_STATE_UNKNOWN
1768 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1769 // Current audio coding mode
1770 // Default: AUDIO_CODING_MODE_UNKNOWN
1771 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1772}
1773
1774/**
1775 * Logs when there is a change in A2DP codec config for a particular remote device
1776 *
1777 * Logged from:
1778 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1779 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1780 */
1781message BluetoothA2dpCodecConfigChanged {
1782 // An identifier that can be used to match events for this device.
1783 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1784 // Salt: Randomly generated 256 bit value
1785 // Hash algorithm: HMAC-SHA256
1786 // Size: 32 byte
1787 // Default: null or empty if the device identifier is not known
1788 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1789 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1790 // Default SOURCE_CODEC_TYPE_INVALID
1791 optional int32 codec_type = 2;
1792 // Codec priroity, the higher the more preferred, -1 for disabled
1793 // Default: CODEC_PRIORITY_DEFAULT
1794 optional int32 codec_priority = 3;
1795 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1796 // Default: SAMPLE_RATE_NONE
1797 optional int32 sample_rate = 4;
1798 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1799 // Default: BITS_PER_SAMPLE_NONE
1800 optional int32 bits_per_sample = 5;
1801 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1802 // Default: CHANNEL_MODE_NONE
1803 optional int32 channel_mode = 6;
1804 // Codec specific values
1805 // Default 0
1806 optional int64 codec_specific_1 = 7;
1807 optional int64 codec_specific_2 = 8;
1808 optional int64 codec_specific_3 = 9;
1809 optional int64 codec_specific_4 = 10;
1810}
1811
1812/**
1813 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1814 * Each codec's capability is logged separately due to statsd restriction
1815 *
1816 * Logged from:
1817 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1818 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1819 */
1820message BluetoothA2dpCodecCapabilityChanged {
1821 // An identifier that can be used to match events for this device.
1822 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1823 // Salt: Randomly generated 256 bit value
1824 // Hash algorithm: HMAC-SHA256
1825 // Size: 32 byte
1826 // Default: null or empty if the device identifier is not known
1827 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1828 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1829 // Default SOURCE_CODEC_TYPE_INVALID
1830 optional int32 codec_type = 2;
1831 // Codec priroity, the higher the more preferred, -1 for disabled
1832 // Default: CODEC_PRIORITY_DEFAULT
1833 optional int32 codec_priority = 3;
1834 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1835 // in BluetoothCodecConfig
1836 // Default: empty and SAMPLE_RATE_NONE for individual item
1837 optional int32 sample_rate = 4;
1838 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1839 // in BluetoothCodecConfig
1840 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1841 optional int32 bits_per_sample = 5;
1842 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1843 // BluetoothCodecConfig
1844 // Default: empty and CHANNEL_MODE_NONE for individual item
1845 optional int32 channel_mode = 6;
1846 // Codec specific values
1847 // Default 0
1848 optional int64 codec_specific_1 = 7;
1849 optional int64 codec_specific_2 = 8;
1850 optional int64 codec_specific_3 = 9;
1851 optional int64 codec_specific_4 = 10;
1852}
1853
1854/**
1855 * Logs when A2DP failed to read from PCM source.
1856 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1857 *
1858 * Logged from:
1859 * system/bt
1860 */
1861message BluetoothA2dpAudioUnderrunReported {
1862 // An identifier that can be used to match events for this device.
1863 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1864 // Salt: Randomly generated 256 bit value
1865 // Hash algorithm: HMAC-SHA256
1866 // Size: 32 byte
1867 // Default: null or empty if the device identifier is not known
1868 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1869 // Encoding interval in nanoseconds
1870 // Default: 0
1871 optional int64 encoding_interval_nanos = 2;
1872 // Number of bytes of PCM data that could not be read from the source
1873 // Default: 0
1874 optional int32 num_missing_pcm_bytes = 3;
1875}
1876
1877/**
1878 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1879 * buffer queue is full and we have to drop data
1880 *
1881 * Logged from:
1882 * system/bt
1883 */
1884message BluetoothA2dpAudioOverrunReported {
1885 // An identifier that can be used to match events for this device.
1886 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1887 // Salt: Randomly generated 256 bit value
1888 // Hash algorithm: HMAC-SHA256
1889 // Size: 32 byte
1890 // Default: null or empty if the device identifier is not known
1891 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1892 // Encoding interval in nanoseconds
1893 // Default: 0
1894 optional int64 encoding_interval_nanos = 2;
1895 // Number of buffers dropped in this event
1896 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1897 // Default: 0
1898 optional int32 num_dropped_buffers = 3;
1899 // Number of encoded buffers dropped in this event
1900 // Default 0
1901 optional int32 num_dropped_encoded_frames = 4;
1902 // Number of encoded bytes dropped in this event
1903 // Default: 0
1904 optional int32 num_dropped_encoded_bytes = 5;
1905}
1906
1907/**
1908 * Logs when we receive reports regarding a device's RSSI value
1909 *
1910 * Logged from:
1911 * system/bt
1912 */
1913message BluetoothDeviceRssiReported {
1914 // An identifier that can be used to match events for this device.
1915 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1916 // Salt: Randomly generated 256 bit value
1917 // Hash algorithm: HMAC-SHA256
1918 // Size: 32 byte
1919 // Default: null or empty if the device identifier is not known
1920 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1921 // Connection handle of this connection if available
1922 // Range: 0x0000 - 0x0EFF (12 bits)
1923 // Default: 0xFFFF if the handle is unknown
1924 optional int32 connection_handle = 2;
1925 // HCI command status code if this is triggerred by hci_cmd
1926 // Default: STATUS_UNKNOWN
1927 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1928 // BR/EDR
1929 // Range: -128 ≤ N ≤ 127 (signed integer)
1930 // Units: dB
1931 // LE:
1932 // Range: -127 to 20, 127 (signed integer)
1933 // Units: dBm
1934 // Invalid when an out of range value is reported
1935 optional int32 rssi = 4;
1936}
1937
1938/**
1939 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1940 *
1941 * Logged from:
1942 * system/bt
1943 */
1944message BluetoothDeviceFailedContactCounterReported {
1945 // An identifier that can be used to match events for this device.
1946 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1947 // Salt: Randomly generated 256 bit value
1948 // Hash algorithm: HMAC-SHA256
1949 // Size: 32 byte
1950 // Default: null or empty if the device identifier is not known
1951 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1952 // Connection handle of this connection if available
1953 // Range: 0x0000 - 0x0EFF (12 bits)
1954 // Default: 0xFFFF if the handle is unknown
1955 optional int32 connection_handle = 2;
1956 // HCI command status code if this is triggerred by hci_cmd
1957 // Default: STATUS_UNKNOWN
1958 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1959 // Number of consecutive failed contacts for a connection corresponding to the Handle
1960 // Range: uint16_t, 0-0xFFFF
1961 // Default: 0xFFFFF
1962 optional int32 failed_contact_counter = 4;
1963}
1964
1965/**
1966 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1967 *
1968 * Logged from:
1969 * system/bt
1970 */
1971message BluetoothDeviceTxPowerLevelReported {
1972 // An identifier that can be used to match events for this device.
1973 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1974 // Salt: Randomly generated 256 bit value
1975 // Hash algorithm: HMAC-SHA256
1976 // Size: 32 byte
1977 // Default: null or empty if the device identifier is not known
1978 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1979 // Connection handle of this connection if available
1980 // Range: 0x0000 - 0x0EFF (12 bits)
1981 // Default: 0xFFFF if the handle is unknown
1982 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001983 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001984 // Default: STATUS_UNKNOWN
1985 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1986 // Range: -30 ≤ N ≤ 20
1987 // Units: dBm
1988 // Invalid when an out of range value is reported
1989 optional int32 transmit_power_level = 4;
1990}
Jack Heab86dbd22018-12-18 15:43:27 -08001991
Tej Singh5d991e12018-03-09 19:48:11 -08001992/**
Jack He1021a612019-01-20 21:22:46 -08001993 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1994 * receiving an HCI command from the host
1995 *
1996 * Logged from: system/bt
1997 */
1998message BluetoothHciTimeoutReported {
1999 // HCI command associated with this event
2000 // Default: CMD_UNKNOWN
2001 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2002}
2003
2004/**
2005 * Logs when we receive Bluetooth Link Quality Report event from the controller
2006 * See Android Bluetooth HCI specification for more details
2007 *
2008 * Note: all count and bytes field are counted since last event
2009 *
2010 * Logged from: system/bt
2011 */
2012message BluetoothQualityReportReported {
2013 // Quality report ID
2014 // Original type: uint8_t
2015 // Default: BQR_ID_UNKNOWN
2016 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2017 // Packet type of the connection
2018 // Original type: uint8_t
2019 // Default: BQR_PACKET_TYPE_UNKNOWN
2020 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2021 // Connection handle of the connection
2022 // Original type: uint16_t
2023 optional int32 connection_handle = 3;
2024 // Performing Role for the connection
2025 // Original type: uint8_t
2026 optional int32 connection_role = 4;
2027 // Current Transmit Power Level for the connection. This value is the same as the controller's
2028 // response to the HCI_Read_Transmit_Power_Level HCI command
2029 // Original type: uint8_t
2030 optional int32 tx_power_level = 5;
2031 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2032 // absolute receiver signal strength value
2033 // Original type: int8_t
2034 optional int32 rssi = 6;
2035 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2036 // channels used by the link currently
2037 // Original type: uint8_t
2038 optional int32 snr = 7;
2039 // Indicates the number of unused channels in AFH_channel_map
2040 // Original type: uint8_t
2041 optional int32 unused_afh_channel_count = 8;
2042 // Indicates the number of the channels which are interfered and quality is bad but are still
2043 // selected for AFH
2044 // Original type: uint8_t
2045 optional int32 afh_select_unideal_channel_count = 9;
2046 // Current Link Supervision Timeout Setting
2047 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2048 // Original type: uint16_t
2049 optional int32 lsto = 10;
2050 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2051 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2052 // 0x01 (Piconet Clock)
2053 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2054 // Original type: uint32_t
2055 optional int64 connection_piconet_clock = 11;
2056 // The count of retransmission
2057 // Original type: uint32_t
2058 optional int64 retransmission_count = 12;
2059 // The count of no RX
2060 // Original type: uint32_t
2061 optional int64 no_rx_count = 13;
2062 // The count of NAK (Negative Acknowledge)
2063 // Original type: uint32_t
2064 optional int64 nak_count = 14;
2065 // Controller timestamp of last TX ACK
2066 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2067 // Original type: uint32_t
2068 optional int64 last_tx_ack_timestamp = 15;
2069 // The count of Flow-off (STOP)
2070 // Original type: uint32_t
2071 optional int64 flow_off_count = 16;
2072 // Controller timestamp of last Flow-on (GO)
2073 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2074 // Original type: uint32_t
2075 optional int64 last_flow_on_timestamp = 17;
2076 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2077 // Original type: uint32_t
2078 optional int64 buffer_overflow_bytes = 18;
2079 // Buffer underflow count (in byte) since last event
2080 // Original type: uint32_t
2081 optional int64 buffer_underflow_bytes = 19;
2082}
2083
2084/**
2085 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2086 *
2087 * Notes:
2088 * - Each event can be partially filled as we might learn different pieces of device
2089 * information at different time
2090 * - Multiple device info events can be combined to give more complete picture
2091 * - When multiple device info events tries to describe the same information, the
2092 * later one wins
2093 *
2094 * Logged from:
2095 * packages/apps/Bluetooth
2096 */
Jack Heaea26982019-04-04 11:19:48 -07002097message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002098 // An identifier that can be used to match events for this device.
2099 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2100 // Salt: Randomly generated 256 bit value
2101 // Hash algorithm: HMAC-SHA256
2102 // Size: 32 byte
2103 // Default: null or empty if the device identifier is not known
2104 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2105 // Where is this device info obtained from
2106 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2107 // Name of the data source
2108 // For EXTERNAL: package name of the data source
2109 // For INTERNAL: null for general case, component name otherwise
2110 optional string source_name = 3;
2111 // Name of the manufacturer of this device
2112 optional string manufacturer = 4;
2113 // Model of this device
2114 optional string model = 5;
2115 // Hardware version of this device
2116 optional string hardware_version = 6;
2117 // Software version of this device
2118 optional string software_version = 7;
2119}
2120
2121/**
2122 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2123 * device, as documented by the Bluetooth Core HCI specification
2124 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2125 * Vol 2, Part E, Page 1118
2126 *
2127 * Logged from:
2128 * system/bt
2129 */
2130message BluetoothRemoteVersionInfoReported {
2131 // Connection handle of the connection
2132 // Original type: uint16_t
2133 optional int32 connection_handle = 1;
2134 // HCI command status code
2135 // Default: STATUS_UNKNOWN
2136 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2137 // 1 byte Version of current LMP in the remote controller
2138 optional int32 lmp_version = 3;
2139 // 2 bytes LMP manufacturer code of the remote controller
2140 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2141 optional int32 lmp_manufacturer_code = 4;
2142 // 4 bytes subversion of the LMP in the remote controller
2143 optional int32 lmp_subversion = 5;
2144}
2145
2146/**
2147 * Logs when certain Bluetooth SDP attributes are discovered
2148 * Constant definitions are from:
2149 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2150 *
2151 * Current logged attributes:
2152 * - BluetoothProfileDescriptorList
2153 * - Supported Features Bitmask
2154 *
2155 * Logged from:
2156 * system/bt
2157 */
2158message BluetoothSdpAttributeReported {
2159 // An identifier that can be used to match events for this device.
2160 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2161 // Salt: Randomly generated 256 bit value
2162 // Hash algorithm: HMAC-SHA256
2163 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2164 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2165 // Original type: uint16_t
2166 optional int32 protocol_uuid = 2;
2167 // Short form UUIDs used to identify Bluetooth SDP attribute types
2168 // Original type: uint16_t
2169 optional int32 attribute_id = 3;
2170 // Attribute value for the particular attribute
2171 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2172}
2173
2174/**
2175 * Logs when bond state of a Bluetooth device changes
2176 *
2177 * Logged from:
2178 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2179 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2180 */
2181message BluetoothBondStateChanged {
2182 // An identifier that can be used to match events for this device.
2183 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2184 // Salt: Randomly generated 256 bit value
2185 // Hash algorithm: HMAC-SHA256
2186 // Size: 32 byte
2187 // Default: null or empty if the device identifier is not known
2188 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2189 // Preferred transport type to remote dual mode device
2190 // Default: TRANSPORT_AUTO means no preference
2191 optional android.bluetooth.TransportTypeEnum transport = 2;
2192 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2193 // Default: UNKNOWN
2194 optional android.bluetooth.DeviceTypeEnum type = 3;
2195 // Current bond state (NONE, BONDING, BONDED)
2196 // Default: BOND_STATE_UNKNOWN
2197 optional android.bluetooth.BondStateEnum bond_state = 4;
2198 // Bonding sub state
2199 // Default: BOND_SUB_STATE_UNKNOWN
2200 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2201 // Unbond Reason
2202 // Default: UNBOND_REASON_UNKNOWN
2203 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2204}
2205
2206/**
2207 * Logs there is an event related Bluetooth classic pairing
2208 *
2209 * Logged from:
2210 * system/bt
2211 */
2212message BluetoothClassicPairingEventReported {
2213 // An identifier that can be used to match events for this device.
2214 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2215 // Salt: Randomly generated 256 bit value
2216 // Hash algorithm: HMAC-SHA256
2217 // Size: 32 byte
2218 // Default: null or empty if the device identifier is not known
2219 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2220 // Connection handle of this connection if available
2221 // Range: 0x0000 - 0x0EFF (12 bits)
2222 // Default: 0xFFFF if the handle is unknown
2223 optional int32 connection_handle = 2;
2224 // HCI command associated with this event
2225 // Default: CMD_UNKNOWN
2226 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2227 // HCI event associated with this event
2228 // Default: EVT_UNKNOWN
2229 optional android.bluetooth.hci.EventEnum hci_event = 4;
2230 // HCI command status code if this is triggerred by hci_cmd
2231 // Default: STATUS_UNKNOWN
2232 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2233 // HCI reason code associated with this event
2234 // Default: STATUS_UNKNOWN
2235 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002236 // A status value related to this specific event
2237 // Default: 0
2238 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002239}
2240
2241/**
2242 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2243 *
2244 * Logged from:
2245 * system/bt
2246 */
2247message BluetoothSmpPairingEventReported {
2248 // An identifier that can be used to match events for this device.
2249 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2250 // Salt: Randomly generated 256 bit value
2251 // Hash algorithm: HMAC-SHA256
2252 // Size: 32 byte
2253 // Default: null or empty if the device identifier is not known
2254 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2255 // SMP command sent or received over L2CAP
2256 // Default: CMD_UNKNOWN
2257 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2258 // Whether this command is sent or received
2259 // Default: DIRECTION_UNKNOWN
2260 optional android.bluetooth.DirectionEnum direction = 3;
2261 // SMP failure reason code
2262 // Default: PAIRING_FAIL_REASON_DEFAULT
2263 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2264}
2265
2266/**
Jack He815cdba2019-01-30 17:24:55 -08002267 * Logs when a Bluetooth socket’s connection state changed
2268 *
2269 * Logged from:
2270 * system/bt
2271 */
2272message BluetoothSocketConnectionStateChanged {
2273 // An identifier that can be used to match events for this device.
2274 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2275 // Salt: Randomly generated 256 bit value
2276 // Hash algorithm: HMAC-SHA256
2277 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002278 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002279 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002280 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002281 // Default 0 when unknown or don't care
2282 optional int32 port = 2;
2283 // Socket type as mentioned in
2284 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2285 // Default: SOCKET_TYPE_UNKNOWN
2286 optional android.bluetooth.SocketTypeEnum type = 3;
2287 // Socket connection state
2288 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2289 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2290 // Number of bytes sent to remote device during this connection
2291 optional int64 tx_bytes = 5;
2292 // Number of bytes received from remote device during this connection
2293 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002294 // Socket owner's UID
2295 optional int32 uid = 7 [(is_uid) = true];
2296 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2297 // |port| must be spawned by |server_port|
2298 // Default 0 when unknown or don't care
2299 optional int32 server_port = 8;
2300 // Whether this is a server listener socket
2301 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002302}
2303
2304/**
Jack He71426802019-04-02 13:32:52 -07002305 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2306 *
2307 * Logged from:
2308 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2309 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2310 *
2311 */
2312message BluetoothClassOfDeviceReported {
2313 // An identifier that can be used to match events for this device.
2314 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2315 // Salt: Randomly generated 256 bit value
2316 // Hash algorithm: HMAC-SHA256
2317 // Size: 32 byte
2318 // Default: null or empty if this is a server listener socket
2319 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2320 // Class of Device (CoD) value including both Major, Minor device class and service class
2321 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2322 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2323 // Default: 0
2324 optional int32 class_of_device = 2;
2325}
2326
2327/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002328 * Logs when something is plugged into or removed from the USB-C connector.
2329 *
2330 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002331 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002332 */
2333message UsbConnectorStateChanged {
2334 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002335 STATE_DISCONNECTED = 0;
2336 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002337 }
2338 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002339 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002340 // Last active session in ms.
2341 // 0 when the port is in connected state.
2342 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002343}
2344
2345/**
2346 * Logs the reported speaker impedance.
2347 *
2348 * Logged from:
2349 * Vendor audio implementation.
2350 */
2351message SpeakerImpedanceReported {
2352 optional int32 speaker_location = 1;
2353 optional int32 impedance = 2;
2354}
2355
2356/**
2357 * Logs the report of a failed hardware.
2358 *
2359 * Logged from:
2360 * Vendor HALs.
2361 *
2362 */
2363message HardwareFailed {
2364 enum HardwareType {
2365 HARDWARE_FAILED_UNKNOWN = 0;
2366 HARDWARE_FAILED_MICROPHONE = 1;
2367 HARDWARE_FAILED_CODEC = 2;
2368 HARDWARE_FAILED_SPEAKER = 3;
2369 HARDWARE_FAILED_FINGERPRINT = 4;
2370 }
2371 optional HardwareType hardware_type = 1;
2372
Maggie White6dcd8572019-01-31 14:11:50 -08002373 /**
2374 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002375 * the same hardware_type. The specific locations are vendor defined integers,
2376 * referring to board-specific numbering schemes.
2377 */
2378 optional int32 hardware_location = 2;
2379
Maggie White6dcd8572019-01-31 14:11:50 -08002380 /**
2381 * failure_code is specific to the HardwareType of the failed hardware.
2382 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002383 */
Maggie White6dcd8572019-01-31 14:11:50 -08002384 enum HardwareErrorCode {
2385 UNKNOWN = 0;
2386 COMPLETE = 1;
2387 SPEAKER_HIGH_Z = 2;
2388 SPEAKER_SHORT = 3;
2389 FINGERPRINT_SENSOR_BROKEN = 4;
2390 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002391 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002392 }
2393 optional int32 failure_code = 3;
2394}
2395
2396/**
2397 * Log an event when the device has been physically dropped.
2398 * Reported from the /vendor partition.
2399 */
2400message PhysicalDropDetected {
2401 // Confidence that the event was actually a drop, 0 -> 100
2402 optional int32 confidence_pctg = 1;
2403 // Peak acceleration of the drop, in 1/1000s of a g.
2404 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002405 // Duration of freefall in ms
2406 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002407}
2408
2409/**
2410 * Log bucketed battery charge cycles.
2411 *
2412 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002413 * a given charge point. For example, if 10 cycle buckets are
2414 * initialized, bucket 1 is the lowest 1/10th of the battery,
2415 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002416 *
2417 * Logged from:
2418 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2419 */
2420message ChargeCyclesReported {
2421 optional int32 cycle_bucket_1 = 1;
2422 optional int32 cycle_bucket_2 = 2;
2423 optional int32 cycle_bucket_3 = 3;
2424 optional int32 cycle_bucket_4 = 4;
2425 optional int32 cycle_bucket_5 = 5;
2426 optional int32 cycle_bucket_6 = 6;
2427 optional int32 cycle_bucket_7 = 7;
2428 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002429 optional int32 cycle_bucket_9 = 9;
2430 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002431}
2432
2433/**
Howard Roa46b6582018-09-18 16:45:02 -07002434 * Log battery health snapshot.
2435 *
2436 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2437 * are snapshotted periodically over 24hrs.
2438 */
2439message BatteryHealthSnapshot {
2440 enum BatterySnapshotType {
2441 UNKNOWN = 0;
2442 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2443 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2444 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2445 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2446 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2447 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2448 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2449 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2450 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2451 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2452 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2453 }
2454 optional BatterySnapshotType type = 1;
2455 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002456 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002457 // Voltage Battery Voltage, in microVolts.
2458 optional int32 voltage_micro_volt = 3;
2459 // Current Battery current, in microAmps.
2460 optional int32 current_micro_amps = 4;
2461 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2462 optional int32 open_circuit_micro_volt = 5;
2463 // Resistance Battery Resistance, in microOhms.
2464 optional int32 resistance_micro_ohm = 6;
2465 // Level Battery Level, as % of full.
2466 optional int32 level_percent = 7;
2467}
2468
2469/**
2470 * Log slow I/O operations on the primary storage.
2471 */
2472message SlowIo {
2473 // Classifications of IO Operations.
2474 enum IoOperation {
2475 UNKNOWN = 0;
2476 READ = 1;
2477 WRITE = 2;
2478 UNMAP = 3;
2479 SYNC = 4;
2480 }
2481 optional IoOperation operation = 1;
2482
2483 // The number of slow IO operations of this type over 24 hours.
2484 optional int32 count = 2;
2485}
2486
2487/**
2488 * Log battery caused shutdown with the last recorded voltage.
2489 */
2490message BatteryCausedShutdown {
2491 // The last recorded battery voltage prior to shutdown.
2492 optional int32 last_recorded_micro_volt = 1;
2493}
2494
2495/**
Tej Singha72344992019-04-17 18:55:08 -07002496 * Logs when ThermalService receives throttling events.
2497 *
2498 * Logged from:
2499 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2500 */
2501message ThermalThrottlingSeverityStateChanged {
2502 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2503 optional android.os.TemperatureTypeEnum sensor_type = 1;
2504
2505 // The name of the temperature source. Eg. CPU0
2506 optional string sensor_name = 2;
2507
2508 // Temperature in tenths of a degree C.
2509 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2510 optional int32 temperature_deci_celsius = 3;
2511
2512 // Relative severity of the throttling, see enum definition.
2513 optional android.os.ThrottlingSeverityEnum severity = 4;
2514}
2515
2516/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002517 * Logs the duration of a davey (jank of >=700ms) when it occurs
2518 *
2519 * Logged from:
2520 * frameworks/base/libs/hwui/JankTracker.cpp
2521 */
2522message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002523 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002524 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002525
Tej Singhbb8554a2018-01-26 11:59:14 -08002526 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002527 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002528}
2529
2530/**
Bookatze5885242017-10-24 20:10:31 -07002531 * Logs phone signal strength changes.
2532 *
2533 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002534 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002535 */
2536message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002537 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2538 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002539}
2540
Yangster4ccebea2018-10-09 17:09:02 -07002541
2542/**
2543 * Logs when the phone state, sim state or signal strength changes
2544 *
2545 * Logged from:
2546 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2547 */
2548message PhoneServiceStateChanged {
2549 optional android.telephony.ServiceStateEnum state = 1;
2550 optional android.telephony.SimStateEnum sim_state = 2;
2551 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2552}
2553
2554/**
2555 * Logs when the phone becomes on or off.
2556 *
2557 * Logged from:
2558 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2559 */
2560message PhoneStateChanged {
2561 enum State {
2562 OFF = 0;
2563 ON = 1;
2564 }
2565 optional State state = 1;
2566}
2567
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002568message BackGesture {
2569 enum BackType {
2570 DEFAULT_BACK_TYPE = 0;
2571 COMPLETED = 1;
2572 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2573 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2574 INCOMPLETE = 4;
2575 }
2576 optional BackType type = 1;
2577
2578 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2579 enum WindowHorizontalLocation {
2580 DEFAULT_LOCATION = 0;
2581 LEFT = 1;
2582 RIGHT = 2;
2583 }
2584 optional WindowHorizontalLocation x_location = 3;
2585}
2586
2587message ExclusionRectStateChanged {
2588 optional string component_name = 1; // if not available, simply packageName
2589 optional int32 requested_height = 2; // px
2590 optional int32 rejected_height = 3; // px
2591
2592 enum WindowHorizontalLocation {
2593 DEFAULT_LOCATION = 0;
2594 LEFT = 1;
2595 RIGHT = 2;
2596 }
2597 optional WindowHorizontalLocation x_location = 4;
2598 optional bool landscape = 5;
2599 optional bool splitscreen = 6;
2600 optional int32 duration_millis = 7;
2601}
2602
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002603message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002604 optional android.stats.launcher.LauncherAction action = 1;
2605 optional android.stats.launcher.LauncherState src_state = 2;
2606 optional android.stats.launcher.LauncherState dst_state = 3;
2607 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002608 optional bool is_swipe_up_enabled = 5;
2609}
2610
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002611message StyleUIChanged {
2612 optional android.stats.style.Action action = 1;
2613 optional int32 color_package_hash = 2;
2614 optional int32 font_package_hash = 3;
2615 optional int32 shape_package_hash = 4;
2616 optional int32 clock_package_hash = 5;
2617 optional int32 launcher_grid = 6;
2618 optional int32 wallpaper_category_hash = 7;
2619 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002620 optional int32 color_preference = 9;
2621 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002622}
2623
David Chenc28b2bb2017-10-24 12:52:52 -07002624/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002625 * Logs when Settings UI has changed.
2626 *
2627 * Logged from:
2628 * packages/apps/Settings
2629 */
2630message SettingsUIChanged {
2631 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002632 * Where this SettingsUIChange event comes from. For example, if
2633 * it's a PAGE_VISIBLE event, where the page is opened from.
2634 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002635 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002636
2637 /**
2638 * What the UI action is.
2639 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002640 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002641
2642 /**
2643 * Where the action is happening
2644 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002645 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002646
2647 /**
2648 * What preference changed in this event.
2649 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002650 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002651
2652 /**
2653 * The new value of the changed preference.
2654 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002655 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002656}
2657
2658/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002659 * Logs basic timing information about touch events.
2660 * Reported at most every 5 minutes while device is being interacted with.
2661 *
2662 * Logged from:
2663 * frameworks/native/services/inputflinger
2664 */
2665message TouchEventReported {
2666 /**
2667 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002668 * and the standard deviation of the time spent processing touchscreen events
2669 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002670 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002671 * On supported devices, the starting point is taken during the hard interrupt inside the
2672 * kernel touch driver. On all other devices, the starting point is taken inside
2673 * the kernel's input event subsystem upon receipt of the input event.
2674 * The ending point is taken inside InputDispatcher, just after the input event
2675 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002676 */
2677 // Minimum value
2678 optional float latency_min_micros = 1;
2679 // Maximum value
2680 optional float latency_max_micros = 2;
2681 // Average value
2682 optional float latency_mean_micros = 3;
2683 // Standard deviation
2684 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002685 // Number of touch events (input_event) in this report
2686 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002687}
2688
2689/**
Philip Quinn0eded622019-01-29 12:46:28 -08002690 * Logs gesture classification and timing information for touch events.
2691 *
2692 * Logged from:
2693 * frameworks/base/core/java/android/view/GestureDetector.java
2694 * frameworks/base/core/java/android/view/View.java
2695 */
2696message TouchGestureClassified {
2697 // The source of the classification (e.g. Java class name).
2698 optional string source = 1;
2699
2700 enum Classification {
2701 UNKNOWN_CLASSIFICATION = 0;
2702 SINGLE_TAP = 1;
2703 DOUBLE_TAP = 2;
2704 LONG_PRESS = 3;
2705 DEEP_PRESS = 4;
2706 SCROLL = 5;
2707 }
2708 // The classification of the gesture.
2709 optional Classification classification = 2;
2710
2711 // The interval from the start of a touch event stream until the
2712 // classification was made.
2713 optional int32 latency_millis = 3;
2714
2715 // The distance from the location of the first touch event to the
2716 // location of the touch event when the classification was made.
2717 optional float displacement_px = 4;
2718}
2719
2720/**
David Chenc28b2bb2017-10-24 12:52:52 -07002721 * Logs that a setting was updated.
2722 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002723 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002724 * The tag and is_default allow resetting of settings to default values based on the specified
2725 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2726 */
2727message SettingChanged {
2728 // The name of the setting.
2729 optional string setting = 1;
2730
2731 // The change being imposed on this setting. May represent a number, eg "3".
2732 optional string value = 2;
2733
2734 // The new value of this setting. For most settings, this is same as value. For some settings,
2735 // value is +X or -X where X represents an element in a set. For example, if the previous value
2736 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2737 // The +/- feature is currently only used for location_providers_allowed.
2738 optional string new_value = 3;
2739
2740 // The previous value of this setting.
2741 optional string prev_value = 4;
2742
2743 // The tag used with the is_default for resetting sets of settings. This is generally null.
2744 optional string tag = 5;
2745
Bookatz90867622018-01-31 15:05:57 -08002746 // True if this setting with tag should be resettable.
2747 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002748
David Chenbd789912018-03-16 17:19:55 -07002749 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002750 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002751
2752 enum ChangeReason {
2753 UPDATED = 1; // Updated can be an insertion or an update.
2754 DELETED = 2;
2755 }
2756 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002757}
Chenjie Yub3dda412017-10-24 13:41:59 -07002758
Chenjie Yu05013b32017-11-21 10:21:41 -08002759/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002760 * Logs activity going to foreground or background
2761 *
2762 * Logged from:
2763 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2764 */
2765message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002766 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002767 optional string pkg_name = 2;
2768 optional string class_name = 3;
2769
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002770 enum State {
2771 BACKGROUND = 0;
2772 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002773 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002774 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002775}
David Chenc8a43242017-10-17 16:23:28 -07002776
2777/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002778 * Logs when a volume entered low Storage state.
2779 * Logged from:
2780 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2781 */
2782message LowStorageStateChanged {
2783 // Volume that ran out of storage.
2784 optional string volume_description = 1;
2785
2786 enum State {
2787 UNKNOWN = 0;
2788 OFF = 1;
2789 ON = 2;
2790 }
2791 optional State state = 2;
2792}
2793
2794/**
2795 * Logs when an app is downgraded.
2796 * Logged from:
2797 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2798 */
2799message AppDowngraded {
2800 optional string package_name = 1;
2801 // Size of the package (all data) before being downgraded.
2802 optional int64 size_in_bytes_before = 2;
2803 // Size of the package (all data) after being downgraded.
2804 optional int64 size_in_bytes_after = 3;
2805
2806 optional bool aggressive = 4;
2807}
2808
2809/**
2810 * Logs when an app is optimized after being downgraded.
2811 * Logged from:
2812 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2813 */
2814message AppOptimizedAfterDowngraded {
2815 optional string package_name = 1;
2816}
2817
2818/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002819 * Logs whenever an app is installed on external storage.
2820 * Logged from:
2821 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2822 */
2823message AppInstallOnExternalStorageReported {
2824 // The type of external storage.
2825 optional android.stats.storage.ExternalStorageType storage_type = 1;
2826 // The name of the package that is installed on the sd card.
2827 optional string package_name = 2;
2828}
2829
2830/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002831 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002832 * Logged from:
2833 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2834 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002835message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002836 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002837
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002838 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002839
2840 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002841 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002842 optional string process_name = 3;
2843
2844 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002845 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002846
2847 optional string package_name = 5;
2848
2849 enum InstantApp {
2850 UNAVAILABLE = 0;
2851 FALSE = 1;
2852 TRUE = 2;
2853 }
2854 optional InstantApp is_instant_app = 6;
2855
2856 enum ForegroundState {
2857 UNKNOWN = 0;
2858 BACKGROUND = 1;
2859 FOREGROUND = 2;
2860 }
2861 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002862
2863 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002864}
David Chen9e3808c2017-11-20 17:25:34 -08002865
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002866/**
2867 * Logs when a WTF (What a Terrible Failure) happened.
2868 * Logged from:
2869 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2870 */
2871message WTFOccurred {
2872 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002873
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002874 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002875
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002876 // The name of the process.
2877 // system_server if it is not by an app
2878 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002879
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002880 // The pid if available. -1 means not available.
2881 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002882
2883 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002884}
2885
2886/**
2887 * Logs when system server reports low memory.
2888 * Logged from:
2889 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2890 */
2891message LowMemReported {
2892}
2893
2894/**
2895 * Logs when an app ANR (App Not Responding) occurs.
2896 * Logged from:
2897 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2898 */
2899message ANROccurred {
2900 optional int32 uid = 1 [(is_uid) = true];
2901
2902 optional string process_name = 2;
2903
2904 optional string short_component_name = 3;
2905
2906 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002907
2908 enum InstantApp {
2909 UNAVAILABLE = 0;
2910 FALSE = 1;
2911 TRUE = 2;
2912 }
2913 optional InstantApp is_instant_app = 5;
2914
2915 enum ForegroundState {
2916 UNKNOWN = 0;
2917 BACKGROUND = 1;
2918 FOREGROUND = 2;
2919 }
2920 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002921
2922 optional android.server.ErrorSource error_source = 7;
2923
2924 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002925}
2926
Bookatza7020bd2018-08-28 16:29:35 -07002927/**
2928 * Logs when the vibrator state changes.
2929 * Logged from:
2930 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2931 */
2932message VibratorStateChanged {
2933 repeated AttributionNode attribution_node = 1;
2934
2935 enum State {
2936 OFF = 0;
2937 ON = 1;
2938 }
2939 optional State state = 2;
2940
2941 // Duration (in milliseconds) requested to keep the vibrator on.
2942 // Only applicable for State == ON.
2943 optional int64 duration_millis = 3;
2944}
2945
David Chen0a368b22017-12-06 16:28:16 -08002946/*
2947 * Allows other apps to push events into statsd.
2948 * Logged from:
2949 * frameworks/base/core/java/android/util/StatsLog.java
2950 */
David Chen0b5c90c2018-01-25 16:51:49 -08002951message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002952 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002953 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002954
2955 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2956 optional int32 label = 2;
2957
2958 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2959 // predicates for the metrics).
2960 enum State {
2961 UNKNOWN = 0;
2962 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2963 STOP = 2;
2964 START = 3;
2965 }
2966 optional State state = 3;
2967}
2968
David Chen9e3808c2017-11-20 17:25:34 -08002969/**
Bookatz7948c872018-09-04 12:58:33 -07002970 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2971 * For example, this could be due to the user manually changing the time.
2972 *
2973 * Logged from:
2974 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2975 */
2976message WallClockTimeShifted {
2977 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2978 optional int64 wall_clock_timestamp_millis = 1;
2979}
2980
2981/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002982 * Logs when statsd detects an anomaly.
2983 *
2984 * Logged from:
2985 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2986 */
2987message AnomalyDetected {
2988 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002989 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002990
Yangster-mac94e197c2018-01-02 16:03:03 -08002991 // Id of the config whose anomaly detection alert fired.
2992 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002993
Yangster-mac94e197c2018-01-02 16:03:03 -08002994 // Id of the alert (i.e. name of the anomaly that was detected).
2995 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002996}
2997
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002998message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002999 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003000 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003001
3002 // The app package name.
3003 optional string pkg_name = 2;
3004
3005 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003006 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003007 WARM = 1;
3008 HOT = 2;
3009 COLD = 3;
3010 }
3011 // The transition type.
3012 optional TransitionType type = 3;
3013
3014 // The activity name.
3015 optional string activity_name = 4;
3016
3017 // The name of the calling app. Empty if not set.
3018 optional string calling_pkg_name = 5;
3019
3020 // Whether the app is an instant app.
3021 optional bool is_instant_app = 6;
3022
3023 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003024 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003025
Bookatz80d11a02018-01-16 10:46:35 -08003026 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003027
David Chen0b5c90c2018-01-25 16:51:49 -08003028 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003029 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003030 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003031 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003032 optional int32 bind_application_delay_millis = 11;
3033 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003034
3035 // Empty if not set.
3036 optional string launch_token = 13;
3037
Calin Juravle759fbda2018-02-20 19:52:30 +00003038 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003039 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003040
3041 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003042 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003043}
3044
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003045message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003046 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003047 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003048
3049 // The app package name.
3050 optional string pkg_name = 2;
3051
3052 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003053 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003054 WARM = 1;
3055 HOT = 2;
3056 COLD = 3;
3057 }
3058 // The transition type.
3059 optional TransitionType type = 3;
3060
3061 // The activity name.
3062 optional string activity_name = 4;
3063}
3064
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003065message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003066 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003067 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003068
3069 // The app package name.
3070 optional string pkg_name = 2;
3071
3072 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003073 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003074 WITH_BUNDLE = 1;
3075 WITHOUT_BUNDLE = 2;
3076 }
3077 // The transition type.
3078 optional TransitionType type = 3;
3079
3080 // The activity name.
3081 optional string activity_name = 4;
3082
3083 optional bool transition_process_running = 5;
3084
3085 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003086 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003087}
3088
Bookatz8fcd09a2017-12-18 13:01:10 -08003089/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003090 * Logs a picture-in-picture action
3091 * Logged from:
3092 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3093 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3094 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3095 */
3096message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003097 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003098 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003099
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003100 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003101
Chenjie Yu52cacc62017-12-08 18:11:45 -08003102 enum State {
3103 ENTERED = 1;
3104 EXPANDED_TO_FULL_SCREEN = 2;
3105 MINIMIZED = 3;
3106 DISMISSED = 4;
3107 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003108 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003109}
3110
3111/**
Chenjie Yue8904192017-12-08 19:12:57 -08003112 * Logs overlay action
3113 * Logged from:
3114 * services/core/java/com/android/server/wm/Session.java
3115 */
3116message OverlayStateChanged {
tsaichristine10978642019-09-10 14:12:49 -07003117 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003118
tsaichristine10978642019-09-10 14:12:49 -07003119 optional string package_name = 2 [(state_field_option).option = PRIMARY];
Chenjie Yue8904192017-12-08 19:12:57 -08003120
3121 optional bool using_alert_window = 3;
3122
3123 enum State {
3124 ENTERED = 1;
3125 EXITED = 2;
3126 }
tsaichristine10978642019-09-10 14:12:49 -07003127 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Chenjie Yue8904192017-12-08 19:12:57 -08003128}
3129
Chenjie Yuccfe6452018-01-30 11:33:21 -08003130/*
3131 * Logs foreground service starts and stops.
3132 * Note that this is not when a service starts or stops, but when it is
3133 * considered foreground.
3134 * Logged from
3135 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3136 */
3137message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003138 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003139 // package_name + "/" + class_name
3140 optional string short_name = 2;
3141
3142 enum State {
3143 ENTER = 1;
3144 EXIT = 2;
3145 }
3146 optional State state = 3;
3147}
3148
Chenjie Yue8904192017-12-08 19:12:57 -08003149/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003150 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3151 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3152 * attributed back to the parent (host) uid. One example is Chrome.
3153 *
3154 * Logged from:
3155 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3156 */
3157message IsolatedUidChanged {
3158 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003159 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003160 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003161 optional int32 parent_uid = 1;
3162
3163 optional int32 isolated_uid = 2;
3164
3165 // We expect an isolated uid to be removed before if it's used for another parent uid.
3166 enum Event {
3167 REMOVED = 0;
3168 CREATED = 1;
3169 }
3170 optional Event event = 3;
3171}
3172
3173/*
3174 * Logs the reception of an incoming network packet causing the main system to wake up for
3175 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3176 * and processed by WakeupController.cpp.
3177 */
3178message PacketWakeupOccurred {
3179 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3180 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003181 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003182 // The interface name on which the packet was received.
3183 optional string iface = 2;
3184 // The ethertype value of the packet.
3185 optional int32 ethertype = 3;
3186 // String representation of the destination MAC address of the packet.
3187 optional string destination_hardware_address = 4;
3188 // String representation of the source address of the packet if this was an IP packet.
3189 optional string source_ip = 5;
3190 // String representation of the destination address of the packet if this was an IP packet.
3191 optional string destination_ip = 6;
3192 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3193 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3194 // families.
3195 optional int32 ip_next_header = 7;
3196 // The source port if this was a TCP or UDP packet.
3197 optional int32 source_port = 8;
3198 // The destination port if this was a TCP or UDP packet.
3199 optional int32 destination_port = 9;
3200}
3201
3202/*
3203 * Logs the memory stats for an app on startup.
3204 * Logged from:
3205 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3206 */
3207message AppStartMemoryStateCaptured {
3208 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003209 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003210
3211 // The process name.
3212 optional string process_name = 2;
3213
3214 // The activity name.
3215 optional string activity_name = 3;
3216
3217 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003218 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003219
3220 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003221 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003222
3223 // RSS
3224 optional int64 rss_in_bytes = 6;
3225
3226 // CACHE
3227 optional int64 cache_in_bytes = 7;
3228
3229 // SWAP
3230 optional int64 swap_in_bytes = 8;
3231}
3232
3233/*
3234 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3235 * for LMK event.
3236 * Logged from:
3237 * system/core/lmkd/lmkd.c
3238 */
3239message LmkStateChanged {
3240 enum State {
3241 UNKNOWN = 0;
3242 START = 1;
3243 STOP = 2;
3244 }
3245 optional State state = 1;
3246}
3247
3248/*
3249 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3250 * Logged from:
3251 * system/core/lmkd/lmkd.c
3252 */
3253message LmkKillOccurred {
3254 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003255 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003256
3257 // The process name.
3258 optional string process_name = 2;
3259
3260 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003261 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003262
3263 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003264 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003265
3266 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003267 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003268
3269 // RSS
3270 optional int64 rss_in_bytes = 6;
3271
3272 // CACHE
3273 optional int64 cache_in_bytes = 7;
3274
3275 // SWAP
3276 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003277
3278 // The elapsed real time of start of the process.
3279 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003280
3281 // Min oom adj score considered by lmkd.
3282 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003283}
3284
Rajeev Kumar51b54602018-03-01 12:18:26 -08003285/*
3286 * Logs when the ActivityManagerService detects that an app died.
3287 *
3288 * Logged from:
3289 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3290 */
3291message AppDied {
3292 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003293 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003294}
3295
Howard Ro21a039c2018-08-06 14:55:47 -07003296/**
3297 * An atom for generic metrics logging. Available from Android Q.
3298 */
3299message GenericAtom {
3300 // The uid of the application that sent this custom atom.
3301 optional int32 uid = 1 [(is_uid) = true];
3302
3303 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003304 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003305}
3306
Tej Singhd6d6d772018-09-05 17:41:25 -07003307/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003308 * Atom for simple logging of user interaction and impression events, such as "the user touched
3309 * this button" or "this dialog was displayed".
3310 * Keep the UI event stream clean: don't use for system or background events.
3311 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
3312 */
3313message UiEventReported {
3314 // The event_id.
3315 optional int32 event_id = 1;
3316 // The event's source or target uid and package, if applicable.
3317 // For example, the package posting a notification, or the destination package of a share.
3318 optional int32 uid = 2 [(is_uid) = true];
3319 optional string package_name = 3;
3320}
3321
3322/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003323 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003324 *
3325 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003326 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003327 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003328message BiometricAcquired {
3329 // Biometric modality that was acquired.
3330 optional android.hardware.biometrics.ModalityEnum modality = 1;
3331 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3332 optional int32 user = 2;
3333 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3334 optional bool is_crypto = 3;
3335 // Action that the device is performing. Acquired messages are only expected for enroll and
3336 // authenticate. Other actions may indicate an error.
3337 optional android.hardware.biometrics.ActionEnum action = 4;
3338 // The client that this acquisition was received for.
3339 optional android.hardware.biometrics.ClientEnum client = 5;
3340 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3341 optional int32 acquire_info = 6;
3342 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3343 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003344 // Dictates if this message should trigger additional debugging.
3345 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003346}
3347
3348/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003349 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003350 *
3351 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003352 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003353 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003354message BiometricAuthenticated {
3355 // Biometric modality that was used.
3356 optional android.hardware.biometrics.ModalityEnum modality = 1;
3357 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3358 optional int32 user = 2;
3359 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3360 // storage.
3361 optional bool is_crypto = 3;
3362 // The client that this acquisition was received for.
3363 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003364 // If authentication requires user confirmation. See BiometricPrompt's
3365 // setRequireConfirmation(bool) method.
3366 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003367
Kevin Chyn1741a072019-01-17 11:54:40 -08003368 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003369 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003370 REJECTED = 1;
3371 PENDING_CONFIRMATION = 2;
3372 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003373 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003374
3375 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003376 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003377 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3378 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3379 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3380 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003381 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003382 // Dictates if this message should trigger additional debugging.
3383 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003384}
3385
3386/**
3387 * Logs when a biometric error occurs.
3388 *
3389 * Logged from:
3390 * frameworks/base/services/core/java/com/android/server/biometrics
3391 */
3392message BiometricErrorOccurred {
3393 // Biometric modality that was used.
3394 optional android.hardware.biometrics.ModalityEnum modality = 1;
3395 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3396 optional int32 user = 2;
3397 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3398 optional bool is_crypto = 3;
3399 // Action that the device is performing.
3400 optional android.hardware.biometrics.ActionEnum action = 4;
3401 // The client that this acquisition was received for.
3402 optional android.hardware.biometrics.ClientEnum client = 5;
3403 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3404 // are unique to modality.
3405 optional int32 error_info = 6;
3406 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3407 // by the vendor and not specified by the HIDL interface.
3408 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003409 // Dictates if this message should trigger additional debugging.
3410 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003411 // Time spent during the authentication attempt.
3412 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003413}
3414
3415/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003416 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003417 * Logged from:
3418 * frameworks/base/services/core/java/com/android/server/biometrics
3419 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003420message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003421 // Biometric modality.
3422 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003423 // Type of issue detected.
3424 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003425 // Dictates if this message should trigger additional debugging.
3426 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003427}
Howard Ro688ae182018-09-25 00:09:36 -07003428
joshmccloskey6f952b22019-03-25 20:59:35 -07003429/**
3430 * Logs when a biometric enrollment occurs.
3431 *
3432 * Logged from:
3433 * frameworks/base/services/core/java/com/android/server/biometrics
3434 */
3435message BiometricEnrolled {
3436 // Biometric modality that was used.
3437 optional android.hardware.biometrics.ModalityEnum modality = 1;
3438 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3439 optional int32 user = 2;
3440 // The amount of time the enrollment took in milliseconds.
3441 optional int64 latency_millis = 3;
3442 // Whether or not the enrollment was successful.
3443 optional bool success = 4;
3444}
3445
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003446/*
Tej Singh0d176952019-01-16 19:10:54 -08003447 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003448 */
Tej Singh0d176952019-01-16 19:10:54 -08003449message FlagFlipUpdateOccurred {
3450 // If the event is from a flag config package, specify the package name.
3451 optional string flag_flip_package_name = 1;
3452
3453 // The order id of the package
3454 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003455}
3456
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003457/**
3458 * Potential experiment ids that goes with a train install.
3459 */
3460message TrainExperimentIds {
3461 repeated int64 experiment_id = 1;
3462}
3463
Yangster-macb89807e2018-11-15 21:10:57 -08003464/*
3465 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003466 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003467 */
3468message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003469 // Name of the train.
3470 optional string train_name = 1;
3471 // Version code for a "train" of packages that need to be installed atomically
3472 optional int64 train_version_code = 2;
3473 // After installation of this package, device requires a restart.
3474 optional bool requires_staging = 3;
3475 // Rollback should be enabled for this install.
3476 optional bool rollback_enabled = 4;
3477 // Requires low latency monitoring if possible.
3478 optional bool requires_low_latency_monitor = 5;
3479
Yangster-macb89807e2018-11-15 21:10:57 -08003480 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003481 UNKNOWN = 0;
3482 INSTALL_REQUESTED = 1;
3483 INSTALL_STARTED = 2;
3484 INSTALL_STAGED_NOT_READY = 3;
3485 INSTALL_STAGED_READY = 4;
3486 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003487 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3488 // and INSTALL_FAILURE_COMMIT.
3489 INSTALL_FAILURE = 6 [deprecated = true];
3490 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003491 INSTALL_CANCELLED = 7;
3492 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003493 INSTALLER_ROLLBACK_INITIATED = 9;
3494 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3495 INSTALLER_ROLLBACK_STAGED = 11;
3496 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3497 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3498 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3499 INSTALLER_ROLLBACK_SUCCESS = 15;
3500 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003501 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3502 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3503 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3504 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3505 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3506 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003507 INSTALL_FAILURE_DOWNLOAD = 23;
3508 INSTALL_FAILURE_STATE_MISMATCH = 24;
3509 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003510 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003511 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003512 // Possible experiment ids for monitoring this push.
3513 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3514 // user id
3515 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003516}
3517
Tej Singhc9203082019-05-03 13:42:23 -07003518/* Test atom, is not logged anywhere */
3519message TestAtomReported {
3520 repeated AttributionNode attribution_node = 1;
3521 optional int32 int_field = 2;
3522 optional int64 long_field = 3;
3523 optional float float_field = 4;
3524 optional string string_field = 5;
3525 optional bool boolean_field = 6;
3526 enum State {
3527 UNKNOWN = 0;
3528 OFF = 1;
3529 ON = 2;
3530 }
3531 optional State state = 7;
3532 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3533}
3534
Maggie Whitefc1aa592018-11-28 21:55:23 -08003535/** Represents USB port overheat event. */
3536message UsbPortOverheatEvent {
3537 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3538 optional int32 plug_temperature_deci_c = 1;
3539
3540 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3541 optional int32 max_temperature_deci_c = 2;
3542
3543 /* Time between USB plug event and overheat threshold trip, in seconds. */
3544 optional int32 time_to_overheat_secs = 3;
3545
3546 /* Time between overheat threshold trip and hysteresis, in seconds. */
3547 optional int32 time_to_hysteresis_secs = 4;
3548
3549 /* Time between hysteresis and active mitigation ending, in seconds. */
3550 optional int32 time_to_inactive_secs = 5;
3551};
3552
Maggie White8735b852019-01-18 11:40:49 -08003553/**
3554 * Logs total effective full charge and discharge cycles on a battery.
3555 * Here are some examples of one effective cycle:
3556 * 1) the battery charges from 0% to 100% and drains back to 0%,
3557 * 2) charging from 50% to 100% and draining back to 50% twice.
3558 * Pulled from:
3559 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3560 */
3561message BatteryCycleCount {
3562 /* Number of total charge and discharge cycles on the system battery. */
3563 optional int32 cycle_count = 1;
3564}
3565
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003566/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003567 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3568 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003569 * Pulled from:
3570 * StatsCompanionService
3571 */
3572
Carmen Agimof12dec122019-03-06 16:14:38 +00003573message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003574
Carmen Agimof12dec122019-03-06 16:14:38 +00003575 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003576 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003577 PUBLIC = 1;
3578 PRIVATE = 2;
3579 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003580 }
3581
Carmen Agimof12dec122019-03-06 16:14:38 +00003582 // The type of external storage.
3583 optional android.stats.storage.ExternalStorageType storage_type = 1;
3584 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3585 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003586 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003587 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003588}
3589
Yangster-macb89807e2018-11-15 21:10:57 -08003590/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003591 * Logs when a connection becomes available and lost.
3592 * Logged in StatsCompanionService.java
3593 */
3594message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003595 // Id of the network.
3596 optional int32 net_id = 1;
3597
3598 enum State {
3599 UNKNOWN = 0;
3600 CONNECTED = 1;
3601 DISCONNECTED = 2;
3602 }
3603 // Connected state of a network.
3604 optional State state = 2;
3605}
3606
3607/**
3608 * Logs when a service starts and stops.
3609 * Logged from:
3610 * services/core/java/com/android/server/am/ActiveServices.java
3611 */
3612message ServiceStateChanged {
3613
3614 optional int32 uid = 1 [(is_uid) = true];
3615
3616 optional string package_name = 2;
3617
3618 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003619
3620 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003621 START = 1;
3622 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003623 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003624
3625 optional State state = 4;
3626}
3627
3628/**
3629 * Logs when a service is launched.
3630 * Logged from:
3631 * services/core/java/com/android/server/am/ActiveServices.java
3632 */
3633message ServiceLaunchReported {
3634
3635 optional int32 uid = 1 [(is_uid) = true];
3636
3637 optional string package_name = 2;
3638
3639 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003640}
Howard Ro688ae182018-09-25 00:09:36 -07003641
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003642/**
3643 * Logs when a hidden API is used.
3644 *
3645 * Logged from:
3646 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3647 */
3648message HiddenApiUsed {
3649 // The uid of the app making the hidden access.
3650 optional int32 uid = 1 [(is_uid) = true];
3651
3652 // Signature of the method or field accessed.
3653 optional string signature = 2;
3654
3655 enum AccessMethod {
3656 NONE = 0;
3657 REFLECTION = 1;
3658 JNI = 2;
3659 LINKING = 3;
3660 }
3661
3662 // Type of access.
3663 optional AccessMethod access_method = 3;
3664
3665 // Whether the access was prevented or not.
3666 optional bool access_denied = 4;
3667}
3668
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003669/**
3670 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3671 * - When user sees privacy chip
3672 * - When user clicks privacy chip
3673 * - How does the user exit the Privacy Dialog
3674 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003675 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3676 */
3677message PrivacyIndicatorsInteracted {
3678
3679 enum Type {
3680 UNKNOWN = 0;
3681 CHIP_VIEWED = 1;
3682 CHIP_CLICKED = 2;
3683 DIALOG_PRIVACY_SETTINGS = 3;
3684 DIALOG_DISMISS = 4;
3685 DIALOG_LINE_ITEM = 5;
3686 }
3687
3688 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3689
3690 // Used if the type is LINE_ITEM
3691 optional string package_name = 2;
3692}
3693
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003694/**
3695 * Logs information about a package that is moved from the internal to external storage and vice
3696 * versa.
3697 * It logs the package name, the type of the external storage where the package is installed
3698 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3699 * and the move type: if it's from internal to external or the other way around.
3700 *
3701 * Logged from:
3702 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3703 */
3704message AppMovedStorageReported {
3705 enum MoveType {
3706 UNKNOWN = 0;
3707 TO_EXTERNAL = 1;
3708 TO_INTERNAL = 2;
3709 }
3710 // The type of the external storage.
3711 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3712 // The type of move.
3713 optional MoveType move_type = 2;
3714 // The name of the package that was moved.
3715 optional string package_name = 3;
3716}
3717
jianjin8f2dee02019-03-29 14:03:08 -07003718/**
3719 * Logs when system server watchdog occurs.
3720 * Logged from:
3721 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3722 */
3723message SystemServerWatchdogOccurred {
3724 optional string subject = 1;
3725}
3726
3727/**
3728 * Logs when new file added to tombstones.
3729 * Logged from:
3730 * frameworks/base/core/java/com/android/server/BootReceiver.java
3731 */
3732message TombStoneOccurred {
3733}
3734
Hai Zhang5d3328d2019-04-13 21:25:06 +08003735/*
3736 * Information about a role request
3737 *
3738 * Logged from:
3739 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3740 */
3741message RoleRequestResultReported {
3742 // UID of application requesting the role
3743 optional int32 requesting_uid = 1;
3744
3745 // Package name of application requesting the role
3746 optional string requesting_package_name = 2;
3747
3748 // The role to be granted
3749 optional string role_name = 3;
3750
3751 // The count of applications qualifying for the role
3752 optional int32 qualifying_count = 4;
3753
3754 // UID of application current granted the role
3755 optional int32 current_uid = 5;
3756
3757 // Package name of application current granted the role
3758 optional string current_package_name = 6;
3759
3760 // UID of another application that user chose to grant the role to, instead of the requesting
3761 // application
3762 optional int32 granted_another_uid = 7;
3763
3764 // Package name of another application that user chose to grant the role to, instead of the
3765 // requesting application
3766 optional string granted_another_package_name = 8;
3767
3768 enum Result {
3769 UNDEFINED = 0;
3770 // role request was ignored
3771 IGNORED = 1;
3772 // role request was ignored because it's already granted
3773 IGNORED_ALREADY_GRANTED = 2;
3774 // role request was ignored because the application isn't qualified
3775 IGNORED_NOT_QUALIFIED = 3;
3776 // role request was ignored because user said it should be always denied
3777 IGNORED_USER_ALWAYS_DENIED = 4;
3778 // role was granted by user action
3779 USER_GRANTED = 5;
3780 // role was denied by user action
3781 USER_DENIED = 6;
3782 // role was denied by user granting another application the role
3783 USER_DENIED_GRANTED_ANOTHER = 7;
3784 // role was denied and set to be always denied by the user
3785 USER_DENIED_WITH_ALWAYS = 8;
3786 }
3787 // The result of the role request
3788 optional Result result = 9;
3789}
3790
Mark Tabrya824a642019-11-05 12:26:12 -08003791/**
3792 * Logs when a Vehicle Maps Service client's connection state has changed
3793 *
3794 * Logged from:
3795 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
3796 */
3797message VmsClientConnectionStateChanged {
3798 // The UID of the VMS client app
3799 optional int32 uid = 1 [(is_uid) = true];
3800
3801 enum State {
3802 UNKNOWN = 0;
3803 // Attempting to connect to the client
3804 CONNECTING = 1;
3805 // Client connection established
3806 CONNECTED = 2;
3807 // Client connection closed unexpectedly
3808 DISCONNECTED = 3;
3809 // Client connection closed by VMS
3810 TERMINATED = 4;
3811 // Error establishing the client connection
3812 CONNECTION_ERROR = 5;
3813 }
3814
3815 optional State state = 2;
3816}
3817
Jeff Sharkey6bd21572019-11-15 20:45:33 -07003818/**
3819 * Logs when MediaProvider has successfully finished scanning a storage volume.
3820 *
3821 * Logged from:
3822 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
3823 */
3824message MediaProviderScanEvent {
3825 enum Reason {
3826 // Scan triggered due to unknown reason
3827 UNKNOWN = 0;
3828 // Scan triggered due to storage volume being mounted
3829 MOUNTED = 1;
3830 // Scan triggered due to explicit user action or app request
3831 DEMAND = 2;
3832 // Scan triggered due to idle maintenance
3833 IDLE = 3;
3834 }
3835
3836 // Volume type that this event pertains to
3837 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3838 // Reason why this scan was triggered
3839 optional Reason reason = 2;
3840 // Total number of files scanned
3841 optional int64 item_count = 3;
3842 // Duration of scan, normalized per file
3843 optional float normalized_duration_millis = 4;
3844 // Number of database inserts, normalized per file
3845 optional float normalized_insert_count = 5;
3846 // Number of database updates, normalized per file
3847 optional float normalized_update_count = 6;
3848 // Number of database deletes, normalized per file
3849 optional float normalized_delete_count = 7;
3850}
3851
3852/**
3853 * Logs when an app has asked MediaProvider to delete media belonging to the user.
3854 *
3855 * Logged from:
3856 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
3857 */
3858message MediaProviderDeletionEvent {
3859 // Volume type that this event pertains to
3860 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3861 // Device timestamp when this deletion event occurred
3862 optional int64 timestamp_millis = 2;
3863 // App that requested deletion
3864 optional string package_name = 3;
3865 // Number of items that were deleted
3866 optional int32 item_count = 4;
3867}
3868
3869/**
3870 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
3871 *
3872 * Logged from:
3873 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
3874 */
3875message MediaProviderPermissionEvent {
3876 enum Result {
3877 UNKNOWN = 0;
3878 USER_GRANTED = 1;
3879 AUTO_GRANTED = 2;
3880 USER_DENIED = 3;
3881 USER_DENIED_WITH_PREJUDICE = 4;
3882 AUTO_DENIED = 5;
3883 }
3884
3885 // Volume type that this event pertains to
3886 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3887 // Device timestamp when this permission event occurred
3888 optional int64 timestamp_millis = 2;
3889 // App that requested permission
3890 optional string package_name = 3;
3891 // Number of items that were requested
3892 optional int32 item_count = 4;
3893 // Result of this request
3894 optional Result result = 5;
3895}
3896
3897/**
3898 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
3899 *
3900 * Logged from:
3901 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
3902 */
3903message MediaProviderSchemaChange {
3904 // Volume type that this event pertains to
3905 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3906 // Old database version code
3907 optional int32 version_from = 2;
3908 // New database version code
3909 optional int32 version_to = 3;
3910 // Total number of files in database
3911 optional int64 item_count = 4;
3912 // Duration of schema change, normalized per file
3913 optional float normalized_duration_millis = 5;
3914}
3915
3916/**
3917 * Logs when MediaProvider has finished an idle maintenance job.
3918 *
3919 * Logged from:
3920 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
3921 */
3922message MediaProviderIdleMaintenance {
3923 // Volume type that this event pertains to
3924 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3925
3926 // Total number of files in database
3927 optional int64 item_count = 2;
3928 // Duration of idle maintenance, normalized per file
3929 optional float normalized_duration_millis = 3;
3930 // Number of thumbnails found to be stale, normalized per file
3931 optional float normalized_stale_thumbnails = 4;
3932 // Number of items found to be expired, normalized per file
3933 optional float normalized_expired_media = 5;
3934}
3935
Keun young Park3e033cb2019-12-18 11:27:35 -08003936/**
3937 * Represents boot time event with duration in ms.
3938 *
3939 * Logged from: bootstat and various system server components. Check each enums for details.
3940 */
3941message BootTimeEventDuration {
3942 enum DurationEvent {
3943 UNKNOWN = 0;
3944 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
3945 ABSOLUTE_BOOT_TIME = 1;
3946 // Bootloader's 1st stage execution time.
3947 // Logged from bootstat.
3948 BOOTLOADER_FIRST_STAGE_EXEC = 2;
3949 // Bootloader's 1st stage loading time.
3950 // Logged from bootstat.
3951 BOOTLOADER_FIRST_STAGE_LOAD = 3;
3952 // Bootloader's kernel loading time.
3953 // Logged from bootstat.
3954 BOOTLOADER_KERNEL_LOAD = 4;
3955 // Bootloader's 2nd stage execution time.
3956 // Logged from bootstat.
3957 BOOTLOADER_SECOND_STAGE_EXEC = 5;
3958 // Bootloader's 2nd stage loading time.
3959 // Logged from bootstat.
3960 BOOTLOADER_SECOND_STAGE_LOAD = 6;
3961 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
3962 // for locked device.
3963 // Logged from bootstat.
3964 BOOTLOADER_UI_WAIT = 7;
3965 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
3966 // Logged from bootstat.
3967 BOOTLOADER_TOTAL = 8;
3968 // Shutdown duration inside init for the reboot before the current boot up.
3969 // Logged from f/b/services/.../BootReceiver.java.
3970 SHUTDOWN_DURATION = 9;
3971 // Total time for mounting of disk devices during bootup.
3972 // Logged from f/b/services/.../BootReceiver.java.
3973 MOUNT_DEFAULT_DURATION = 10;
3974 // Total time for early stage mounting of disk devices during bootup.
3975 // Logged from f/b/services/.../BootReceiver.java.
3976 MOUNT_EARLY_DURATION = 11;
3977 // Total time for late stage mounting of disk devices during bootup.
3978 // Logged from f/b/services/.../BootReceiver.java.
3979 MOUNT_LATE_DURATION = 12;
3980 // Average time to scan non-system app after OTA
3981 // Logged from f/b/services/.../PackageManagerService.java
3982 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
3983 // Time to initialize Package manager after OTA
3984 // Logged from f/b/services/.../PackageManagerService.java
3985 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
3986 // Time to scan all system app from Package manager after OTA
3987 // Logged from f/b/services/.../PackageManagerService.java
3988 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
3989 // Init's total time for cold boot stage.
3990 // Logged from bootstat.
3991 COLDBOOT_WAIT = 16;
3992 // Init's total time for initializing selinux.
3993 // Logged from bootstat.
3994 SELINUX_INIT = 17;
3995 // Time since last factory reset.
3996 // Logged from bootstat.
3997 FACTORY_RESET_TIME_SINCE_RESET = 18;
3998 }
3999
4000 // Type of the event.
4001 optional DurationEvent event = 1;
4002 // Duration of the event in ms.
4003 optional int64 duration_millis = 2;
4004}
4005
4006/**
4007 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4008 * since boot-up.
4009 *
4010 * Logged from: bootstat and various system server components. Check each enums for details.
4011 */
4012message BootTimeEventElapsedTime {
4013 enum ElapsedTimeEvent {
4014 UNKNOWN = 0;
4015 // Time when init starts 1st stage. Logged from bootstat.
4016 ANDROID_INIT_STAGE_1 = 1;
4017 // Time when sys.boot_completed prop is set.
4018 // Logged from bootstat.
4019 BOOT_COMPLETE = 2;
4020 // BOOT_COMPLETE for encrypted device.
4021 BOOT_COMPLETE_ENCRYPTION = 3;
4022 // BOOT_COMPLETE for device with no encryption.
4023 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4024 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
4025 BOOT_COMPLETE_POST_DESCRYPT = 5;
4026 // BOOT_COMPLETE after factory reset.
4027 FACTORY_RESET_BOOT_COMPLETE = 6;
4028 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4029 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
4030 // BOOT_COMPLETE_POST_DESCRYPT after factory reset.
4031 FACTORY_RESET_BOOT_COMPLETE_POST_DESCRYPT = 8;
4032 // BOOT_COMPLETE after OTA.
4033 OTA_BOOT_COMPLETE = 9;
4034 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4035 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
4036 // BOOT_COMPLETE_POST_DESCRYPT after OTA.
4037 OTA_BOOT_COMPLETE_POST_DESCRYPT = 11;
4038 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4039 // Logged from f/b/services/.../UserController.java
4040 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4041 // Time when the system starts sending BOOT_COMPLETED broadcast.
4042 // Logged from f/b/services/.../UserController.java
4043 FRAMEWORK_BOOT_COMPLETED = 13;
4044 // Time when the package manager starts init.
4045 // Logged from f/b/services/.../SystemServer.java
4046 PACKAGE_MANAGER_INIT_START = 14;
4047 // Time when package manager is ready
4048 // Logged from f/b/services/.../SystemServer.java
4049 PACKAGE_MANAGER_INIT_READY = 15;
4050 // Represents the time when user has entered unlock credential for system with user pin.
4051 // Logged from bootstat.
4052 POST_DECRYPT = 16;
4053 // Represents the start of zygote's init.
4054 // Logged from zygote itself.
4055 ZYGOTE_INIT_START = 17;
4056 // Represents the start of secondary zygote's init.
4057 // TODO: add logging to zygote
4058 SECONDARY_ZYGOTE_INIT_START = 18;
4059 // Represents the start of system server's init.
4060 // Logged from f/b/services/.../SystemServer.java
4061 SYSTEM_SERVER_INIT_START = 19;
4062 // Represents the completion of system server's init.
4063 // Logged from f/b/services/.../SystemServer.java
4064 SYSTEM_SERVER_READY = 20;
4065 // Represents the start of launcher during boot-up.
4066 // TODO: add logging
4067 LAUNCHER_START = 21;
4068 // Represents the completion of launcher's initial rendering. User can use other apps from
4069 // launcher from this point.
4070 // TODO: add logging
4071 LAUNCHER_SHOWN = 22;
4072 }
4073
4074 // Type of the event.
4075 optional ElapsedTimeEvent event = 1;
4076 // Time since bootup for the event.
4077 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4078 optional int64 time_millis = 2;
4079}
4080
4081/**
4082 * Boot time events with UTC time.
4083 *
4084 * Logged from: bootstat and various system server components. Check each enums for details.
4085 */
4086message BootTimeEventUtcTime {
4087 enum UtcTimeEvent {
4088 UNKNOWN = 0;
4089 // Time of the bootstat's marking of 1st boot after the last factory reset.
4090 // Logged from bootstat.
4091 FACTORY_RESET_RESET_TIME = 1;
4092 // The time when bootstat records FACTORY_RESET_* events. This is close to
4093 // BOOT_COMPLETE time for the current bootup.
4094 // Logged from bootstat.
4095 FACTORY_RESET_CURRENT_TIME = 2;
4096 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4097 // Logged from bootstat.
4098 FACTORY_RESET_RECORD_VALUE = 3;
4099 }
4100
4101 // Type of the event.
4102 optional UtcTimeEvent event = 1;
4103 // UTC time for the event.
4104 optional int64 utc_time_secs = 2;
4105}
4106
4107/**
4108 * Boot time events representing specific error code during bootup.
4109 * Meaning of error code can be different per each event type.
4110 *
4111 * Logged from: bootstat and various system server components. Check each enums for details.
4112 */
4113message BootTimeEventErrorCode {
4114 enum ErrorCodeEvent {
4115 UNKNOWN = 0;
4116 // Linux error code for time() call to get the current UTC time.
4117 // Logged from bootstat.
4118 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4119 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4120 // as UMOUNT_STAT_* from init/reboot.cpp.
4121 // Logged from f/b/services/.../BootReceiver.java.
4122 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004123 // Reprepsents fie system mounting error code of /data partition for the current boot.
4124 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004125 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004126 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004127 }
4128
4129 // Type of the event.
4130 optional ErrorCodeEvent event = 1;
4131 // error code defined per each event type.
4132 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4133 // FS_MGR_FS_STAT.
4134 optional int32 error_code = 2;
4135}
4136
Chenjie Yubbcbc602018-02-05 16:51:52 -08004137//////////////////////////////////////////////////////////////////////
4138// Pulled atoms below this line //
4139//////////////////////////////////////////////////////////////////////
4140
4141/**
David Chenc8a43242017-10-17 16:23:28 -07004142 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4143 *
4144 * Pulled from:
4145 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4146 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004147message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004148 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004149
4150 optional int64 rx_bytes = 2;
4151
4152 optional int64 rx_packets = 3;
4153
4154 optional int64 tx_bytes = 4;
4155
4156 optional int64 tx_packets = 5;
4157}
4158
4159/**
4160 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4161 *
4162 * Pulled from:
4163 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4164 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004165message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004166 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004167
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004168 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4169 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004170
4171 optional int64 rx_bytes = 3;
4172
4173 optional int64 rx_packets = 4;
4174
4175 optional int64 tx_bytes = 5;
4176
4177 optional int64 tx_packets = 6;
4178}
4179
4180/**
4181 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4182 *
4183 * Pulled from:
4184 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4185 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004186message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004187 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004188
4189 optional int64 rx_bytes = 2;
4190
4191 optional int64 rx_packets = 3;
4192
4193 optional int64 tx_bytes = 4;
4194
4195 optional int64 tx_packets = 5;
4196}
4197
4198/**
4199 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4200 *
4201 * Pulled from:
4202 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4203 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004204message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004205 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004206
Yao Chenc40a19d2018-03-15 16:48:25 -07004207 // 1 denotes foreground and 0 denotes background. This is called Set in
4208 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004209 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004210
4211 optional int64 rx_bytes = 3;
4212
4213 optional int64 rx_packets = 4;
4214
4215 optional int64 tx_bytes = 5;
4216
4217 optional int64 tx_packets = 6;
4218}
4219
4220/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004221 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4222 *
4223 * Pulled from:
4224 * StatsCompanionService
4225 */
4226message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004227 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004228
4229 optional int64 rx_bytes = 2;
4230
4231 optional int64 tx_bytes = 3;
4232}
4233
4234/**
David Chenc8a43242017-10-17 16:23:28 -07004235 * Pulls the kernel wakelock durations. This atom is adapted from
4236 * android/internal/os/KernelWakelockStats.java
4237 *
4238 * Pulled from:
4239 * StatsCompanionService using KernelWakelockReader.
4240 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004241message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004242 optional string name = 1;
4243
4244 optional int32 count = 2;
4245
4246 optional int32 version = 3;
4247
Yangster-maca8a30442018-10-13 23:46:34 -07004248 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004249}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004250
Chenjie Yu05013b32017-11-21 10:21:41 -08004251/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004252 * Pulls low power state information. If power.stats HAL is not available, this
4253 * includes platform and subsystem sleep state information,
4254 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4255 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004256 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004257 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004258 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4259 * as defined in:
4260 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004261 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004262message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004263 // Subsystem name
4264 optional string subsystem_name = 1;
4265 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4266 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004267 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4268 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004269 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004270 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004271 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004272 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004273 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004274}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004275
Chenjie Yu05013b32017-11-21 10:21:41 -08004276/**
Bookatz92da2832018-11-01 18:10:03 -07004277 * Pulls on-device power measurement information.
4278 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4279 * Pulled from:
4280 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4281 */
4282message OnDevicePowerMeasurement {
4283 // Name of the subsystem (to which the rail belongs).
4284 optional string subsystem_name = 1;
4285
4286 // Rail name. The rail lies within the subsystem.
4287 optional string rail_name = 2;
4288
4289 // Time (in ms since boot) at which the rail energy value was measured.
4290 // This may differ slightly from the time that statsd logs this information.
4291 optional uint64 measurement_timestamp_millis = 3;
4292
4293 // Accumulated energy used via the rail since device boot in uWs.
4294 optional uint64 energy_microwatt_secs = 4;
4295}
4296
4297/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004298 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004299 * Pulls the time the cpu spend on the frequency index. Frequency index
4300 * starts from highest to lowest. The value should be monotonically
4301 * increasing since boot. However, if there is a cpu
4302 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004303 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004304message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004305 optional uint32 cluster = 1;
4306 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004307 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004308}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004309
Chenjie Yu05013b32017-11-21 10:21:41 -08004310/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004311 * Pulls Cpu Time Per Uid.
4312 * Note that isolated process uid time should be attributed to host uids.
4313 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004314message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004315 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004316 optional uint64 user_time_micros = 2;
4317 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004318}
4319
4320/**
4321 * Pulls Cpu Time Per Uid per frequency.
4322 * Note that isolated process uid time should be attributed to host uids.
4323 * For each uid, we order the time by descending frequencies.
4324 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004325message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004326 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004327 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004328 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004329}
Hugo Benichi884970e2017-11-14 22:42:46 +09004330
Chenjie Yu05013b32017-11-21 10:21:41 -08004331/**
4332 * Pulls Wifi Controller Activity Energy Info
4333 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004334message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004335 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004336 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004337 // stack reported state
4338 // TODO: replace this with proto enum
4339 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004340 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004341 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004342 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004343 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004344 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004345 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004346 // product of current(mA), voltage(V) and time(ms)
4347 optional uint64 controller_energy_used = 6;
4348}
4349
4350/**
4351 * Pulls Modem Activity Energy Info
4352 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004353message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004354 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004355 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004356 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004357 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004358 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004359 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004360 /**
4361 * Tx power index
4362 * index 0 = tx_power < 0dBm
4363 * index 1 = 0dBm < tx_power < 5dBm
4364 * index 2 = 5dBm < tx_power < 15dBm
4365 * index 3 = 15dBm < tx_power < 20dBm
4366 * index 4 = tx_power > 20dBm
4367 */
4368 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004369 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004370 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004371 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004372 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004373 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004374 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004375 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004376 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004377 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004378 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004379 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004380 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004381 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004382}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004383
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004384/**
4385 * Pulls Bluetooth Activity Energy Info
4386 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4387 */
4388message BluetoothActivityInfo {
4389 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004390 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004391 // bluetooth stack state
4392 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004393 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004394 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004395 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004396 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004397 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004398 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004399 // product of current(mA), voltage(V) and time(ms)
4400 optional uint64 energy_used = 6;
4401}
4402
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004403/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004404 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004405 *
4406 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004407 */
4408message ProcessMemoryState {
4409 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004410 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004411
4412 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004413 // Usually package name, "system" for system server.
4414 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004415 optional string process_name = 2;
4416
Rafal Slawikda51b932018-12-13 16:31:33 +00004417 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004418 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004419
4420 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004421 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004422
4423 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004424 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004425
Rajeev Kumar90235992018-01-29 11:06:48 -08004426 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004427 // Value is read from memory.stat, field total_rss if per-app memory
4428 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004429 optional int64 rss_in_bytes = 6;
4430
4431 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004432 // Value is read from memory.stat, field total_cache if per-app memory
4433 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004434 optional int64 cache_in_bytes = 7;
4435
4436 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004437 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004438 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004439 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004440
Rafal Slawik203c3db2019-09-25 19:53:01 +01004441 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004442 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004443
Rafal Slawik203c3db2019-09-25 19:53:01 +01004444 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4445 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004446
Rafal Slawik203c3db2019-09-25 19:53:01 +01004447 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4448 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004449}
4450
4451/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004452 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004453 *
4454 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4455 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004456 *
4457 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004458 */
4459message ProcessMemoryHighWaterMark {
4460 // The uid if available. -1 means not available.
4461 optional int32 uid = 1 [(is_uid) = true];
4462
Rafal Slawikda51b932018-12-13 16:31:33 +00004463 // The process name.
4464 // Usually package name or process cmdline.
4465 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004466 optional string process_name = 2;
4467
Rafal Slawik239b6802019-09-09 18:46:01 +01004468 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4469 // computed by converting kilobytes to bytes.
4470 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4471
Rafal Slawik3bea8952018-11-15 12:39:33 +00004472 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4473 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004474 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004475}
4476
4477/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004478 * Logs the memory stats for a process.
4479 *
4480 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4481 * and for selected native processes.
4482 */
4483message ProcessMemorySnapshot {
4484 // The uid if available. -1 means not available.
4485 optional int32 uid = 1 [(is_uid) = true];
4486
4487 // The process name.
4488 // Usually package name or process cmdline.
4489 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4490 optional string process_name = 2;
4491
4492 // The pid of the process.
4493 // Allows to disambiguate instances of the process.
4494 optional int32 pid = 3;
4495
4496 // The current OOM score adjustment value.
4497 // Read from ProcessRecord for managed processes.
4498 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4499 optional int32 oom_score_adj = 4;
4500
4501 // The current RSS of the process.
4502 // VmRSS from /proc/pid/status.
4503 optional int32 rss_in_kilobytes = 5;
4504
4505 // The current anon RSS of the process.
4506 // RssAnon from /proc/pid/status.
4507 optional int32 anon_rss_in_kilobytes = 6;
4508
4509 // The current swap size of the process.
4510 // VmSwap from /proc/pid/status.
4511 optional int32 swap_in_kilobytes = 7;
4512
4513 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4514 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4515}
4516
4517/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004518 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004519 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004520message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004521 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004522}
4523
4524/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004525 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004526 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004527message SystemUptime {
4528 // Milliseconds since the system was booted.
4529 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4530 // for external input).
4531 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004532 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004533}
4534
4535/*
4536 * Reads from /proc/uid_concurrent_active_time which has the format:
4537 * active: X (X is # cores)
4538 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4539 * [uid1]: [time-0] [time-1] [time-2] ... ...
4540 * ...
4541 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4542 * The file contains a monotonically increasing count of time for a single boot.
4543 */
4544message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004545 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004546 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004547}
4548
4549/**
4550 * Reads from /proc/uid_concurrent_policy_time which has the format:
4551 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4552 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4553 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4554 * ...
4555 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4556 * The file contains a monotonically increasing count of time for a single boot.
4557 */
4558message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004559 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004560 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004561 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004562}
4563
4564/*
4565 * Pulls free disk space, for data, system partition and temporary directory.
4566 */
4567message DiskSpace {
4568 // available bytes in data partition
4569 optional uint64 data_available_bytes = 1;
4570 // available bytes in system partition
4571 optional uint64 system_available_bytes = 2;
4572 // available bytes in download cache or temp directories
4573 optional uint64 temp_available_bytes = 3;
4574}
Tej Singhbf972d92018-01-10 20:51:13 -08004575
4576/**
4577 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004578 *
4579 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004580 */
4581message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004582 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004583}
4584
4585/**
4586 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004587 * Pulled from:
4588 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004589 */
4590message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004591 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004592}
4593
4594/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004595 * Pulls battery voltage.
4596 * Pulled from:
4597 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4598 */
4599message BatteryVoltage {
4600 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004601 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004602}
4603
4604/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004605 * Pulls battery level (percent full, from 0 to 100).
4606 *
4607 * Pulled from:
4608 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4609 */
4610message BatteryLevel {
4611 // Battery level. Should be in [0, 100].
4612 optional int32 battery_level = 1;
4613}
4614
4615/**
Tej Singhd89137e2018-03-26 14:51:40 -07004616 * Pulls the temperature of various parts of the device.
4617 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004618 *
Maggie White442b6312019-04-05 16:26:44 -07004619 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004620 */
4621message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004622 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004623 optional android.os.TemperatureTypeEnum sensor_location = 1;
4624
4625 // The name of the temperature source. Eg. CPU0
4626 optional string sensor_name = 2;
4627
Tej Singhd89137e2018-03-26 14:51:40 -07004628 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004629 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004630 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004631
4632 // Relative severity of the throttling, see enum definition.
4633 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004634}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004635
4636/**
4637 * Pulls the statistics of calls to Binder.
4638 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004639 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4640 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004641 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004642 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004643 */
4644message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004645 // UID of the process responsible for the binder transaction. It will be set if the process
4646 // executing the binder transaction attribute the transaction to another uid using
4647 // Binder.setThreadWorkSource().
4648 //
4649 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004650 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004651 // UID of the process executing the binder transaction.
4652 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004653 // Fully qualified class name of the API call.
4654 //
4655 // This is a system server class name.
4656 //
4657 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4658 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4659 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4660 // commonly used APIs.
4661 optional string service_class_name = 2;
4662 // Method name of the API call. It can also be a transaction code if we cannot
4663 // resolve it to a name. See Binder#getTransactionName.
4664 //
4665 // This is a system server method name.
4666 optional string service_method_name = 3;
4667 // Total number of API calls.
4668 optional int64 call_count = 4;
4669 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4670 optional bool screen_interactive = 13;
4671 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4672 // call_count will be equal to recorded_call_count.
4673 //
4674 // If recorded_call_count is different than call_count, it means data collection has been
4675 // sampled. All the fields below will be sampled in this case.
4676 optional int64 recorded_call_count = 12;
4677 // Number of exceptions thrown by the API.
4678 optional int64 recorded_exception_count = 5;
4679 // Total latency of all API calls.
4680 // Average can be computed using total_latency_micros / recorded_call_count.
4681 optional int64 recorded_total_latency_micros = 6;
4682 // Maximum latency of one API call.
4683 optional int64 recorded_max_latency_micros = 7;
4684 // Total CPU usage of all API calls.
4685 // Average can be computed using total_cpu_micros / recorded_call_count.
4686 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4687 optional int64 recorded_total_cpu_micros = 8;
4688 // Maximum CPU usage of one API call.
4689 optional int64 recorded_max_cpu_micros = 9;
4690 // Maximum parcel reply size of one API call.
4691 optional int64 recorded_max_reply_size_bytes = 10;
4692 // Maximum parcel request size of one API call.
4693 optional int64 recorded_max_request_size_bytes = 11;
4694}
4695
4696/**
4697 * Pulls the statistics of exceptions during calls to Binder.
4698 *
4699 * Binder stats are cumulative from boot unless somebody reset the data using
4700 * > adb shell dumpsys binder_calls_stats --reset
4701 */
4702message BinderCallsExceptions {
4703 // Exception class name, e.g. java.lang.IllegalArgumentException.
4704 //
4705 // This is an exception class name thrown by the system server.
4706 optional string exception_class_name = 1;
4707 // Total number of exceptions.
4708 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004709}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004710
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004711/**
4712 * Pulls the statistics of message dispatching on HandlerThreads.
4713 *
4714 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4715 * config on the device.
4716 *
4717 * Next tag: 11
4718 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004719message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004720 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004721 optional int32 uid = 1 [(is_uid) = true];
4722
4723 // Fully qualified class name of the handler target class.
4724 //
4725 // This field does not contain PII. This is a system server class name.
4726 optional string handler_class_name = 2;
4727
4728 // The name of the thread that runs the Looper.
4729 //
4730 // This field does not contain PII. This is a system server thread name.
4731 optional string looper_thread_name = 3;
4732
4733 // The name of the dispatched message.
4734 //
4735 // This field does not contain PII. This is a system server constant or class
4736 // name.
4737 optional string message_name = 4;
4738
4739 // Total number of successfully dispatched messages.
4740 optional int64 message_count = 5;
4741
4742 // Total number of messages that failed dispatching.
4743 optional int64 exception_count = 6;
4744
4745 // Total number of processed messages we have data recorded for. If we
4746 // collected data for all the messages, message_count will be equal to
4747 // recorded_message_count.
4748 //
4749 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004750 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004751 optional int64 recorded_message_count = 7;
4752
4753 // Total latency of all processed messages.
4754 // Average can be computed using recorded_total_latency_micros /
4755 // recorded_message_count.
4756 optional int64 recorded_total_latency_micros = 8;
4757
4758 // Total CPU usage of all processed message.
4759 // Average can be computed using recorded_total_cpu_micros /
4760 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004761 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004762 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004763
4764 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4765 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004766
4767 // Max recorded CPU usage of all processed messages.
4768 optional int64 recorded_max_cpu_micros = 11;
4769
4770 // Max recorded latency of all processed messages.
4771 optional int64 recorded_max_latency_micros = 12;
4772
4773 // Total number of messages we tracked the dispatching delay for. If we
4774 // collected data for all the messages, message_count will be equal to
4775 // recorded_delay_message_count.
4776 //
4777 // If recorded_delay_message_count is different than message_count, it means data
4778 // collection has been sampled or/and not all messages specified the target dispatch time.
4779 // The fields below will be sampled in this case.
4780 optional int64 recorded_delay_message_count = 13;
4781
4782 // Total dispatching delay of all processed messages.
4783 // Calculated as a difference between the target dispatching time (Message.when)
4784 // and the actual dispatching time.
4785 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4786 optional int64 recorded_total_delay_millis = 14;
4787
4788 // Max dispatching delay of all processed messages.
4789 // Calculated as a difference between the target dispatching time (Message.when)
4790 // and the actual dispatching time.
4791 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004792}
Tej Singh86dc9db2018-09-06 00:39:57 +00004793
4794/**
4795 * Pulls disk information, such as write speed and latency.
4796 */
4797message DiskStats {
4798 // Time taken to open, write 512B to, and close a file.
4799 // -1 if error performing the check.
4800 optional int64 data_write_latency_millis = 1;
4801
4802 optional bool file_based_encryption = 2;
4803
4804 // Recent disk write speed in kB/s.
4805 // -1 if error querying storageed.
4806 // 0 if data is unavailable.
4807 optional int32 recent_disk_write_speed = 3;
4808}
4809
4810
4811/**
4812 * Free and total bytes of the Data, Cache, and System partition.
4813 */
4814message DirectoryUsage {
4815 enum Directory {
4816 UNKNOWN = 0;
4817 DATA = 1;
4818 CACHE = 2;
4819 SYSTEM = 3;
4820 }
4821 optional Directory directory = 1;
4822 optional int64 free_bytes = 2;
4823 optional int64 total_bytes = 3;
4824}
4825
4826
4827/**
4828 * Size of an application: apk size, data size, and cache size.
4829 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4830 * Information is only reported for apps with the primary user (user 0).
4831 * Sizes are aggregated by package name.
4832 */
4833message AppSize {
4834 // Including uids will involve modifying diskstats logic.
4835 optional string package_name = 1;
4836 // App size in bytes. -1 if unavailable.
4837 optional int64 app_size_bytes = 2;
4838 // App data size in bytes. -1 if unavailable.
4839 optional int64 app_data_size_bytes = 3;
4840 // App cache size in bytes. -1 if unavailable.
4841 optional int64 app_cache_size_bytes = 4;
4842 // Time that the cache file was produced.
4843 // Uses System.currentTimeMillis(), which is wall clock time.
4844 optional int64 cache_time_millis = 5;
4845}
4846
4847
4848/**
4849 * Size of a particular category. Eg: photos, videos.
4850 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4851 */
4852message CategorySize {
4853 enum Category {
4854 UNKNOWN = 0;
4855 APP_SIZE = 1;
4856 APP_DATA_SIZE = 2;
4857 APP_CACHE_SIZE = 3;
4858 PHOTOS = 4;
4859 VIDEOS = 5;
4860 AUDIO = 6;
4861 DOWNLOADS = 7;
4862 SYSTEM = 8;
4863 OTHER = 9;
4864 }
4865 optional Category category = 1;
4866 // Category size in bytes.
4867 optional int64 size_bytes = 2;
4868 // Time that the cache file was produced.
4869 // Uses System.currentTimeMillis(), which is wall clock time.
4870 optional int64 cache_time_millis = 3;
4871}
Tej Singhd6d6d772018-09-05 17:41:25 -07004872
4873/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004874 * Pulls per uid I/O stats. The stats are cumulative since boot.
4875 *
4876 * Read/write bytes are I/O events from a storage device
4877 * Read/write chars are data requested by read/write syscalls, and can be
4878 * satisfied by caching.
4879 *
4880 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4881 */
4882message DiskIo {
4883 optional int32 uid = 1 [(is_uid) = true];
4884 optional int64 fg_chars_read = 2;
4885 optional int64 fg_chars_write = 3;
4886 optional int64 fg_bytes_read = 4;
4887 optional int64 fg_bytes_write = 5;
4888 optional int64 bg_chars_read = 6;
4889 optional int64 bg_chars_write = 7;
4890 optional int64 bg_bytes_read = 8;
4891 optional int64 bg_bytes_write = 9;
4892 optional int64 fg_fsync = 10;
4893 optional int64 bg_fsync= 11;
4894}
4895
4896
4897/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004898 * Pulls the number of fingerprints for each user.
4899 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004900 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004901 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004902message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004903 // The associated user. Eg: 0 for owners, 10+ for others.
4904 // Defined in android/os/UserHandle.java
4905 optional int32 user = 1;
4906 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004907 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004908}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004909
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004910/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004911 * Pulls the number of faces for each user.
4912 *
4913 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4914 */
4915message NumFacesEnrolled {
4916 // The associated user. Eg: 0 for owners, 10+ for others.
4917 // Defined in android/os/UserHandle.java
4918 optional int32 user = 1;
4919 // Number of faces registered to that user.
4920 optional int32 num_faces_enrolled = 2;
4921}
4922/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004923 * A mapping of role holder -> role
4924 */
4925message RoleHolder {
4926 // uid of the role holder
4927 optional int32 uid = 1 [(is_uid) = true];
4928
4929 // package name of the role holder
4930 optional string package_name = 2;
4931
4932 // the role held
4933 optional string role = 3;
4934}
4935
Yangsteraf9aee72018-10-12 09:26:16 -07004936message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004937 // These are all in byte resolution.
4938 optional int64 min = 1 [deprecated = true];
4939 optional int64 average = 2 [deprecated = true];
4940 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07004941
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004942 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
4943 // int64 fields.
4944 optional int32 mean_kb = 4;
4945 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07004946}
4947
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004948// A reduced subset of process states; reducing the number of possible states allows more
4949// aggressive device-side aggregation of statistics and hence reduces metric upload size.
4950enum ProcessStateAggregated {
4951 PROCESS_STATE_UNKNOWN = 0;
4952 // Persistent system process.
4953 PROCESS_STATE_PERSISTENT = 1;
4954 // Top activity; actually any visible activity.
4955 PROCESS_STATE_TOP = 2;
4956 // Process binding to top or a foreground service.
4957 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
4958 // Processing running a foreground service.
4959 PROCESS_STATE_FGS = 4;
4960 // Important foreground process (ime, wallpaper, etc).
4961 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
4962 // Important background process.
4963 PROCESS_STATE_BACKGROUND = 6;
4964 // Process running a receiver.
4965 PROCESS_STATE_RECEIVER = 7;
4966 // All kinds of cached processes.
4967 PROCESS_STATE_CACHED = 8;
4968}
4969
4970// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07004971message ProcessStatsStateProto {
4972 optional android.service.procstats.ScreenState screen_state = 1;
4973
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004974 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07004975
4976 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4977 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004978 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
4979
4980 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07004981
4982 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004983 optional int64 duration_millis = 4 [deprecated = true];
4984 // Same as above, but with minute resolution so it fits into an int32.
4985 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07004986
4987 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004988 optional int64 realtime_duration_millis = 9 [deprecated = true];
4989 // Same as above, but with minute resolution so it fits into an int32.
4990 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07004991
4992 // # of samples taken
4993 optional int32 sample_size = 5;
4994
4995 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004996 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07004997
4998 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00004999 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005000
5001 // RSS is memory resident for this process
5002 optional AggStats rss = 8;
5003}
5004
5005// Next Tag: 7
5006message ProcessStatsProto {
5007 // Name of process.
5008 optional string process = 1;
5009
5010 // Uid of the process.
5011 optional int32 uid = 2;
5012
5013 // Information about how often kills occurred
5014 message Kill {
5015 // Count of excessive CPU kills
5016 optional int32 cpu = 1;
5017
5018 // Count of kills when cached
5019 optional int32 cached = 2;
5020
5021 // PSS stats during cached kill
5022 optional AggStats cached_pss = 3;
5023 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005024 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005025
5026 // Time and memory spent in various states.
5027 repeated ProcessStatsStateProto states = 5;
5028
5029 // Total time process has been running... screen_state, memory_state, and process_state
5030 // will not be set.
5031 optional ProcessStatsStateProto total_running_state = 6;
5032}
5033
5034message PackageServiceOperationStatsProto {
5035 // Operate enum: Started, Foreground, Bound, Executing
5036 optional android.service.procstats.ServiceOperationState operation = 1;
5037
5038 // Number of times the service was in this operation.
5039 optional int32 count = 2;
5040
5041 // Information about a state the service can be in.
5042 message StateStats {
5043 // Screen state enum.
5044 optional android.service.procstats.ScreenState screen_state = 1;
5045 // Memory state enum.
5046 optional android.service.procstats.MemoryState memory_state = 2;
5047
5048 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005049 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005050 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005051 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005052 }
5053 repeated StateStats state_stats = 3;
5054}
5055
5056message PackageServiceStatsProto {
5057 // Name of service component.
5058 optional string service_name = 1;
5059
5060 // The operation stats.
5061 // The package_name, package_uid, package_version, service_name will not be set to save space.
5062 repeated PackageServiceOperationStatsProto operation_stats = 2;
5063}
5064
5065message PackageAssociationSourceProcessStatsProto {
5066 // Uid of the process.
5067 optional int32 process_uid = 1;
5068 // Process name.
5069 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005070 // Package name.
5071 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005072 // Total count of the times this association appeared.
5073 optional int32 total_count = 3;
5074
5075 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005076 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005077
5078 // Total count of the times this association became actively impacting its target process.
5079 optional int32 active_count = 5;
5080
5081 // Information on one source in this association.
5082 message StateStats {
5083 // Process state enum.
5084 optional android.service.procstats.ProcessState process_state = 1;
5085 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005086 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005087 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005088 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005089 }
5090 repeated StateStats active_state_stats = 6;
5091}
5092
5093message PackageAssociationProcessStatsProto {
5094 // Name of the target component.
5095 optional string component_name = 1;
5096 // Information on one source in this association.
5097 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5098}
5099
5100
5101message ProcessStatsPackageProto {
5102 // Name of package.
5103 optional string package = 1;
5104
5105 // Uid of the package.
5106 optional int32 uid = 2;
5107
5108 // Version of the package.
5109 optional int64 version = 3;
5110
5111 // Stats for each process running with the package loaded in to it.
5112 repeated ProcessStatsProto process_stats = 4;
5113
5114 // Stats for each of the package's services.
5115 repeated PackageServiceStatsProto service_stats = 5;
5116
5117 // Stats for each association with the package.
5118 repeated PackageAssociationProcessStatsProto association_stats = 6;
5119}
5120
5121message ProcessStatsSectionProto {
5122 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005123 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005124
5125 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005126 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005127
5128 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005129 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005130
5131 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005132 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005133
5134 // System runtime library. e.g. "libdvm.so", "libart.so".
5135 optional string runtime = 5;
5136
5137 // whether kernel reports swapped pss.
5138 optional bool has_swapped_pss = 6;
5139
5140 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5141 enum Status {
5142 STATUS_UNKNOWN = 0;
5143 STATUS_COMPLETE = 1;
5144 STATUS_PARTIAL = 2;
5145 STATUS_SHUTDOWN = 3;
5146 STATUS_SYSPROPS = 4;
5147 }
5148 repeated Status status = 7;
5149
Chenjie Yub2ecc792019-01-17 10:27:26 -08005150 // Number of pages available of various types and sizes, representation fragmentation.
5151 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5152
Yangsteraf9aee72018-10-12 09:26:16 -07005153 // Stats for each process.
5154 repeated ProcessStatsProto process_stats = 8;
5155
5156 // Stats for each package.
5157 repeated ProcessStatsPackageProto package_stats = 9;
5158}
5159
Chenjie Yub2ecc792019-01-17 10:27:26 -08005160message ProcessStatsAvailablePagesProto {
5161 // Node these pages are in (as per /proc/pagetypeinfo)
5162 optional int32 node = 1;
5163
5164 // Zone these pages are in (as per /proc/pagetypeinfo)
5165 optional string zone = 2;
5166
5167 // Label for the type of these pages (as per /proc/pagetypeinfo)
5168 optional string label = 3;
5169
5170 // Distribution of number of pages available by order size. First entry in array is
5171 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5172 repeated int32 pages_per_order = 4;
5173}
5174
Chenjie Yu12e5e672018-09-14 15:54:59 -07005175/**
5176 * Pulled from ProcessStatsService.java
5177 */
5178message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005179 optional ProcessStatsSectionProto proc_stats_section = 1;
5180}
5181
Chenjie Yuf910b7802019-01-11 16:08:20 -08005182/**
5183 * Pulled from ProcessStatsService.java
5184 */
5185message ProcStatsPkgProc {
5186 optional ProcessStatsSectionProto proc_stats_section = 1;
5187}
5188
Chris Wrencdea3b72019-11-22 16:58:17 -05005189// Next Tag: 2
5190message PackageRemoteViewInfoProto {
5191 optional string package_name = 1;
5192 // add per-package additional info here (like channels)
5193}
5194
5195// Next Tag: 2
5196message NotificationRemoteViewsProto {
5197 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5198}
5199
5200/**
5201 * Pulled from NotificationManagerService.java
5202 */
5203message NotificationRemoteViews {
5204 optional NotificationRemoteViewsProto notification_remote_views = 1;
5205}
5206
Yangsteraf9aee72018-10-12 09:26:16 -07005207message PowerProfileProto {
5208 optional double cpu_suspend = 1;
5209
5210 optional double cpu_idle = 2;
5211
5212 optional double cpu_active = 3;
5213
5214 message CpuCluster {
5215 optional int32 id = 1;
5216 optional double cluster_power = 2;
5217 optional int32 cores = 3;
5218 repeated int64 speed = 4;
5219 repeated double core_power = 5;
5220 }
5221
5222 repeated CpuCluster cpu_cluster = 40;
5223
5224 optional double wifi_scan = 4;
5225
5226 optional double wifi_on = 5;
5227
5228 optional double wifi_active = 6;
5229
5230 optional double wifi_controller_idle = 7;
5231
5232 optional double wifi_controller_rx = 8;
5233
5234 optional double wifi_controller_tx = 9;
5235
5236 repeated double wifi_controller_tx_levels = 10;
5237
5238 optional double wifi_controller_operating_voltage = 11;
5239
5240 optional double bluetooth_controller_idle = 12;
5241
5242 optional double bluetooth_controller_rx = 13;
5243
5244 optional double bluetooth_controller_tx = 14;
5245
5246 optional double bluetooth_controller_operating_voltage = 15;
5247
5248 optional double modem_controller_sleep = 16;
5249
5250 optional double modem_controller_idle = 17;
5251
5252 optional double modem_controller_rx = 18;
5253
5254 repeated double modem_controller_tx = 19;
5255
5256 optional double modem_controller_operating_voltage = 20;
5257
5258 optional double gps_on = 21;
5259
5260 repeated double gps_signal_quality_based = 22;
5261
5262 optional double gps_operating_voltage = 23;
5263
5264 optional double bluetooth_on = 24;
5265
5266 optional double bluetooth_active = 25;
5267
5268 optional double bluetooth_at_cmd = 26;
5269
5270 optional double ambient_display = 27;
5271
5272 optional double screen_on = 28;
5273
5274 optional double radio_on = 29;
5275
5276 optional double radio_scanning = 30;
5277
5278 optional double radio_active = 31;
5279
5280 optional double screen_full = 32;
5281
5282 optional double audio = 33;
5283
5284 optional double video = 34;
5285
5286 optional double flashlight = 35;
5287
5288 optional double memory = 36;
5289
5290 optional double camera = 37;
5291
5292 optional double wifi_batched_scan = 38;
5293
5294 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005295}
Chenjie Yuab530202018-09-26 12:39:20 -07005296
5297/**
5298 * power_profile.xml and other constants for power model calculations.
5299 * Pulled from PowerProfile.java
5300 */
5301message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005302 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005303}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005304
5305/**
arangelovd5db50e2018-10-12 20:24:39 +01005306 * Logs when a user restriction was added or removed.
5307 *
5308 * Logged from:
5309 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5310 */
5311message UserRestrictionChanged {
5312 // The raw string of the user restriction as defined in UserManager.
5313 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5314 optional string restriction = 1;
5315 // Whether the restriction is enabled or disabled.
5316 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005317}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005318
5319/**
5320 * Pulls process user time and system time. Puller takes a snapshot of all pids
5321 * in the system and returns cpu stats for those that are working at the time.
5322 * Dead pids will be dropped. Kernel processes are excluded.
5323 * Min cool-down is 5 sec.
5324 */
5325message ProcessCpuTime {
5326 optional int32 uid = 1 [(is_uid) = true];
5327
5328 optional string process_name = 2;
5329 // Process cpu time in user space, cumulative from boot/process start
5330 optional int64 user_time_millis = 3;
5331 // Process cpu time in system space, cumulative from boot/process start
5332 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005333}
Misha Wagner5a51e002018-10-03 15:04:09 +01005334
5335/**
5336 * Pulls the CPU usage for each thread.
5337 *
5338 * Read from /proc/$PID/task/$TID/time_in_state files.
5339 *
5340 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5341 * time_in_state files not being present on some phones, have not been addressed. These should be
5342 * considered before a public release.
5343 */
5344message CpuTimePerThreadFreq {
5345 // UID that owns the process.
5346 optional int32 uid = 1 [(is_uid) = true];
5347 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005348 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005349 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005350 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005351 // Name of the process taken from `/proc/$PID/cmdline`.
5352 optional string process_name = 4;
5353 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5354 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005355
5356 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5357 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5358 // frequencies are given here as the alternative is sending eight separate atoms. This method
5359 // significantly reduces the amount of data created
5360 optional int32 frequency1_khz = 6;
5361 optional int32 time1_millis = 7;
5362 optional int32 frequency2_khz = 8;
5363 optional int32 time2_millis = 9;
5364 optional int32 frequency3_khz = 10;
5365 optional int32 time3_millis = 11;
5366 optional int32 frequency4_khz = 12;
5367 optional int32 time4_millis = 13;
5368 optional int32 frequency5_khz = 14;
5369 optional int32 time5_millis = 15;
5370 optional int32 frequency6_khz = 16;
5371 optional int32 time6_millis = 17;
5372 optional int32 frequency7_khz = 18;
5373 optional int32 time7_millis = 19;
5374 optional int32 frequency8_khz = 20;
5375 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005376}
Bookatz75ee60422018-11-09 12:27:37 -08005377
5378/**
Bookatz366a4432018-11-20 09:42:33 -08005379 * Pulls information about the device's build.
5380 */
5381message BuildInformation {
5382 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5383 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5384 optional string fingerprint = 1;
5385
5386 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5387 optional string brand = 2;
5388
5389 // Build.PRODUCT. The name of the overall product.
5390 optional string product = 3;
5391
5392 // Build.DEVICE. The name of the industrial design.
5393 optional string device = 4;
5394
5395 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5396 optional string version_release = 5;
5397
5398 // Build.ID. E.g. a label like "M4-rc20".
5399 optional string id = 6;
5400
5401 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5402 // represent this build.
5403 optional string version_incremental = 7;
5404
5405 // Build.TYPE. The type of build, like "user" or "eng".
5406 optional string type = 8;
5407
5408 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5409 optional string tags = 9;
5410}
5411
5412/**
Adam He420947c2019-01-23 15:59:09 -08005413 * Logs information about mismatched caller for content capture.
5414 *
5415 * Logged from:
5416 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5417 */
5418message ContentCaptureCallerMismatchReported {
5419 optional string intended_package = 1;
5420 optional string calling_package = 2;
5421}
5422
5423/**
5424 * Logs information about content capture service events.
5425 *
5426 * Logged from:
5427 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5428 */
5429message ContentCaptureServiceEvents {
5430 // The type of event.
5431 enum Event {
5432 UNKNOWN = 0;
5433 ON_CONNECTED = 1;
5434 ON_DISCONNECTED = 2;
5435 SET_WHITELIST = 3;
5436 SET_DISABLED = 4;
5437 ON_USER_DATA_REMOVED = 5;
5438 }
5439 optional Event event = 1;
5440 // component/package of content capture service.
5441 optional string service_info = 2;
5442 // component/package of target.
5443 // it's a concatenated list of component/package for SET_WHITELIST event
5444 // separated by " ".
5445 optional string target_info = 3;
5446}
5447
5448/**
5449 * Logs information about content capture session events.
5450 *
5451 * Logged from:
5452 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5453 */
5454message ContentCaptureSessionEvents {
5455 // The type of event.
5456 enum Event {
5457 UNKNOWN = 0;
5458 ON_SESSION_STARTED = 1;
5459 ON_SESSION_FINISHED = 2;
5460 SESSION_NOT_CREATED = 3;
5461 }
5462 optional int32 session_id = 1;
5463 optional Event event = 2;
5464 // (n/a on session finished)
5465 optional int32 state_flags = 3;
5466 // component/package of content capture service.
5467 optional string service_info = 4;
5468 // component/package of app.
5469 // (n/a on session finished)
5470 optional string app_info = 5;
5471 optional bool is_child_session = 6;
5472}
5473
5474/**
5475 * Logs information about session being flushed.
5476 *
5477 * Logged from:
5478 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5479 */
5480message ContentCaptureFlushed {
5481 optional int32 session_id = 1;
5482 // component/package of content capture service.
5483 optional string service_info = 2;
5484 // component/package of app.
5485 optional string app_info = 3;
5486 // session start/finish events
5487 optional int32 child_session_started = 4;
5488 optional int32 child_session_finished = 5;
5489 // count of view events.
5490 optional int32 view_appeared_count = 6;
5491 optional int32 view_disappeared_count = 7;
5492 optional int32 view_text_changed_count = 8;
5493
5494 // Flush stats.
5495 optional int32 max_events = 9;
5496 optional int32 idle_flush_freq = 10;
5497 optional int32 text_flush_freq = 11;
5498 optional int32 flush_reason = 12;
5499}
5500
5501/**
Bookatz75ee60422018-11-09 12:27:37 -08005502 * Pulls on-device BatteryStats power use calculations for the overall device.
5503 */
5504message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005505 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5506 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5507 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5508 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005509}
5510
5511/**
5512 * Pulls on-device BatteryStats power use calculations broken down by uid.
5513 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5514 * that is attributed to non-uid items. They must all be included to get the total power use.
5515 */
5516message DeviceCalculatedPowerBlameUid {
5517 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5518 optional int32 uid = 1 [(is_uid) = true];
5519
Bookatz3dbc13a2018-12-21 12:16:51 -08005520 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5521 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5522 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005523}
5524
5525/**
5526 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5527 * drain type.
5528 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5529 * is attributed uids. They must all be included to get the total power use.
5530 */
5531message DeviceCalculatedPowerBlameOther {
5532 // The type of item whose power use is being reported.
5533 enum DrainType {
5534 AMBIENT_DISPLAY = 0;
5535 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5536 BLUETOOTH = 2;
5537 CAMERA = 3;
5538 // Cell-standby
5539 CELL = 4;
5540 FLASHLIGHT = 5;
5541 IDLE = 6;
5542 MEMORY = 7;
5543 // Amount that total computed drain exceeded the drain estimated using the
5544 // battery level changes and capacity.
5545 OVERCOUNTED = 8;
5546 PHONE = 9;
5547 SCREEN = 10;
5548 // Amount that total computed drain was below the drain estimated using the
5549 // battery level changes and capacity.
5550 UNACCOUNTED = 11;
5551 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5552 WIFI = 13;
5553 }
5554 optional DrainType drain_type = 1;
5555
Bookatz3dbc13a2018-12-21 12:16:51 -08005556 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5557 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5558 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005559}
arangelov4e994062018-11-13 16:12:38 +00005560
5561/**
5562 * Logs device policy features.
5563 *
5564 * Logged from:
5565 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5566 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5567 */
5568message DevicePolicyEvent {
5569 // The event id - unique for each event.
5570 optional android.stats.devicepolicy.EventId event_id = 1;
5571 // The admin package name.
5572 optional string admin_package_name = 2;
5573 // A generic integer parameter.
5574 optional int32 integer_value = 3;
5575 // A generic boolean parameter.
5576 optional bool boolean_value = 4;
5577 // A parameter specifying a time period in milliseconds.
5578 optional uint64 time_period_millis = 5;
5579 // A parameter specifying a list of package names, bundle extras or string parameters.
5580 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5581}
shawnlinea5b66b2018-11-13 15:05:29 +08005582
5583/**
5584 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5585 *
5586 * Logged from:
5587 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5588 */
5589message DocsUILaunchReported {
5590 optional android.stats.docsui.LaunchAction launch_action = 1;
5591 optional bool has_initial_uri = 2;
5592 optional android.stats.docsui.MimeType mime_type = 3;
5593 optional android.stats.docsui.Root initial_root = 4;
5594}
5595
5596/**
5597 * Logs root/app visited event in file managers/picker. Call this when the user
5598 * taps on root/app in hamburger menu.
5599 *
5600 * Logged from:
5601 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5602 */
5603message DocsUIRootVisitedReported {
5604 optional android.stats.docsui.ContextScope scope = 1;
5605 optional android.stats.docsui.Root root = 2;
5606}
5607
5608/**
5609 * Logs file operation stats. Call this when a file operation has completed.
5610 *
5611 * Logged from:
5612 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5613 */
5614message DocsUIFileOperationReported {
5615 optional android.stats.docsui.Provider provider = 1;
5616 optional android.stats.docsui.FileOperation file_op = 2;
5617}
5618
5619/**
5620 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5621 * mode.
5622 *
5623 * Logged from:
5624 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5625 */
5626message DocsUIFileOperationCopyMoveModeReported {
5627 optional android.stats.docsui.FileOperation file_op = 1;
5628 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5629}
5630
5631
5632/**
5633 * Logs file sub operation stats. Call this when a file operation has failed.
5634 *
5635 * Logged from:
5636 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5637 */
5638message DocsUIFileOperationFailureReported {
5639 optional android.stats.docsui.Authority authority = 1;
5640 optional android.stats.docsui.SubFileOperation sub_op = 2;
5641}
5642
5643/**
5644* Logs the cancellation of a file operation. Call this when a job is canceled
5645*
5646* Logged from:
5647* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5648*/
5649message DocsUIFileOperationCanceledReported {
5650 optional android.stats.docsui.FileOperation file_op = 1;
5651}
5652
5653/**
5654 * Logs startup time in milliseconds.
5655 *
5656 * Logged from:
5657 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5658 */
5659message DocsUIStartupMsReported {
5660 optional int32 startup_millis = 1;
5661}
5662
5663/**
5664 * Logs the action that was started by user.
5665 *
5666 * Logged from:
5667 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5668 */
5669message DocsUIUserActionReported {
5670 optional android.stats.docsui.UserAction action = 1;
5671}
5672
5673/**
5674 * Logs the invalid type when invalid scoped access is requested.
5675 *
5676 * Logged from:
5677 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5678 */
5679message DocsUIInvalidScopedAccessRequestReported {
5680 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005681}
Ben Murdochbab399f62018-12-06 11:01:38 +00005682
5683/**
shawnlina75e82d2019-01-07 10:31:12 +08005684 * Logs the package name that launches docsui picker mode.
5685 *
5686 * Logged from:
5687 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5688 */
5689message DocsUIPickerLaunchedFromReported {
5690 optional string package_name = 1;
5691}
5692
5693/**
5694 * Logs the search type.
5695 *
5696 * Logged from:
5697 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5698 */
5699message DocsUISearchTypeReported {
5700 optional android.stats.docsui.SearchType search_type = 1;
5701}
5702
5703/**
5704 * Logs the search mode.
5705 *
5706 * Logged from:
5707 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5708 */
5709message DocsUISearchModeReported {
5710 optional android.stats.docsui.SearchMode search_mode = 1;
5711}
5712
5713/**
5714 * Logs the pick result information.
5715 *
5716 * Logged from:
5717 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5718 */
5719message DocsUIPickResultReported {
5720 optional int32 total_action_count = 1;
5721 optional int64 duration_millis = 2;
5722 optional int32 file_count= 3;
5723 optional bool is_searching = 4;
5724 optional android.stats.docsui.Root picked_from = 5;
5725 optional android.stats.docsui.MimeType mime_type = 6;
5726 optional int32 repeatedly_pick_times = 7;
5727}
5728
5729/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005730 * Logs when an app's memory is compacted.
5731 *
5732 * Logged from:
5733 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5734 */
5735message AppCompacted {
5736 // The pid of the process being compacted.
5737 optional int32 pid = 1;
5738
5739 // The name of the process being compacted.
5740 optional string process_name = 2;
5741
5742 // The type of compaction.
5743 enum Action {
5744 UNKNOWN = 0;
5745 SOME = 1;
5746 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005747 PERSISTENT = 3;
5748 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005749 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005750 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005751
5752 // Total RSS in kilobytes consumed by the process prior to compaction.
5753 optional int64 before_rss_total_kilobytes = 4;
5754
5755 // File RSS in kilobytes consumed by the process prior to compaction.
5756 optional int64 before_rss_file_kilobytes = 5;
5757
5758 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5759 optional int64 before_rss_anon_kilobytes = 6;
5760
5761 // Swap in kilobytes consumed by the process prior to compaction.
5762 optional int64 before_swap_kilobytes = 7;
5763
5764 // Total RSS in kilobytes consumed by the process after compaction.
5765 optional int64 after_rss_total_kilobytes = 8;
5766
5767 // File RSS in kilobytes consumed by the process after compaction.
5768 optional int64 after_rss_file_kilobytes = 9;
5769
5770 // Anonymous RSS in kilobytes consumed by the process after compaction.
5771 optional int64 after_rss_anon_kilobytes = 10;
5772
5773 // Swap in kilobytes consumed by the process after compaction.
5774 optional int64 after_swap_kilobytes = 11;
5775
5776 // The time taken to perform compaction in milliseconds.
5777 optional int64 time_to_compact_millis = 12;
5778
5779 // The last compaction action performed for this app.
5780 optional Action last_action = 13;
5781
Ben Murdoch01720b82018-12-19 18:03:44 +00005782 // The last time that compaction was attempted on this process in milliseconds
5783 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5784 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005785
Ben Murdoch885c21b2019-03-15 18:02:04 +00005786 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005787 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005788
5789 // The process state at the time of compaction.
5790 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005791
5792 // Free ZRAM in kilobytes before compaction.
5793 optional int64 before_zram_free_kilobytes = 17;
5794
5795 // Free ZRAM in kilobytes after compaction.
5796 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005797}
lifr157fc552018-12-12 16:38:04 +08005798
5799/**
lifrb6b90b62019-03-29 00:40:17 +08005800 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5801 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5802 *
lifr1f74b052019-04-16 22:16:30 +08005803 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5804 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5805 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5806 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005807 */
5808message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005809 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005810
lifr1f74b052019-04-16 22:16:30 +08005811 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005812
5813 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005814 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005815
lifr1f74b052019-04-16 22:16:30 +08005816 // Only valid for event_type = EVENT_GETADDRINFO.
5817 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005818
lifr1f74b052019-04-16 22:16:30 +08005819 // Flags passed to android_res_nsend() defined in multinetwork.h
5820 // Only valid for event_type = EVENT_RESNSEND.
5821 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005822
lifrad9becc2019-05-20 11:04:41 +08005823 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005824
5825 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005826 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005827
5828 // Additional pass-through fields opaque to statsd.
5829 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005830 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005831
5832 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5833 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005834}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005835
5836/**
5837 * Logs when a data stall event occurs.
5838 *
5839 * Log from:
5840 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5841 */
5842message DataStallEvent {
5843 // Data stall evaluation type.
5844 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5845 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5846 optional int32 evaluation_type = 1;
5847 // See definition in data_stall_event.proto.
5848 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5849 // See definition in data_stall_event.proto.
5850 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5851 // See definition in data_stall_event.proto.
5852 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5853 // See definition in data_stall_event.proto.
5854 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5855 // See definition in data_stall_event.proto.
5856 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5857}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005858
5859/*
5860 * Logs when RescueParty resets some set of experiment flags.
5861 *
5862 * Logged from:
5863 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5864 */
5865message RescuePartyResetReported {
5866 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5867 optional int32 rescue_level = 1;
5868}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005869
5870/**
5871 * Logs when signed config is received from an APK, and if that config was applied successfully.
5872 * Logged from:
5873 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5874 */
5875message SignedConfigReported {
5876 enum Type {
5877 UNKNOWN_TYPE = 0;
5878 GLOBAL_SETTINGS = 1;
5879 }
5880 optional Type type = 1;
5881
5882 // The final status of the signed config received.
5883 enum Status {
5884 UNKNOWN_STATUS = 0;
5885 APPLIED = 1;
5886 BASE64_FAILURE_CONFIG = 2;
5887 BASE64_FAILURE_SIGNATURE = 3;
5888 SECURITY_EXCEPTION = 4;
5889 INVALID_CONFIG = 5;
5890 OLD_CONFIG = 6;
5891 SIGNATURE_CHECK_FAILED = 7;
5892 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005893 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005894 }
5895 optional Status status = 2;
5896
5897 // The version of the signed config processed.
5898 optional int32 version = 3;
5899
5900 // The package name that the config was extracted from.
5901 optional string from_package = 4;
5902
5903 enum Key {
5904 NO_KEY = 0;
5905 DEBUG = 1;
5906 PRODUCTION = 2;
5907 }
5908 // Which key was used to verify the config.
5909 optional Key verified_with = 5;
5910}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005911
5912/*
5913 * Logs GNSS Network-Initiated (NI) location events.
5914 *
5915 * Logged from:
5916 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5917 */
5918message GnssNiEventReported {
5919 // The type of GnssNiEvent.
5920 enum EventType {
5921 UNKNOWN = 0;
5922 NI_REQUEST = 1;
5923 NI_RESPONSE = 2;
5924 }
5925 optional EventType event_type = 1;
5926
5927 // An ID generated by HAL to associate NI notifications and UI responses.
5928 optional int32 notification_id = 2;
5929
5930 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005931 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005932
5933 // NI requires notification.
5934 optional bool need_notify = 4;
5935
5936 // NI requires verification.
5937 optional bool need_verify = 5;
5938
5939 // NI requires privacy override, no notification/minimal trace.
5940 optional bool privacy_override = 6;
5941
5942 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5943 // seconds.
5944 optional int32 timeout = 7;
5945
5946 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005947 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005948
5949 // String representing the requester of the network inititated location request.
5950 optional string requestor_id = 9;
5951
5952 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5953 // network initiated location request.
5954 optional string text = 10;
5955
5956 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005957 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005958
5959 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005960 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005961
5962 // True if SUPL ES is enabled.
5963 optional bool is_supl_es_enabled = 13;
5964
5965 // True if GNSS location is enabled.
5966 optional bool is_location_enabled = 14;
5967
5968 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005969 optional android.server.location.GnssUserResponseType user_response = 15;
5970}
5971
5972/**
5973 * Logs GNSS non-framework (NFW) location notification.
5974 *
5975 * Logged from:
5976 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5977 */
5978message GnssNfwNotificationReported {
5979 // Package name of the Android proxy application representing the non-framework entity that
5980 // requested location. Set to empty string if unknown.
5981 optional string proxy_app_package_name = 1;
5982
5983 // Protocol stack that initiated the non-framework location request.
5984 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5985
5986 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5987 // set to empty string. This field is opaque to the framework and used for logging purposes.
5988 optional string other_protocol_stack_name = 3;
5989
5990 // Source initiating/receiving the location information.
5991 optional android.server.location.NfwRequestor requestor = 4;
5992
5993 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5994 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5995 // and used for logging purposes.
5996 optional string requestor_id = 5;
5997
5998 // Indicates whether location information was provided for this request.
5999 optional android.server.location.NfwResponseType response_type = 6;
6000
6001 // True if the device is in user initiated emergency session.
6002 optional bool in_emergency_mode = 7;
6003
6004 // True if cached location is provided.
6005 optional bool is_cached_location = 8;
6006
6007 // True if proxy app permission mismatch between framework and GNSS HAL.
6008 optional bool is_permission_mismatched = 9;
6009}
6010
6011/**
6012 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6013 *
6014 * Logged from:
6015 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6016 */
6017message GnssConfigurationReported {
6018 // SUPL host name.
6019 optional string supl_host = 1;
6020
6021 // SUPL port number.
6022 optional int32 supl_port = 2;
6023
6024 // C2K host name.
6025 optional string c2k_host = 3;
6026
6027 // C2K port number.
6028 optional int32 c2k_port = 4;
6029
6030 // The SUPL version requested by Carrier.
6031 optional int32 supl_ver = 5;
6032
6033 // The SUPL mode.
6034 optional android.server.location.SuplMode supl_mode = 6;
6035
6036 // True if NI emergency SUPL restrictions is enabled.
6037 optional bool supl_es = 7;
6038
6039 // LTE Positioning Profile settings
6040 optional android.server.location.LppProfile lpp_profile = 8;
6041
6042 // Positioning protocol on A-Glonass system.
6043 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6044
6045 // True if emergency PDN is used. Otherwise, regular PDN is used.
6046 optional bool use_emergency_pdn_for_emergency_supl= 10;
6047
6048 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6049 optional android.server.location.GpsLock gps_lock = 11;
6050
6051 // Number of seconds to extend the emergency session duration post emergency call.
6052 optional int32 es_extension_sec = 12;
6053
6054 // The full list of package names of proxy Android applications representing the non-framework
6055 // location access entities (on/off the device) for which the framework user has granted
6056 // non-framework location access permission. The package names are concatenated in one string
6057 // with spaces as separators.
6058 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006059}
Jack Yu95b64f32018-12-13 18:26:11 +08006060
6061/**
6062 * Logs when a NFC device's error occurred.
6063 * Logged from:
6064 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6065 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6066 */
6067message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006068 enum Type {
6069 UNKNOWN = 0;
6070 CMD_TIMEOUT = 1;
6071 ERROR_NOTIFICATION = 2;
6072 AID_OVERFLOW = 3;
6073 }
6074 optional Type type = 1;
6075 // If it's nci cmd timeout, log the timeout command.
6076 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006077
Alex Salod7c3eef2019-01-25 14:43:27 -08006078 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006079}
6080
6081/**
6082 * Logs when a NFC device's state changed event
6083 * Logged from:
6084 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6085 */
6086message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006087 enum State {
6088 UNKNOWN = 0;
6089 OFF = 1;
6090 ON = 2;
6091 ON_LOCKED = 3; // Secure Nfc enabled.
6092 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6093 }
6094 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006095}
6096
6097/**
6098 * Logs when a NFC Beam Transaction occurred.
6099 * Logged from:
6100 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6101 */
6102message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006103 enum Operation {
6104 UNKNOWN = 0;
6105 SEND = 1;
6106 RECEIVE = 2;
6107 }
6108 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006109}
6110
6111/**
6112 * Logs when a NFC Card Emulation Transaction occurred.
6113 * Logged from:
6114 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6115 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6116 */
6117message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006118 enum Category {
6119 UNKNOWN = 0;
6120 HCE_PAYMENT = 1;
6121 HCE_OTHER = 2;
6122 OFFHOST = 3;
6123 }
6124 // Transaction belongs to HCE payment or HCE other category, or offhost.
6125 optional Category category = 1;
6126 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6127 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006128}
6129
6130/**
6131 * Logs when a NFC Tag event occurred.
6132 * Logged from:
6133 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6134 */
6135message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006136 enum Type {
6137 UNKNOWN = 0;
6138 URL = 1;
6139 BT_PAIRING = 2;
6140 PROVISION = 3;
6141 WIFI_CONNECT = 4;
6142 APP_LAUNCH = 5;
6143 OTHERS = 6;
6144 }
6145 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006146}
6147
6148/**
6149 * Logs when Hce transaction triggered
6150 * Logged from:
6151 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6152 */
6153message NfcHceTransactionOccurred {
6154 // The latency period(in microseconds) it took for the first HCE data
6155 // exchange.
6156 optional uint32 latency_micros = 1;
6157}
6158
6159/**
6160 * Logs when SecureElement state event changed
6161 * Logged from:
6162 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6163 */
6164message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006165 enum State {
6166 UNKNOWN = 0;
6167 INITIALIZED = 1;
6168 DISCONNECTED = 2;
6169 CONNECTED = 3;
6170 HALCRASH = 4;
6171 }
6172 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006173
Alex Salod7c3eef2019-01-25 14:43:27 -08006174 optional string state_change_reason = 2;
6175 // SIMx or eSEx.
6176 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006177}
6178
6179/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006180 * Information about a permission grant request
6181 */
6182message PermissionGrantRequestResultReported {
6183 // unique value identifying an API call. A API call might result in multiple of these atoms
6184 optional int64 request_id = 1;
6185
6186 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006187 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006188
6189 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006190 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006191
6192 // The permission to be granted
6193 optional string permission_name = 4;
6194
6195 // If the permission was explicitly requested via the API or added by the system
6196 optional bool is_implicit = 5;
6197
6198 enum Result {
6199 UNDEFINED = 0;
6200 // permission request was ignored
6201 IGNORED = 1;
6202 // permission request was ignored because it was user fixed
6203 IGNORED_USER_FIXED = 2;
6204 // permission request was ignored because it was policy fixed
6205 IGNORED_POLICY_FIXED = 3;
6206 // permission was granted by user action
6207 USER_GRANTED = 4;
6208 // permission was automatically granted
6209 AUTO_GRANTED = 5;
6210 // permission was denied by user action
6211 USER_DENIED = 6;
6212 // permission was denied with prejudice by the user
6213 USER_DENIED_WITH_PREJUDICE = 7;
6214 // permission was automatically denied
6215 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006216 // permission request was ignored because permission is restricted
6217 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006218 // one time permission was granted by user action
6219 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006220 // user ignored request by leaving the request screen without choosing any option
6221 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006222 // user granted the permission after being linked to settings
6223 USER_GRANTED_IN_SETTINGS = 12;
6224 // user denied the permission after being linked to settings
6225 USER_DENIED_IN_SETTINGS = 13;
6226 // user denied the permission with prejudice after being linked to settings
6227 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6228 // permission was automatically revoked after one-time permission expired
6229 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006230 }
6231 // The result of the permission grant
6232 optional Result result = 6;
6233}
6234
6235/**
Jack Yu95b64f32018-12-13 18:26:11 +08006236 * Logs when Omapi API used
6237 * Logged from:
6238 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6239 */
6240message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006241 enum Operation {
6242 UNKNOWN = 0;
6243 OPEN_CHANNEL = 1;
6244 }
6245 optional Operation operation = 1;
6246 // SIMx or eSEx.
6247 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006248
Alex Salod7c3eef2019-01-25 14:43:27 -08006249 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006250}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006251
6252/**
Alex Saloa060aee2019-01-21 14:36:41 -08006253 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6254 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006255 * Logged from:
6256 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6257 */
6258message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006259 optional int64 dispatch_latency_millis = 1;
6260}
6261
6262/**
6263 * Logs AttentionManagerService attention check result.
6264 *
6265 * Logged from:
6266 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6267 */
6268message AttentionManagerServiceResultReported {
6269 // See core/java/android/service/attention/AttentionService.java
6270 enum AttentionCheckResult {
6271 UNKNOWN = 20;
6272 ATTENTION_SUCCESS_ABSENT = 0;
6273 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006274 ATTENTION_FAILURE_UNKNOWN = 2;
6275 ATTENTION_FAILURE_CANCELLED = 3;
6276 ATTENTION_FAILURE_PREEMPTED = 4;
6277 ATTENTION_FAILURE_TIMED_OUT = 5;
6278 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006279 }
6280 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006281}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006282
6283/**
6284 * Logs when an adb connection changes state.
6285 *
6286 * Logged from:
6287 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6288 */
6289message AdbConnectionChanged {
6290 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6291 // previously selected for this system.
6292 optional int64 last_connection_time_millis = 1;
6293
6294 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6295 // to reconnect via adb without user interaction.
6296 optional int64 auth_window_millis = 2;
6297
6298 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6299 optional android.debug.AdbConnectionStateEnum state = 3;
6300
6301 // True if the 'always allow' option was selected for this system.
6302 optional bool always_allow = 4;
6303}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006304
6305/*
6306 * Logs the reported speech DSP status.
6307 *
6308 * Logged from:
6309 * Vendor audio implementation.
6310 */
6311message SpeechDspStatReported {
6312 // The total Speech DSP uptime in milliseconds.
6313 optional int32 total_uptime_millis = 1;
6314 // The total Speech DSP downtime in milliseconds.
6315 optional int32 total_downtime_millis = 2;
6316 optional int32 total_crash_count = 3;
6317 optional int32 total_recover_count = 4;
6318}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006319
6320/**
6321 * Logs USB connector contaminant status.
6322 *
6323 * Logged from: USB Service.
6324 */
6325message UsbContaminantReported {
6326 optional string id = 1;
6327 optional android.service.usb.ContaminantPresenceStatus status = 2;
6328}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006329
6330/**
6331 * This atom is for debugging purpose.
6332 */
6333message DebugElapsedClock {
6334 // Monotically increasing value for each pull.
6335 optional int64 pull_count = 1;
6336 // Time from System.elapsedRealtime.
6337 optional int64 elapsed_clock_millis = 2;
6338 // Time from System.elapsedRealtime.
6339 optional int64 same_elapsed_clock_millis = 3;
6340 // Diff between current elapsed time and elapsed time from previous pull.
6341 optional int64 elapsed_clock_diff_millis = 4;
6342
6343 enum Type {
6344 TYPE_UNKNOWN = 0;
6345 ALWAYS_PRESENT = 1;
6346 PRESENT_ON_ODD_PULLS = 2;
6347 }
6348 // Type of behavior for the pulled data.
6349 optional Type type = 5;
6350}
6351
6352/**
6353 * This atom is for debugging purpose.
6354 */
6355message DebugFailingElapsedClock {
6356 // Monotically increasing value for each pull.
6357 optional int64 pull_count = 1;
6358 // Time from System.elapsedRealtime.
6359 optional int64 elapsed_clock_millis = 2;
6360 // Time from System.elapsedRealtime.
6361 optional int64 same_elapsed_clock_millis = 3;
6362 // Diff between current elapsed time and elapsed time from previous pull.
6363 optional int64 elapsed_clock_diff_millis = 4;
6364}
Steven Wuacef6bb2019-01-23 14:21:17 -05006365
6366/** Logs System UI bubbles event changed.
6367 *
6368 * Logged from:
6369 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6370 */
6371message BubbleUIChanged {
6372
6373 // The app package that is posting the bubble.
6374 optional string package_name = 1;
6375
6376 // The notification channel that is posting the bubble.
6377 optional string notification_channel = 2;
6378
6379 // The notification id associated with the posted bubble.
6380 optional int32 notification_id = 3;
6381
6382 // The position of the bubble within the bubble stack.
6383 optional int32 position = 4;
6384
6385 // The total number of bubbles within the bubble stack.
6386 optional int32 total_number = 5;
6387
6388 // User interactions with the bubble.
6389 enum Action {
6390 UNKNOWN = 0;
6391 POSTED = 1;
6392 UPDATED = 2;
6393 EXPANDED = 3;
6394 COLLAPSED = 4;
6395 DISMISSED = 5;
6396 STACK_DISMISSED = 6;
6397 STACK_MOVED = 7;
6398 HEADER_GO_TO_APP = 8;
6399 HEADER_GO_TO_SETTINGS = 9;
6400 PERMISSION_OPT_IN = 10;
6401 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006402 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006403 SWIPE_LEFT = 13;
6404 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006405 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006406 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006407 }
6408 optional Action action = 6;
6409
6410 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6411 optional float normalized_x_position = 7;
6412 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006413
6414 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6415 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006416
6417 // Whether the bubble is an on-going one.
6418 optional bool is_ongoing = 10;
6419
6420 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006421 // This is deprecated and the value should be ignored.
6422 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006423}
Kweku Adams8845d012018-12-11 20:06:45 -08006424
6425/**
Steven Wu552f63f2019-02-05 13:41:36 -05006426 * Logs System UI bubbles developer errors.
6427 *
6428 * Logged from:
6429 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6430 */
6431message BubbleDeveloperErrorReported {
6432
6433 // The app package that is posting the bubble.
6434 optional string package_name = 1;
6435
6436 // Bubble developer error type enums.
6437 enum Error {
6438 UNKNOWN = 0;
6439 ACTIVITY_INFO_MISSING = 1;
6440 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6441 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6442 }
6443 optional Error error = 2 [default = UNKNOWN];
6444}
6445
6446/**
Kweku Adams8845d012018-12-11 20:06:45 -08006447 * Logs that a constraint for a scheduled job has changed.
6448 *
6449 * Logged from:
6450 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6451 */
6452message ScheduledJobConstraintChanged {
6453 repeated AttributionNode attribution_node = 1;
6454
6455 // Name of the job.
6456 optional string job_name = 2;
6457
6458 optional com.android.server.job.ConstraintEnum constraint = 3;
6459
6460 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006461 UNKNOWN = 0;
6462 UNSATISFIED = 1;
6463 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006464 }
6465 optional State state = 4;
6466}
Alex Salod7c3eef2019-01-25 14:43:27 -08006467
6468/**
6469 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6470 * returns true.
6471 *
6472 * Logged from:
6473 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6474 */
6475message ScreenTimeoutExtensionReported {
6476 // Describes how many times in a row did the power manager reset the screen off timeout.
6477 optional uint32 consecutive_timeout_extended_count = 1;
6478}
Hui Yu885aca12019-01-10 17:11:34 -08006479
6480/*
6481* Logs number of milliseconds it takes to start a process.
6482* The definition of app process start time is from the app launch time to
6483* the time that Zygote finished forking the app process and loaded the
6484* application package's java classes.
6485
6486* This metric is different from AppStartOccurred which is for foreground
6487* activity only.
6488
6489* ProcessStartTime can report all processes (both foreground and background)
6490* start time.
6491*
6492* Logged from:
6493* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6494*/
6495message ProcessStartTime {
6496 // The uid of the ProcessRecord.
6497 optional int32 uid = 1 [(is_uid) = true];
6498
6499 // The process pid.
6500 optional int32 pid = 2;
6501
6502 // The process name.
6503 // Usually package name, "system" for system server.
6504 // Provided by ActivityManagerService.
6505 optional string process_name = 3;
6506
6507 enum StartType {
6508 UNKNOWN = 0;
6509 WARM = 1;
6510 HOT = 2;
6511 COLD = 3;
6512 }
6513
6514 // The start type.
6515 optional StartType type = 4;
6516
6517 // The elapsed realtime at the start of the process.
6518 optional int64 process_start_time_millis = 5;
6519
6520 // Number of milliseconds it takes to reach bind application.
6521 optional int32 bind_application_delay_millis = 6;
6522
6523 // Number of milliseconds it takes to finish start of the process.
6524 optional int32 process_start_delay_millis = 7;
6525
6526 // hostingType field in ProcessRecord, the component type such as "activity",
6527 // "service", "content provider", "broadcast" or other strings.
6528 optional string hosting_type = 8;
6529
6530 // hostingNameStr field in ProcessRecord. The component class name that runs
6531 // in this process.
6532 optional string hosting_name = 9;
6533}
6534
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006535/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006536 * Track Media Codec usage
6537 * Logged from:
6538 * frameworks/av/media/libstagefright/MediaCodec.cpp
6539 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6540 */
6541message MediametricsCodecReported {
6542 optional int64 timestamp_nanos = 1;
6543 optional string package_name = 2;
6544 optional int64 package_version_code = 3;
6545 optional int64 media_apex_version = 4;
6546
6547 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6548}
6549
6550/**
6551 * Track Media Extractor (pulling video/audio streams out of containers) usage
6552 * Logged from:
6553 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6554 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6555 */
6556message MediametricsExtractorReported {
6557 optional int64 timestamp_nanos = 1;
6558 optional string package_name = 2;
6559 optional int64 package_version_code = 3;
6560 optional int64 media_apex_version = 4;
6561
6562 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6563}
6564
6565/**
6566 * Track how we arbitrate between microphone/input requests.
6567 * Logged from
6568 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6569 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6570 */
6571message MediametricsAudiopolicyReported {
6572 optional int64 timestamp_nanos = 1;
6573 optional string package_name = 2;
6574 optional int64 package_version_code = 3;
6575 optional int64 media_apex_version = 4;
6576
6577 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6578}
6579
6580/**
6581 * Track how we arbitrate between microphone requests.
6582 * Logged from
6583 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6584 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6585 */
6586message MediametricsAudiorecordReported {
6587 optional int64 timestamp_nanos = 1;
6588 optional string package_name = 2;
6589 optional int64 package_version_code = 3;
6590 optional int64 media_apex_version = 4;
6591
6592 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6593}
6594
6595/**
6596 * Track how we arbitrate between microphone/input requests.
6597 * Logged from
6598 * frameworks/av/media/libnblog/ReportPerformance.cpp
6599 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6600 */
6601message MediametricsAudiothreadReported {
6602 optional int64 timestamp_nanos = 1;
6603 optional string package_name = 2;
6604 optional int64 package_version_code = 3;
6605 optional int64 media_apex_version = 4;
6606
6607 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6608}
6609
6610/**
6611 * Track how we arbitrate between microphone/input requests.
6612 * Logged from
6613 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6614 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6615 */
6616message MediametricsAudiotrackReported {
6617 optional int64 timestamp_nanos = 1;
6618 optional string package_name = 2;
6619 optional int64 package_version_code = 3;
6620 optional int64 media_apex_version = 4;
6621
6622 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6623}
6624
6625/**
6626 * Track information about DRM framework performance
6627 * Logged from
6628 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6629 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6630 */
6631message MediametricsMediadrmReported {
6632 optional int64 timestamp_nanos = 1;
6633 optional string package_name = 2;
6634 optional int64 package_version_code = 3;
6635 optional int64 media_apex_version = 4;
6636
6637 // vendor+description tell about which DRM plugin is in use on this device
6638 optional string vendor = 5;
6639 optional string description = 6;
6640 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6641 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6642}
6643
6644/**
6645 * Track information about the widevine DRM plugin performance
6646 * Logged from
6647 * vendor/widevine/libwvdrmengine/cdm/metrics
6648 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6649 */
6650message MediametricsDrmWidevineReported {
6651 optional int64 timestamp_nanos = 1;
6652 optional string package_name = 2;
6653 optional int64 package_version_code = 3;
6654 optional int64 media_apex_version = 4;
6655
6656 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6657}
6658
6659/**
6660 * Track information about recordings (e.g. camcorder)
6661 * Logged from
6662 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6663 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6664 */
6665message MediametricsRecorderReported {
6666 optional int64 timestamp_nanos = 1;
6667 optional string package_name = 2;
6668 optional int64 package_version_code = 3;
6669 optional int64 media_apex_version = 4;
6670
6671 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6672}
6673
6674/**
6675 * Track Media Player usage
6676 * Logged from:
6677 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6678 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6679 */
6680message MediametricsNuPlayerReported {
6681 optional int64 timestamp_nanos = 1;
6682 optional string package_name = 2;
6683 optional int64 package_version_code = 3;
6684 optional int64 media_apex_version = 4;
6685
6686 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6687}
6688
6689/**
Robert Shiha4beed32019-08-19 14:15:23 -07006690 * Track Legacy DRM usage
6691 * Logged from
6692 * frameworks/av/drm/drmserver/DrmManager.cpp
6693 */
6694message MediametricsDrmManagerReported {
6695 optional int64 timestamp_nanos = 1;
6696 optional string package_name = 2;
6697 optional int64 package_version_code = 3;
6698 optional int64 media_apex_version = 4;
6699
6700 enum Method {
6701 METHOD_NOT_FOUND = -1;
6702 GET_CONSTRAINTS = 0;
6703 GET_METADATA = 1;
6704 CAN_HANDLE = 2;
6705 PROCESS_DRM_INFO = 3;
6706 ACQUIRE_DRM_INFO = 4;
6707 SAVE_RIGHTS = 5;
6708 GET_ORIGINAL_MIME_TYPE = 6;
6709 GET_DRM_OBJECT_TYPE = 7;
6710 CHECK_RIGHTS_STATUS = 8;
6711 REMOVE_RIGHTS = 9;
6712 REMOVE_ALL_RIGHTS = 10;
6713 OPEN_CONVERT_SESSION = 11;
6714 OPEN_DECRYPT_SESSION = 12;
6715 }
6716
6717 // plugin_id+description inform which Legacy DRM plugins are still in use on device
6718 optional string plugin_id = 5;
6719 optional string description = 6;
6720 optional Method method = 7;
6721 optional string mime_types = 8;
6722}
6723
6724/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006725 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00006726 * Pulled from: StatsCompanionService
6727*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006728message DangerousPermissionState {
6729 // Name of the permission
6730 optional string permission_name = 1;
6731
6732 // Uid of the package
6733 optional int32 uid = 2 [(is_uid) = true];
6734
6735 // Package requesting the permission
6736 optional string package_name = 3;
6737
6738 // If the permission is granted to the uid
6739 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006740
6741 // Permission flags as per android.content.pm.PermissionFlags
6742 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006743}
6744
Michael Groover4a0ca942019-01-24 17:41:25 -08006745/**
6746 * Logs when a package is denied access to a device identifier based on the new access requirements.
6747 *
6748 * Logged from:
6749 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6750 */
6751message DeviceIdentifierAccessDenied {
6752 // The name of the package denied access to the requested device identifier.
6753 optional string package_name = 1;
6754
6755 // The name of the device identifier method the package attempted to invoke.
6756 optional string method_name = 2;
6757
6758 // True if the package is preinstalled.
6759 optional bool is_preinstalled = 3;
6760
6761 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08006762 // Starting from Android 11, this boolean is not set and will always be false.
6763 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08006764}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006765
6766/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006767 * Pulls the ongoing mainline install train version code.
6768 * Pulled from StatsCompanionService
6769 */
6770message TrainInfo {
6771 optional int64 train_version_code = 1;
6772
6773 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006774
6775 optional string train_name = 3;
6776
6777 enum Status {
6778 UNKNOWN = 0;
6779 INSTALL_REQUESTED = 1;
6780 INSTALL_STARTED = 2;
6781 INSTALL_STAGED_NOT_READY = 3;
6782 INSTALL_STAGED_READY = 4;
6783 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006784 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6785 // and INSTALL_FAILURE_COMMIT.
6786 INSTALL_FAILURE = 6 [deprecated = true];
6787 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006788 INSTALL_CANCELLED = 7;
6789 INSTALLER_ROLLBACK_REQUESTED = 8;
6790 INSTALLER_ROLLBACK_INITIATED = 9;
6791 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6792 INSTALLER_ROLLBACK_STAGED = 11;
6793 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6794 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6795 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6796 INSTALLER_ROLLBACK_SUCCESS = 15;
6797 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006798 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6799 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6800 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6801 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6802 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6803 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006804 INSTALL_FAILURE_DOWNLOAD = 23;
6805 INSTALL_FAILURE_STATE_MISMATCH = 24;
6806 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006807 }
6808 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006809}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006810
6811/**
6812 * Logs the gesture stage changed event.
6813 *
6814 * Logged from:
6815 * frameworks/base/packages/SystemUI/
6816 */
6817message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006818 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006819}
6820
6821/**
6822 * Logs the feedback type.
6823 *
6824 * Logged from:
6825 * frameworks/base/packages/SystemUI/
6826 */
6827message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006828 // Whether or not the gesture was used.
6829 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006830}
6831
6832/**
6833 * Logs the progress.
6834 *
6835 * Logged from:
6836 * frameworks/base/packages/SystemUI/
6837 */
6838message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006839 // [0,100] progress for the assist gesture.
6840 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006841}
Neil Fullerdb14b482019-02-05 19:44:44 +00006842
6843/*
6844 * Information about the time zone data on a device.
6845 */
6846message TimeZoneDataInfo {
6847 // A version identifier for the data set on device. e.g. "2018i"
6848 optional string tzdb_version = 1;
6849}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006850
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006851/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006852 * Logs the GPU stats global health information.
6853 *
6854 * Logged from:
6855 * frameworks/native/services/gpuservice/gpustats/
6856 */
6857message GpuStatsGlobalInfo {
6858 // Package name of the gpu driver.
6859 optional string driver_package_name = 1;
6860
6861 // Version name of the gpu driver.
6862 optional string driver_version_name = 2;
6863
6864 // Version code of the gpu driver.
6865 optional int64 driver_version_code = 3;
6866
6867 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6868 optional int64 driver_build_time = 4;
6869
6870 // Total count of the gl driver gets loaded.
6871 optional int64 gl_loading_count = 5;
6872
6873 // Total count of the gl driver fails to be loaded.
6874 optional int64 gl_loading_failure_count = 6;
6875
6876 // Total count of the Vulkan driver gets loaded.
6877 optional int64 vk_loading_count = 7;
6878
6879 // Total count of the Vulkan driver fails to be loaded.
6880 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006881
6882 // Api version of the system Vulkan driver.
6883 optional int32 vulkan_version = 9;
6884
6885 // Api version of the system CPU Vulkan driver.
6886 optional int32 cpu_vulkan_version = 10;
6887
6888 // Api version of the system GLES driver.
6889 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006890
6891 // Total count of the angle driver gets loaded.
6892 optional int64 angle_loading_count = 12;
6893
6894 // Total count of the angle driver fails to be loaded.
6895 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006896}
6897
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006898/**
6899 * GPU driver loading time info.
6900 */
6901message GpuDriverLoadingTime {
6902 // List of all the driver loading times for this app. The list size is
6903 // capped at 50.
6904 repeated int64 driver_loading_time = 1;
6905}
6906
6907/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006908 * Logs the GPU stats per app health information.
6909 *
6910 * Logged from:
6911 * frameworks/native/services/gpuservice/gpustats/
6912 */
6913message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006914 // Package name of the application that loads the gpu driver. Total number
6915 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006916 optional string app_package_name = 1;
6917
6918 // Version code of the gpu driver this app loads.
6919 optional int64 driver_version_code = 2;
6920
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006921 // gl driver loading time info.
6922 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6923 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006924
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006925 // Vulkan driver loading time info.
6926 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6927 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006928
6929 // Angle driver loading time info.
6930 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6931 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006932
6933 // CPU Vulkan implementation is in use.
6934 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07006935
6936 // App is not doing pre-rotation correctly.
6937 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08006938
6939 // App creates GLESv1 context.
6940 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006941}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006942
6943/*
6944 * Logs the size of the system ion heap.
6945 *
6946 * Pulled from StatsCompanionService.
6947 */
6948message SystemIonHeapSize {
6949 // Size of the system ion heap in bytes.
6950 optional int64 size_in_bytes = 1;
6951}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006952
Rafal Slawik77987ed2019-06-17 12:28:23 +01006953/*
6954 * Logs the per-process size of the system ion heap.
6955 *
6956 * Pulled from StatsCompanionService.
6957 */
6958message ProcessSystemIonHeapSize {
6959 // The uid if available. -1 means not available.
6960 optional int32 uid = 1 [(is_uid) = true];
6961
6962 // The process name (from /proc/PID/cmdline).
6963 optional string process_name = 2;
6964
6965 // Sum of sizes of all allocations.
6966 optional int32 total_size_in_kilobytes = 3;
6967
6968 // Number of allocations.
6969 optional int32 allocation_count = 4;
6970
6971 // Size of the largest allocation.
6972 optional int32 max_size_in_kilobytes = 5;
6973}
6974
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006975/**
6976 * Push network stack events.
6977 *
6978 * Log from:
6979 * frameworks/base/packages/NetworkStack/
6980 */
6981message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006982 // The id that indicates the event reported from NetworkStack.
6983 optional int32 event_id = 1;
6984 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006985 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6986}
Carmen Agimofa769c152019-03-04 14:39:14 +00006987
6988/**
6989 * Logs the apps that are installed on the external storage.
6990 * Pulled from:
6991 * StatsCompanionService
6992 */
6993message AppsOnExternalStorageInfo {
6994 // The type of the external storage.
6995 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6996 // The name of the package that is installed on the external storage.
6997 optional string package_name = 2;
6998}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006999
7000/**
7001 * Logs the settings related to Face.
7002 * Logged from:
7003 * frameworks/base/services/core/java/com/android/server/stats
7004 */
7005message FaceSettings {
7006 // Whether or not face unlock is allowed on Keyguard.
7007 optional bool unlock_keyguard_enabled = 1;
7008 // Whether or not face unlock dismisses the Keyguard.
7009 optional bool unlock_dismisses_keyguard = 2;
7010 // Whether or not face unlock requires attention.
7011 optional bool unlock_attention_required = 3;
7012 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7013 optional bool unlock_app_enabled = 4;
7014 // Whether or not face unlock always requires user confirmation.
7015 optional bool unlock_always_require_confirmation = 5;
7016 // Whether or not a diverse set of poses are required during enrollment.
7017 optional bool unlock_diversity_required = 6;
7018}
Maggie White442b6312019-04-05 16:26:44 -07007019
7020/**
7021 * Logs cooling devices maintained by the kernel.
7022 *
7023 * Pulled from StatsCompanionService.java
7024 */
7025message CoolingDevice {
7026 // The type of cooling device being reported. Eg. CPU, GPU...
7027 optional android.os.CoolingTypeEnum device_location = 1;
7028 // The name of the cooling device source. Eg. CPU0
7029 optional string device_name = 2;
7030 // Current throttle state of the cooling device. The value can any unsigned
7031 // integer between 0 and max_state defined in its driver. 0 means device is
7032 // not in throttling, higher value means deeper throttling.
7033 optional int32 state = 3;
7034}
Ben Blount763a5d52019-04-10 11:48:58 -07007035
7036/**
7037 * Intelligence has several counter-type events that don't warrant a
7038 * full separate atom. These are primarily API call counters but also include
7039 * counters for feature usage and specific failure modes.
7040 *
7041 * Logged from the Intelligence mainline module.
7042 */
7043message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007044 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007045 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007046 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007047 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007048 // How many times the event occured (to report a batch of high frequency events).
7049 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007050 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007051 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007052}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007053
7054/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007055 * Logs when Car Power state changed.
7056 *
7057 * Logged from:
7058 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7059 */
7060message CarPowerStateChanged {
7061 // States come from CpmsState in CarPowerManagementService.java.
7062 enum State {
7063 WAIT_FOR_VHAL = 0;
7064 ON = 1;
7065 SHUTDOWN_PREPARE = 2;
7066 WAIT_FOR_FINISH = 3;
7067 SUSPEND = 4;
7068 SIMULATE_SLEEP = 5;
7069 }
7070 optional State state = 1;
7071}
7072
7073/**
7074 * Logs whether GarageMode is entered.
7075 *
7076 * Logged from:
7077 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7078 */
7079message GarageModeInfo {
7080 // Whether GarageMode is entered.
7081 optional bool is_garage_mode = 1;
7082}
Martijn Coenencd95d462019-04-25 17:09:45 +02007083
7084/**
7085 * Historical app ops data per package.
7086 */
7087message AppOps {
7088 // Uid of the package requesting the op
7089 optional int32 uid = 1 [(is_uid) = true];
7090
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007091 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007092 optional string package_name = 2;
7093
7094 // operation id; maps to the OP_* constants in AppOpsManager.java
7095 optional int32 op_id = 3;
7096
7097 // The number of times the op was granted while the app was in the
7098 // foreground (only for trusted requests)
7099 optional int64 trusted_foreground_granted_count = 4;
7100
7101 // The number of times the op was granted while the app was in the
7102 // background (only for trusted requests)
7103 optional int64 trusted_background_granted_count = 5;
7104
7105 // The number of times the op was rejected while the app was in the
7106 // foreground (only for trusted requests)
7107 optional int64 trusted_foreground_rejected_count = 6;
7108
7109 // The number of times the op was rejected while the app was in the
7110 // background (only for trusted requests)
7111 optional int64 trusted_background_rejected_count = 7;
7112
7113 // For long-running operations, total duration of the operation
7114 // while the app was in the foreground (only for trusted requests)
7115 optional int64 trusted_foreground_duration_millis = 8;
7116
7117 // For long-running operations, total duration of the operation
7118 // while the app was in the background (only for trusted requests)
7119 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007120
7121 // Whether AppOps is guarded by Runtime permission
7122 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007123}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007124
7125/**
7126 * Location Manager API Usage information(e.g. API under usage,
7127 * API call's parameters).
7128 * Logged from:
7129 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7130 */
7131message LocationManagerApiUsageReported {
7132
7133 // Indicating if usage starts or usage ends.
7134 optional android.stats.location.UsageState state = 1;
7135
7136 // LocationManagerService's API in use.
7137 // We can identify which API from LocationManager is
7138 // invoking current LMS API by the combination of
7139 // API parameter(e.g. is_listener_null, is_intent_null,
7140 // is_location_request_null)
7141 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7142
7143 // Name of the package calling the API.
7144 optional string calling_package_name = 3;
7145
7146 // Type of the location provider.
7147 optional android.stats.location.ProviderType provider = 4;
7148
7149 // Quality of the location request
7150 optional android.stats.location.LocationRequestQuality quality = 5;
7151
7152 // The desired interval for active location updates, in milliseconds.
7153 // Bucketized to reduce cardinality.
7154 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7155
7156 // Minimum distance between location updates, in meters.
7157 // Bucketized to reduce cardinality.
7158 optional android.stats.location.SmallestDisplacementBucket
7159 bucketized_smallest_displacement = 7;
7160
7161 // The number of location updates.
7162 optional int64 num_updates = 8;
7163
7164 // The request expiration time, in millisecond since boot.
7165 // Bucketized to reduce cardinality.
7166 optional android.stats.location.ExpirationBucket
7167 bucketized_expire_in = 9;
7168
7169 // Type of Callback passed in for this API.
7170 optional android.stats.location.CallbackType callback_type = 10;
7171
7172 // The radius of the central point of the alert
7173 // region, in meters. Only for API REQUEST_GEOFENCE.
7174 // Bucketized to reduce cardinality.
7175 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7176
7177 // Activity Importance of API caller.
7178 // Categorized to 3 types that are interesting from location's perspective.
7179 optional android.stats.location.ActivityImportance activiy_importance = 12;
7180}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007181
7182/**
7183 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7184 */
7185message ReviewPermissionsFragmentResultReported {
7186 // unique value identifying a permission group change. A permission group change might result
7187 // in multiple of these atoms
7188 optional int64 change_id = 1;
7189
7190 // UID of package the permission belongs to
7191 optional int32 uid = 2 [(is_uid) = true];
7192
7193 // Name of package the permission belongs to
7194 optional string package_name = 3;
7195
7196 // The permission to be granted
7197 optional string permission_name = 4;
7198
7199 // The result of the permission grant
7200 optional bool permission_granted = 5;
7201}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007202
7203/**
7204* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7205* Logged from: RuntimePermissionUpdgradeController
7206*/
7207message RuntimePermissionsUpgradeResult {
7208 // Permission granted as result of upgrade
7209 optional string permission_name = 1;
7210
7211 // UID of package granted permission
7212 optional int32 uid = 2 [(is_uid) = true];
7213
7214 // Name of package granted permission
7215 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007216}
7217
7218/**
7219* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7220*/
7221message GrantPermissionsActivityButtonActions {
7222 // Permission granted as result of upgrade
7223 optional string permission_group_name = 1;
7224
7225 // UID of package granted permission
7226 optional int32 uid = 2 [(is_uid) = true];
7227
7228 // Name of package requesting permission
7229 optional string package_name = 3;
7230
7231 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7232 // LABEL_ constants in GrantPermissionActivity.java
7233 optional int32 buttons_presented = 4;
7234
7235 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7236 optional int32 button_clicked = 5;
7237}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007238
7239/**
7240 * Information about LocationAccessCheck notification presented to user
7241 */
7242message LocationAccessCheckNotificationAction {
7243
7244 // id which identifies single session of user interacting with permission controller
7245 optional int64 session_id = 1;
7246
7247 // Uid of package for which location access check is presented
7248 optional int32 package_uid = 2;
7249
7250 // Name of package for which location access check is presented
7251 optional string package_name = 3;
7252
7253 enum Result {
7254 UNDEFINED = 0;
7255 // notification was presented to the user
7256 NOTIFICATION_PRESENTED = 1;
7257 // notification was declined by the user
7258 NOTIFICATION_DECLINED = 2;
7259 // notification was clicked by the user
7260 NOTIFICATION_CLICKED = 3;
7261 }
7262
7263 // View / interaction recorded
7264 optional Result result = 4;
7265}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007266
7267/**
7268 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7269 */
7270message AppPermissionFragmentActionReported {
7271 // id which identifies single session of user interacting with permission controller
7272 optional int64 session_id = 1;
7273
7274 // unique value identifying a permission group change. A permission group change might result
7275 // in multiple of these atoms
7276 optional int64 change_id = 2;
7277
7278 // UID of package the permission belongs to
7279 optional int32 uid = 3 [(is_uid) = true];
7280
7281 // Name of package the permission belongs to
7282 optional string package_name = 4;
7283
7284 // The permission to be granted
7285 optional string permission_name = 5;
7286
7287 // The result of the permission grant
7288 optional bool permission_granted = 6;
7289}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007290
7291/**
7292* Information about a AppPermissionFragment viewed by user
7293*/
7294message AppPermissionFragmentViewed {
7295 // id which identifies single session of user interacting with permission controller
7296 optional int64 session_id = 1;
7297
7298 // UID of package for which permissions are viewed
7299 optional int32 uid = 2 [(is_uid) = true];
7300
7301 // Name of package for which permissions are viewed
7302 optional string package_name = 3;
7303
7304 // Permission group viewed
7305 optional string permission_group_name = 4;
7306}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007307
7308/**
7309* Information about a AppPermissionsFragment viewed by user
7310*/
7311message AppPermissionsFragmentViewed {
7312 // id which identifies single session of user interacting with permission controller
7313 optional int64 session_id = 1;
7314
7315 // id which identifies single view as every view might have several logging records
7316 // with different package information attached
7317 optional int64 view_id = 2;
7318
7319 // Permission group viewed
7320 optional string permission_group_name = 3;
7321
7322 // UID of package for which permissions are viewed
7323 optional int32 uid = 4 [(is_uid) = true];
7324
7325 // Name of package for which permissions are viewed
7326 optional string package_name = 5;
7327
7328 // Category in which permission is included
7329 enum Category {
7330 UNDEFINED = 0;
7331 ALLOWED = 1;
7332 ALLOWED_FOREGROUND = 2;
7333 DENIED = 3;
7334 }
7335 optional Category category = 6;
7336}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007337
7338/**
7339* Information about a PermissionAppsFragment viewed by user.
7340* Logged from ui/handheld/PermissionAppsFragment.java
7341*/
7342message PermissionAppsFragmentViewed {
7343 // id which identifies single session of user interacting with permission controller
7344 optional int64 session_id = 1;
7345
7346 // id which identifies single view as every view might have several logging records
7347 // with different package information attached
7348 optional int64 view_id = 2;
7349
7350 // Permission group viewed
7351 optional string permission_group_name = 3;
7352
7353 // UID of package for which permissions are viewed
7354 optional int32 uid = 4 [(is_uid) = true];
7355
7356 // Name of package for which permissions are viewed
7357 optional string package_name = 5;
7358
7359 // Category in which app is included
7360 enum Category {
7361 UNDEFINED = 0;
7362 ALLOWED = 1;
7363 ALLOWED_FOREGROUND = 2;
7364 DENIED = 3;
7365 }
7366 optional Category category = 6;
7367}
Tony Make2b1b672019-07-29 16:59:47 +01007368
7369/**
7370 * Logs when there is a smart selection related event.
7371 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7372 * Logged from: TextClassifierEventLogger.java
7373 */
7374message TextSelectionEvent {
7375 // A session ID.
7376 optional string session_id = 1;
7377
7378 // Event type of this event.
7379 optional android.stats.textclassifier.EventType event_type = 2;
7380
Tony Mak9c84bd22019-12-09 07:27:25 +00007381 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007382 optional string model_name = 3;
7383
7384 // Type of widget that was involved in triggering this event.
7385 optional android.stats.textclassifier.WidgetType widget_type = 4;
7386
7387 // Index of this event in a session.
7388 optional int32 event_index = 5;
7389
7390 // Entity type that is involved.
7391 optional string entity_type = 6;
7392
7393 // Relative word index of the start of the selection.
7394 optional int32 relative_word_start_index = 7;
7395
7396 // Relative word (exclusive) index of the end of the selection.
7397 optional int32 relative_word_end_index = 8;
7398
7399 // Relative word index of the start of the smart selection.
7400 optional int32 relative_suggested_word_start_index = 9;
7401
7402 // Relative word (exclusive) index of the end of the smart selection.
7403 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007404
7405 // Name of source package.
7406 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007407}
7408
7409/**
7410 * Logs when there is a smart linkify related event.
7411 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7412 * Logged from: TextClassifierEventLogger.java
7413 */
7414message TextLinkifyEvent {
7415 // A session ID.
7416 optional string session_id = 1;
7417
7418 // Event type of this event.
7419 optional android.stats.textclassifier.EventType event_type = 2;
7420
Tony Mak9c84bd22019-12-09 07:27:25 +00007421 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007422 optional string model_name = 3;
7423
7424 // Type of widget that was involved in triggering this event.
7425 optional android.stats.textclassifier.WidgetType widget_type = 4;
7426
7427 // Index of this event in a session.
7428 optional int32 event_index = 5;
7429
7430 // Entity type that is involved.
7431 optional string entity_type = 6;
7432
7433 // Number of links detected.
7434 optional int32 num_links = 7;
7435
7436 // The total length of all links.
7437 optional int32 linked_text_length = 8;
7438
7439 // Length of input text.
7440 optional int32 text_length = 9;
7441
7442 // Time spent on generating links in ms.
7443 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007444
7445 // Name of source package.
7446 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007447}
7448
7449/**
7450 * Logs when there is a conversation actions related event.
7451 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7452 * Logged from: TextClassifierEventLogger.java
7453 */
7454message ConversationActionsEvent {
7455 // A session ID.
7456 optional string session_id = 1;
7457
7458 // Event type of this event.
7459 optional android.stats.textclassifier.EventType event_type = 2;
7460
Tony Mak9c84bd22019-12-09 07:27:25 +00007461 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007462 optional string model_name = 3;
7463
7464 // Type of widget that was involved in triggering this event.
7465 optional android.stats.textclassifier.WidgetType widget_type = 4;
7466
7467 // The first entity type that is involved.
7468 optional string first_entity_type = 5;
7469
7470 // The second entity type that is involved.
7471 optional string second_entity_type = 6;
7472
7473 // The third entity type that is involved.
7474 optional string third_entity_type = 7;
7475
7476 // The score of the first entity type.
7477 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007478
7479 // Name of source package.
7480 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00007481
7482 // Name of the annotator model that is involved in this event.
7483 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01007484}
7485
7486/**
7487 * Logs when there is a language detection related event.
7488 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7489 * Logged from: TextClassifierEventLogger.java
7490 */
7491message LanguageDetectionEvent {
7492 // A session ID.
7493 optional string session_id = 1;
7494
7495 // Event type of this event.
7496 optional android.stats.textclassifier.EventType event_type = 2;
7497
Tony Mak9c84bd22019-12-09 07:27:25 +00007498 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007499 optional string model_name = 3;
7500
7501 // Type of widget that was involved in triggering this event.
7502 optional android.stats.textclassifier.WidgetType widget_type = 4;
7503
7504 // Detected language.
7505 optional string language_tag = 5;
7506
7507 // Score of the detected language.
7508 optional float score = 6;
7509
7510 // Position of this action.
7511 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007512
7513 // Name of source package.
7514 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007515}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007516
7517/**
7518 * Information about an OTA update attempt by update_engine.
7519 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7520 */
7521message UpdateEngineUpdateAttemptReported {
7522 // The number of attempts for the update engine to apply a given payload.
7523 optional int32 attempt_number = 1;
7524
7525 optional android.stats.otaupdate.PayloadType payload_type = 2;
7526
7527 // The total time in minutes for the update engine to apply a given payload.
7528 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7529 // it's increased when the system is sleeping.
7530 optional int32 duration_boottime_in_minutes = 3;
7531
7532 // The total time in minutes for the update engine to apply a given payload.
7533 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7534 // and it's not increased when the system is sleeping.
7535 optional int32 duration_monotonic_in_minutes = 4;
7536
7537 // The size of the payload in MiBs.
7538 optional int32 payload_size_mib = 5;
7539
7540 // The attempt result reported by the update engine for an OTA update.
7541 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7542
7543 // The error code reported by the update engine after an OTA update attempt
7544 // on A/B devices.
7545 optional android.stats.otaupdate.ErrorCode error_code = 7;
7546
7547 // The build fingerprint of the source system. The value is read from a
7548 // system property when the device takes the update. e.g.
7549 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7550 optional string source_fingerprint = 8;
7551}
7552
7553/**
7554 * Information about all the attempts the device make before finishing the
7555 * successful update.
7556 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7557 */
7558message UpdateEngineSuccessfulUpdateReported {
7559 // The number of attempts for the update engine to apply the payload for a
7560 // successful update.
7561 optional int32 attempt_count = 1;
7562
7563 optional android.stats.otaupdate.PayloadType payload_type = 2;
7564
7565 optional int32 payload_size_mib = 3;
7566
7567 // The total number of bytes downloaded by update_engine since the last
7568 // successful update.
7569 optional int32 total_bytes_downloaded_mib = 4;
7570
7571 // The ratio in percentage of the over-downloaded bytes compared to the
7572 // total bytes needed to successfully install the update. e.g. 200 if we
7573 // download 200MiB in total for a 100MiB package.
7574 optional int32 download_overhead_percentage = 5;
7575
7576 // The total time in minutes for the update engine to apply the payload for a
7577 // successful update.
7578 optional int32 total_duration_minutes = 6;
7579
7580 // The number of reboot of the device during a successful update.
7581 optional int32 reboot_count = 7;
7582}
Alec Mourie088e762019-07-02 13:10:55 -07007583
7584/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08007585 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
7586 * key to indicate whether it was successful or not.
7587 *
7588 * Logged from:
7589 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
7590 */
7591message RebootEscrowRecoveryReported {
7592 optional bool successful = 1;
7593}
7594
7595/**
Alec Mourie088e762019-07-02 13:10:55 -07007596 * Global display pipeline metrics reported by SurfaceFlinger.
7597 * Pulled from:
7598 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7599 */
7600message SurfaceflingerStatsGlobalInfo {
7601 // Total number of frames presented during the tracing period
7602 optional int64 total_frames = 1;
7603 // Total number of frames missed
7604 optional int64 missed_frames = 2;
7605 // Total number of frames that fell back to client composition
7606 optional int64 client_composition_frames = 3;
7607 // Total time the display was turned on
7608 optional int64 display_on_millis = 4;
7609 // Total time that was spent performing animations.
7610 // This is derived from the present-to-present layer histogram
7611 optional int64 animation_millis = 5;
7612}
7613
7614/**
7615 * Per-layer display pipeline metrics reported by SurfaceFlinger.
7616 * The number of layers uploaded will be restricted due to size limitations.
7617 * Pulled from:
7618 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7619 */
7620message SurfaceflingerStatsLayerInfo {
7621 // The layer for this set of metrics
7622 // For now we can infer that the package name is included in the layer
7623 // name.
7624 optional string layer_name = 1;
7625 // Total number of frames presented
7626 optional int64 total_frames = 2;
7627 // Total number of dropped frames while latching a buffer for this layer.
7628 optional int64 dropped_frames = 3;
7629 // Set of timings measured between successive presentation timestamps.
7630 optional FrameTimingHistogram present_to_present = 4
7631 [(android.os.statsd.log_mode) = MODE_BYTES];
7632 // Set of timings measured from when an app queued a buffer for
7633 // presentation, until the buffer was actually presented to the
7634 // display.
7635 optional FrameTimingHistogram post_to_present = 5
7636 [(android.os.statsd.log_mode) = MODE_BYTES];
7637 // Set of timings measured from when a buffer is ready to be presented,
7638 // until the buffer was actually presented to the display.
7639 optional FrameTimingHistogram acquire_to_present = 6
7640 [(android.os.statsd.log_mode) = MODE_BYTES];
7641 // Set of timings measured from when a buffer was latched by
7642 // SurfaceFlinger, until the buffer was presented to the display
7643 optional FrameTimingHistogram latch_to_present = 7
7644 [(android.os.statsd.log_mode) = MODE_BYTES];
7645 // Set of timings measured from the desired presentation to the actual
7646 // presentation time
7647 optional FrameTimingHistogram desired_to_present = 8
7648 [(android.os.statsd.log_mode) = MODE_BYTES];
7649 // Set of timings measured from when an app queued a buffer for
7650 // presentation, until the buffer was ready to be presented.
7651 optional FrameTimingHistogram post_to_acquire = 9
7652 [(android.os.statsd.log_mode) = MODE_BYTES];
7653}
7654
7655/**
7656 * Histogram of frame counts bucketed by time in milliseconds.
7657 * Because of size limitations, we hard-cap the number of buckets, with
7658 * buckets for corresponding to larger milliseconds being less precise.
7659 */
7660message FrameTimingHistogram {
7661 // Timings in milliseconds that describes a set of histogram buckets
7662 repeated int32 time_millis_buckets = 1;
7663 // Number of frames that match to each time_millis, i.e. the bucket
7664 // contents
7665 // It's required that len(time_millis) == len(frame_count)
7666 repeated int64 frame_counts = 2;
7667}
Emilian Peev6729f372019-08-29 09:14:09 -07007668
Emilian Peev6729f372019-08-29 09:14:09 -07007669/**
7670 * Information about camera facing and API level usage.
7671 * Logged from:
7672 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
7673 */
7674message CameraActionEvent {
7675 // Camera session duration
7676 optional int64 duration = 1;
7677
7678 // Camera API level used
7679 optional int32 api_level = 2;
7680
7681 // Name of client package
7682 optional string package_name = 3;
7683
7684 // Camera facing
7685 enum Facing {
7686 UNKNOWN = 0;
7687 BACK = 1;
7688 FRONT = 2;
7689 EXTERNAL = 3;
7690 }
7691 optional Facing facing = 4;
7692}
atrost01a20932019-08-28 15:40:37 +01007693
7694/**
7695 * Logs when a compatibility change is affecting an app.
7696 *
7697 * Logged from:
7698 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
7699 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
7700 */
7701message AppCompatibilityChangeReported {
7702 // The UID of the app being affected by the compatibilty change.
7703 optional int32 uid = 1 [(is_uid) = true];
7704
7705 // The ID of the change affecting the app.
7706 optional int64 change_id = 2;
7707
7708 enum State {
7709 UNKNOWN_STATE = 0;
7710 ENABLED = 1;
7711 DISABLED = 2;
7712 LOGGED = 3;
7713 }
7714
7715 // The state of the change - if logged from gating whether it was enabled or disabled, or just
7716 // logged otherwise.
7717 optional State state = 3;
7718
7719 enum Source {
7720 UNKNOWN_SOURCE = 0;
7721 APP_PROCESS = 1;
7722 SYSTEM_SERVER = 2;
7723 }
7724
7725 // Where it was logged from.
7726 optional Source source = 4;
7727
7728}
Hector Dearman40579f62019-11-01 13:19:30 +00007729
7730/**
7731 * Logged from
7732 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
7733 */
7734message PerfettoUploaded {
7735 enum Event {
7736 PERFETTO_UNDEFINED = 0;
7737 PERFETTO_TRACE_BEGIN = 1;
7738 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
7739 PERFETTO_ON_CONNECT = 3;
7740 PERFETTO_ON_TRACING_DISABLED = 4;
7741 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
7742 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
7743 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
7744 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
7745 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
7746 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
7747 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
7748 PERFETTO_TRIGGER_BEGIN = 12;
7749 PERFETTO_TRIGGER_SUCCESS = 13;
7750 PERFETTO_TRIGGER_FAILURE = 14;
7751 PERFETTO_HIT_GUARDRAILS = 15;
7752 PERFETTO_ON_TIMEOUT = 16;
7753 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
7754 }
7755
7756 // Which stage of the pipeline we are reporting from.
7757 optional Event event = 1;
7758
7759 // UUID matching the one set inside the SystemInfo trace packet.
7760 optional int64 trace_uuid_lsb = 2;
7761 optional int64 trace_uuid_msb = 3;
7762}
Mark Tabrya824a642019-11-05 12:26:12 -08007763
7764/**
7765 * Pulls client metrics on data transferred via Vehicle Maps Service.
7766 * Metrics are keyed by uid + layer.
7767 *
7768 * Pulled from:
7769 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
7770 */
7771message VmsClientStats {
7772 // UID of the VMS client app
7773 optional int32 uid = 1 [(is_uid) = true];
7774
7775 // VMS layer definition
7776 optional int32 layer_type = 2;
7777 optional int32 layer_channel = 3;
7778 optional int32 layer_version = 4;
7779
7780 // Bytes and packets sent by the client for the layer
7781 optional int64 tx_bytes = 5;
7782 optional int64 tx_packets = 6;
7783
7784 // Bytes and packets received by the client for the layer
7785 optional int64 rx_bytes = 7;
7786 optional int64 rx_packets = 8;
7787
7788 // Bytes and packets dropped due to client error
7789 optional int64 dropped_bytes = 9;
7790 optional int64 dropped_packets = 10;
7791}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007792
7793/**
7794 * State of a dangerous permission requested by a package - sampled
7795 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
7796*/
7797message DangerousPermissionStateSampled {
7798 // Name of the permission
7799 optional string permission_name = 1;
7800
7801 // Uid of the package
7802 optional int32 uid = 2 [(is_uid) = true];
7803
7804 // If the permission is granted to the uid
7805 optional bool is_granted = 3;
7806
7807 // Permission flags as per android.content.pm.PermissionFlags
7808 optional int32 permission_flags = 4;
7809}
7810
Stan Iliev637ba5e2019-08-16 13:43:08 -04007811/**
7812 * HWUI renders pipeline type: GL (0) or Vulkan (1).
7813 */
7814enum PipelineType {
7815 GL = 0;
7816 VULKAN = 1;
7817}
7818
7819/**
7820 * HWUI stats for a given app.
7821 */
7822message GraphicsStats {
7823 // The package name of the app
7824 optional string package_name = 1;
7825
7826 // The version code of the app
7827 optional int64 version_code = 2;
7828
7829 // The start & end timestamps in UTC as
7830 // milliseconds since January 1, 1970
7831 // Compatible with java.util.Date#setTime()
7832 optional int64 stats_start = 3;
7833
7834 optional int64 stats_end = 4;
7835
7836 // HWUI renders pipeline type: GL or Vulkan.
7837 optional PipelineType pipeline = 5;
7838
7839 // Distinct frame count.
7840 optional int32 total_frames = 6;
7841
7842 // Number of "missed vsync" events.
7843 optional int32 missed_vsync_count = 7;
7844
7845 // Number of frames in triple-buffering scenario (high input latency)
7846 optional int32 high_input_latency_count = 8;
7847
7848 // Number of "slow UI thread" events.
7849 optional int32 slow_ui_thread_count = 9;
7850
7851 // Number of "slow bitmap upload" events.
7852 optional int32 slow_bitmap_upload_count = 10;
7853
7854 // Number of "slow draw" events.
7855 optional int32 slow_draw_count = 11;
7856
7857 // Number of frames that missed their deadline (aka, visibly janked)
7858 optional int32 missed_deadline_count = 12;
7859
7860 // The frame time histogram for the package
7861 optional FrameTimingHistogram cpu_histogram = 13
7862 [(android.os.statsd.log_mode) = MODE_BYTES];
7863
7864 // The gpu frame time histogram for the package
7865 optional FrameTimingHistogram gpu_histogram = 14
7866 [(android.os.statsd.log_mode) = MODE_BYTES];
7867
7868 // UI mainline module version.
7869 optional int64 version_ui_module = 15;
7870
7871 // If true, these are HWUI stats for up to a 24h period for a given app from today.
7872 // If false, these are HWUI stats for a 24h period for a given app from the last complete
7873 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
7874 // more apps are running / rendering.
7875 optional bool is_today = 16;
7876}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007877
7878/**
7879 * Message related to dangerous (runtime) app ops access
7880 */
7881message RuntimeAppOpsAccess {
7882 // Uid of the package accessing app op
7883 optional int32 uid = 1 [(is_uid) = true];
7884
7885 // Name of the package accessing app op
7886 optional string package_name = 2;
7887
7888 // operation id; maps to the OP_* constants in AppOpsManager.java
7889 optional int32 op_id = 3;
7890
7891 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
7892 // Features must be provided through manifest using <feature> tag available in R and above.
7893 optional string feature_id = 4;
7894
7895 // message related to app op access, limited to 600 chars by API
7896 optional string message = 5;
7897
7898 enum SamplingStrategy {
7899 DEFAULT = 0;
7900 UNIFORM = 1;
7901 RARELY_USED = 2;
7902 }
7903
7904 // sampling strategy used to collect this message
7905 optional SamplingStrategy sampling_strategy = 6;
7906}
7907
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00007908/*
7909 * Logs userspace reboot outcome and duration.
7910 *
7911 * Logged from:
7912 * frameworks/base/core/java/com/android/server/BootReceiver.java
7913 */
7914message UserspaceRebootReported {
7915 // Possible outcomes of userspace reboot.
7916 enum Outcome {
7917 // Default value in case platform failed to determine the outcome.
7918 OUTCOME_UNKNOWN = 0;
7919 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
7920 SUCCESS = 1;
7921 // Userspace reboot shutdown sequence was aborted.
7922 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
7923 // Remounting userdata into checkpointing mode failed.
7924 FAILED_USERDATA_REMOUNT = 3;
7925 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
7926 // reboot.
7927 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
7928 }
7929 // Outcome of userspace reboot. Always set.
7930 optional Outcome outcome = 1;
7931 // Duration of userspace reboot in case it has a successful outcome.
7932 // Duration is measured as time between userspace reboot was initiated and until boot completed
7933 // (e.g. sys.boot_completed=1).
7934 optional int64 duration_millis = 2;
7935 // State of primary user's (user0) credential encryption storage.
7936 enum UserEncryptionState {
7937 // Default value.
7938 USER_ENCRYPTION_STATE_UNKNOWN = 0;
7939 // Credential encrypted storage is unlocked.
7940 UNLOCKED = 1;
7941 // Credential encrypted storage is locked.
7942 LOCKED = 2;
7943 }
7944 // State of primary user's encryption storage at the moment boot completed. Always set.
7945 optional UserEncryptionState user_encryption_state = 3;
7946}