blob: d1995bcd5db29c0a337d2d8e8aebb55933a48601 [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";
Zhen Sun0bec8d42020-03-25 17:17:29 -070027import "frameworks/base/core/proto/android/app/tvsettings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080028import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080029import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080030import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080031import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080032import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080033import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080034import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080035import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080036import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080037import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080038import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080039import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080040import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080041import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070042import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080043import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080044import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080045import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080046import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
47import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070048import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
49import "frameworks/base/core/proto/android/stats/enums.proto";
50import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070051import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070052import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080053import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070054import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000055import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080056import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Will Brockman079fdaa2020-01-12 16:45:03 -050057import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080058import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080059import "frameworks/base/core/proto/android/telephony/enums.proto";
60import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080061import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010062import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070063import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080064
Yao Chend54f9dd2017-10-17 17:37:48 +000065/**
Stefan Lafonae2df012017-11-14 09:17:21 -080066 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000067 * raw stats log events from the Android system, also known as "atoms."
68 *
69 * This field contains a single oneof with all of the available messages.
70 * The stats-log-api-gen tool runs as part of the Android build and
71 * generates the android.util.StatsLog class, which contains the constants
72 * and methods that Android uses to log.
73 *
Stefan Lafonae2df012017-11-14 09:17:21 -080074 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000075 * Instead, statsd on Android constructs these messages synthetically,
76 * in the format defined here and in stats_log.proto.
77 */
Stefan Lafonae2df012017-11-14 09:17:21 -080078message Atom {
79 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070080 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070081 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
tsaichristinea3d2ed82020-03-19 20:53:36 -070082 BleScanStateChanged ble_scan_state_changed = 2
83 [(module) = "bluetooth", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080084 ProcessStateChanged process_state_changed = 3 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080085 BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070086 SensorStateChanged sensor_state_changed =
87 5 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080088 GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070089 SyncStateChanged sync_state_changed = 7 [(module) = "framework", (module) = "statsdtest"];
90 ScheduledJobStateChanged scheduled_job_state_changed =
91 8 [(module) = "framework", (module) = "statsdtest"];
92 ScreenBrightnessChanged screen_brightness_changed =
93 9 [(module) = "framework", (module) = "statsdtest"];
94 WakelockStateChanged wakelock_state_changed =
95 10 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080096 LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
97 11 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -070098 MobileRadioPowerStateChanged mobile_radio_power_state_changed =
99 12 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800100 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
101 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
102 14 [(module) = "framework"];
103 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
104 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
105 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
106 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800107 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700108 BatterySaverModeStateChanged battery_saver_mode_state_changed =
109 20 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800110 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
111 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700112 AudioStateChanged audio_state_changed =
113 23 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800114 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
115 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
116 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700117 UidProcessStateChanged uid_process_state_changed =
118 27 [(module) = "framework", (module) = "statsdtest"];
119 ProcessLifeCycleStateChanged process_life_cycle_state_changed =
120 28 [(module) = "framework", (module) = "statsdtest"];
121 ScreenStateChanged screen_state_changed =
122 29 [(module) = "framework", (module) = "statsdtest"];
123 BatteryLevelChanged battery_level_changed =
124 30 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800125 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
tsaichristine1449fa42020-01-02 12:12:05 -0800126 PluggedStateChanged plugged_state_changed = 32
127 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800128 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800129 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800130 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
131 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800132 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
133 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
134 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700135 PhoneSignalStrengthChanged phone_signal_strength_changed =
136 40 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800137 SettingChanged setting_changed = 41 [(module) = "framework"];
138 ActivityForegroundStateChanged activity_foreground_state_changed =
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700139 42 [(module) = "framework", (module) = "statsdtest"];
140 IsolatedUidChanged isolated_uid_changed =
141 43 [(module) = "framework", (module) = "statsd", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800142 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
143 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800144 AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800145 AppBreadcrumbReported app_breadcrumb_reported =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800146 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700147 AppStartOccurred app_start_occurred = 48 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800148 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
149 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800150 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800151 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800152 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800153 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800154 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
155 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800156 BootSequenceReported boot_sequence_reported = 57;
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800157 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700158 OverlayStateChanged overlay_state_changed =
159 59 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800160 ForegroundServiceStateChanged foreground_service_state_changed
161 = 60 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700162 CallStateChanged call_state_changed =
163 61 [(module) = "telecom", (truncate_timestamp) = true];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800164 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
165 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
166 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800167 AppDied app_died = 65 [(module) = "framework"];
168 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
169 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800170 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
171 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800172 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
173 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800174 SpeakerImpedanceReported speaker_impedance_reported = 71;
175 HardwareFailed hardware_failed = 72;
176 PhysicalDropDetected physical_drop_detected = 73;
177 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800178 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
179 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800180 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700181 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800182 ANROccurred anr_occurred = 79 [(module) = "framework"];
183 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
184 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700185 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800186 KeyValuePairsAtom key_value_pairs_atom =
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800187 83 [(allow_from_any_uid) = true, (module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800188 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
189 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700190 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800191 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
192 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
193 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
194 UiEventReported ui_event_reported = 90 [(module) = "framework"];
Howard Roa46b6582018-09-18 16:45:02 -0700195 BatteryHealthSnapshot battery_health_snapshot = 91;
196 SlowIo slow_io = 92;
197 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800198 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
199 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100200 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800201 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800202 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700203 // TODO: service state change is very noisy shortly after boot, as well
204 // as at other transitions - coming out of doze, device plugged in, etc.
205 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800206 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
207 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
208 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800209 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800210 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800211 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
212 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
213 105 [(module) = "docsui"];
214 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
215 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
216 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
217 108 [(module) = "docsui"];
218 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
219 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
220 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
221 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800222 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
tsaichristinececebdc2020-02-04 14:05:56 -0800223 WifiRunningStateChanged wifi_running_state_changed = 114
224 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800225 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800226 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800227 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800228 117 [(module) = "docsui"];
229 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
230 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
231 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
232 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800233 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
234 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
235 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800236 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
237 125 [(module) = "bluetooth"];
238 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
239 126 [(module) = "bluetooth"];
240 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
241 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800242 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000243 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800244 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
245 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
246 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800247 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800248 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
249 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
250 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
251 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
252 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
253 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800254 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
255 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800256 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
257 142 [(module) = "framework"];
258 AttentionManagerServiceResultReported attention_manager_service_result_reported =
259 143 [(module) = "framework"];
260 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800261 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800262 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800263 WatchdogRollbackOccurred watchdog_rollback_occurred =
264 147 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800265 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
266 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800267 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800268 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
269 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800270 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
271 151 [(module) = "bluetooth"];
272 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
273 152 [(module) = "bluetooth"];
274 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
275 153 [(module) = "bluetooth"];
276 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
277 154 [(module) = "bluetooth"];
278 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
279 155 [(module) = "bluetooth"];
280 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
281 156 [(module) = "bluetooth"];
282 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
283 157 [(module) = "bluetooth"];
284 BluetoothDeviceFailedContactCounterReported
285 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
286 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
287 159 [(module) = "bluetooth"];
288 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
289 160 [(module) = "bluetooth"];
290 BluetoothQualityReportReported bluetooth_quality_report_reported =
291 161 [(module) = "bluetooth"];
292 BluetoothDeviceInfoReported bluetooth_device_info_reported =
293 162 [(module) = "bluetooth"];
294 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
295 163 [(module) = "bluetooth"];
296 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
297 164 [(module) = "bluetooth"];
298 BluetoothBondStateChanged bluetooth_bond_state_changed =
299 165 [(module) = "bluetooth"];
300 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
301 166 [(module) = "bluetooth"];
302 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
303 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800304 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
305 168 [(module) = "framework"];
306 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700307 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800308 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800309 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800310 DeviceIdentifierAccessDenied device_identifier_access_denied =
311 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800312 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800313 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
314 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
315 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800316 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
317 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800318 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700319 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800320 180 [(module) = "permissioncontroller"];
321 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
322 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800323 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800324 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
325 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
326 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
327 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800328 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
329 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700330 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800331 188 [(module) = "intelligence"];
332 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
333 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800334 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800335 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800336 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
337 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
338 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
339 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
340 MediametricsCodecReported mediametrics_codec_reported = 195;
341 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
342 MediametricsExtractorReported mediametrics_extractor_reported = 197;
343 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
344 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
345 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700346 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800347 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
348 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800349 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800350 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
351 206 [(module) = "framework"];
352 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
353 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
354 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
355 LocationManagerApiUsageReported location_manager_api_usage_reported =
356 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100357 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800358 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100359 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800360 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100361 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800362 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100363 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800364 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100365 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800366 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100367 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800368 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100369 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800370 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100371 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800372 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800373 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
374 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
375 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
376 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800377 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800378 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700379 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
380 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800381 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100382 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800383 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800384 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800385 VmsClientConnectionStateChanged vms_client_connection_state_changed =
386 230 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800387 MediaProviderScanEvent media_provider_scan_event = 233 [(module) = "mediaprovider"];
388 MediaProviderDeletionEvent media_provider_deletion_event = 234 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700389 MediaProviderPermissionEvent media_provider_permission_event =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800390 235 [(module) = "mediaprovider"];
391 MediaProviderSchemaChange media_provider_schema_change = 236 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700392 MediaProviderIdleMaintenance media_provider_idle_maintenance =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800393 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800394 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
395 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
396 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
397 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800398 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800399 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000400 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800401 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman7fb79442020-02-27 14:34:24 -0500402 NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
403 NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800404 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
405 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800406 CellBroadcastMessageReported cb_message_reported =
407 249 [(module) = "cellbroadcast"];
408 CellBroadcastMessageError cb_message_error =
409 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700410 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
411 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
412 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800413 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000414 SnapshotMergeReported snapshot_merge_reported = 255;
Adam Bookatz38767932020-02-05 12:13:40 -0800415 ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
416 256 [(module) = "framework"];
Alec Mouri5ac32622020-02-06 08:44:25 -0800417 DisplayJankReported display_jank_reported = 257;
Kweku Adams12752132020-02-18 15:36:48 -0800418 AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -0500419 SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
420 RankingSelected ranking_selected = 260 [(module) = "framework"];
Zhen Sun7dbb51a2020-04-07 16:05:12 -0700421 TvSettingsUIInteracted tvsettings_ui_interacted = 261 [(module) = "tv_settings"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000422 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000423 }
David Chenc8a43242017-10-17 16:23:28 -0700424
David Chen6e3e6cb2018-01-03 16:14:06 -0800425 // Pulled events will start at field 10000.
Chi Zhangbb9ed922020-03-11 10:16:47 -0700426 // Next: 10080
David Chenc8a43242017-10-17 16:23:28 -0700427 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800428 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
429 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700430 MobileBytesTransfer mobile_bytes_transfer =
431 10002 [(module) = "framework", (truncate_timestamp) = true];
432 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
433 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800434 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
435 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700436 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800437 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700438 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800439 CpuTimePerUidFreq cpu_time_per_uid_freq =
440 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800441 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
442 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
443 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
444 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
445 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700446 SystemUptime system_uptime = 10015 [(module) = "framework", (module) = "statsdtest"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700447 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700448 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework", (module) = "statsdtest"];
449 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800450 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
451 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700452 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800453 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800454 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800455 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800456 DiskStats disk_stats = 10025 [(module) = "framework"];
457 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
458 AppSize app_size = 10027 [(module) = "framework"];
459 CategorySize category_size = 10028 [(module) = "framework"];
460 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800461 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800462 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
463 DiskIo disk_io = 10032 [(module) = "framework"];
464 PowerProfile power_profile = 10033 [(module) = "framework"];
465 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
466 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
467 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700468 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800469 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
470 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
471 10040 [(module) = "framework"];
472 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
473 10041 [(module) = "framework"];
474 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800475 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800476 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800477 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800478 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
479 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
480 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
481 RoleHolder role_holder = 10049 [(module) = "framework"];
482 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800483 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800484 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
485 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800486 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
487 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800488 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
489 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
490 FaceSettings face_settings = 10058 [(module) = "framework"];
491 CoolingDevice cooling_device = 10059 [(module) = "framework"];
492 AppOps app_ops = 10060 [(module) = "framework"];
493 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700494 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
495 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800496 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800497 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800498 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
499 DangerousPermissionStateSampled dangerous_permission_state_sampled =
500 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400501 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000502 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000503 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200504 PackageNotificationPreferences package_notification_preferences =
505 10071 [(module) = "framework"];
506 PackageNotificationChannelPreferences package_notification_channel_preferences =
507 10072 [(module) = "framework"];
508 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
509 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800510 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800511 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700512 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
513 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
514 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
515 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800516 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700517 }
yroa1fe77c2018-02-26 14:22:54 -0800518
Bookatz76aafcf2018-09-17 16:17:10 -0700519 // DO NOT USE field numbers above 100,000 in AOSP.
520 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
521 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100522
523 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700524}
525
Yao Chend54f9dd2017-10-17 17:37:48 +0000526/**
Yangster-mac20877162017-12-22 17:19:39 -0800527 * This proto represents a node of an attribution chain.
528 * Note: All attribution chains are represented as a repeated field of type
529 * AttributionNode. It is understood that in such arrays, the order is that
530 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000531 */
Yangster-mac20877162017-12-22 17:19:39 -0800532message AttributionNode {
533 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800534 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800535
Yangster-mac20877162017-12-22 17:19:39 -0800536 // The (optional) string tag for an element in the attribution chain. If the
537 // element has no tag, it is encoded as an empty string.
538 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700539}
540
Yangster-mac48b3d622018-08-18 12:38:11 -0700541message KeyValuePair {
542 optional int32 key = 1;
543 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700544 int32 value_int = 2;
545 int64 value_long = 3;
546 string value_str = 4;
547 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700548 }
549}
550
551message KeyValuePairsAtom {
552 optional int32 uid = 1;
553 repeated KeyValuePair pairs = 2;
554}
555
Yao Chend54f9dd2017-10-17 17:37:48 +0000556/*
557 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800558 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000559 *
560 * RULES:
561 * - The field ids for each atom must start at 1, and count upwards by 1.
562 * Skipping field ids is not allowed.
563 * - These form an API, so renaming, renumbering or removing fields is
564 * not allowed between android releases. (This is not currently enforced,
565 * but there will be a tool to enforce this restriction).
566 * - The types must be built-in protocol buffer types, namely, no sub-messages
567 * are allowed (yet). The bytes type is also not allowed.
568 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800569 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000570 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800571 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000572 * - A field that is a uid should be a string field, tagged with the [xxx]
573 * annotation. The generated code on android will be represented by UIDs,
574 * and those UIDs will be translated in xxx to those strings.
575 *
576 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700577 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000578 * - If there is a UID, it goes first. Think in an object-oriented fashion.
579 * *****************************************************************************
580 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700581
Yao Chend54f9dd2017-10-17 17:37:48 +0000582/**
Tej Singha72344992019-04-17 18:55:08 -0700583 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700584 * Logs when the Thermal service HAL notifies the throttling start/stop events.
585 *
586 * Logged from:
587 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
588 */
589message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700590 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700591 optional android.os.TemperatureTypeEnum sensor_type = 1;
592
Maggie White442b6312019-04-05 16:26:44 -0700593 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700594 enum State {
595 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700596 START = 1; // START indicated that throttling was triggered.
597 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700598 }
Yangster-mace16189a2018-08-26 12:20:16 -0700599 optional State state = 2;
600
601 optional float temperature = 3;
602}
603
604/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000605 * Logs when the screen state changes.
606 *
607 * Logged from:
608 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
609 */
610message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800611 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800612 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700613 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700614}
Yao Chend54f9dd2017-10-17 17:37:48 +0000615
616/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700617 * Logs that the process state of the uid, as determined by ActivityManager
618 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000619 *
620 * Logged from:
621 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
622 */
Bookatzc1a050a2017-10-10 15:49:28 -0700623message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700624 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000625
Bookatzdb026a22018-01-10 19:01:56 -0800626 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800627 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700628 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000629}
630
631/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700632 * Logs process state change of a process, as per the activity manager.
633 *
634 * Logged from:
635 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
636 */
637message ProcessStateChanged {
638 optional int32 uid = 1;
639 optional string process_name = 2;
640 optional string package_name = 3;
641 // TODO: remove this when validation is done
642 optional int64 version = 5;
643 // The state, from frameworks/base/core/proto/android/app/enums.proto.
644 optional android.app.ProcessStateEnum state = 4;
645}
646
647/**
648 * Logs when ActivityManagerService sleep state is changed.
649 *
650 * Logged from:
651 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
652 */
653message ActivityManagerSleepStateChanged {
654 // TODO: import frameworks proto
655 enum State {
656 UNKNOWN = 0;
657 ASLEEP = 1;
658 AWAKE = 2;
659 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700660 optional State state = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700661}
662
663/**
664 * Logs when system memory state changes.
665 *
666 * Logged from:
667 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
668 */
669message MemoryFactorStateChanged {
670 // TODO: import frameworks proto
671 enum State {
672 MEMORY_UNKNOWN = 0;
673 NORMAL = 1; // normal.
674 MODERATE = 2; // moderate memory pressure.
675 LOW = 3; // low memory.
676 CRITICAL = 4; // critical memory.
677
678 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700679 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700680}
681
682/**
683 * Logs when app is using too much cpu, according to ActivityManagerService.
684 *
685 * Logged from:
686 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
687 */
688message ExcessiveCpuUsageReported {
689 optional int32 uid = 1;
690 optional string process_name = 2;
691 optional string package_name = 3;
692 // package version. TODO: remove this when validation is done
693 optional int64 version = 4;
694}
695
696/**
697 * Logs when a cached process is killed, along with its pss.
698 *
699 * Logged from:
700 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
701 */
702message CachedKillReported {
703 optional int32 uid = 1;
704 optional string process_name = 2;
705 optional string package_name = 3;
706 // TODO: remove this when validation is done
707 optional int64 version = 5;
708 optional int64 pss = 4;
709}
710
711/**
xshu2c3d9e42019-09-26 17:54:02 -0700712 * Logs the change in wifi health.
713 *
714 * Logged from:
715 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
716 */
717message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800718 enum Band {
719 UNKNOWN = 0;
720 // All of 2.4GHz band
721 BAND_2G = 1;
722 // Frequencies in the range of [5150, 5250) GHz
723 BAND_5G_LOW = 2;
724 // Frequencies in the range of [5250, 5725) GHz
725 BAND_5G_MIDDLE = 3;
726 // Frequencies in the range of [5725, 5850) GHz
727 BAND_5G_HIGH = 4;
728 // Frequencies in the range of [5925, 6425) GHz
729 BAND_6G_LOW = 5;
730 // Frequencies in the range of [6425, 6875) GHz
731 BAND_6G_MIDDLE = 6;
732 // Frequencies in the range of [6875, 7125) GHz
733 BAND_6G_HIGH = 7;
734 }
xshu2c3d9e42019-09-26 17:54:02 -0700735 // duration this stat is obtained over in milliseconds
736 optional int32 duration_millis = 1;
737 // whether wifi is classified as sufficient for the user's data traffic, determined
738 // by whether the calculated throughput exceeds the average demand within |duration_millis|
739 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700740 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800741 optional bool is_cell_data_available = 3;
742 // the Band bucket the connected network is on
743 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700744}
745
746/**
747 * Logged when wifi detects a significant change in connection failure rate.
748 *
749 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
750 *
751 */
752message WifiFailureStatReported {
753 enum AbnormalityType {
754 UNKNOWN = 0;
755 SIGNIFICANT_INCREASE = 1;
756 SIGNIFICANT_DECREASE = 2;
757 SIMPLY_HIGH = 3;
758 }
759 enum FailureType {
760 FAILURE_UNKNOWN = 0;
761 FAILURE_CONNECTION = 1;
762 FAILURE_ASSOCIATION_REJECTION = 2;
763 FAILURE_ASSOCIATION_TIMEOUT = 3;
764 FAILURE_AUTHENTICATION = 4;
765 FAILURE_NON_LOCAL_DISCONNECTION = 5;
766 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
767 }
768 // Reason for uploading this stat
769 optional AbnormalityType abnormality_type = 1;
770 // The particular type of failure
771 optional FailureType failure_type = 2;
772 // How many times we have encountered this combination of AbnormalityType and FailureType
773 optional int32 failure_count = 3;
774}
775
776/**
777 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
778 *
779 * Logged from:
780 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
781 */
782message WifiConnectionResultReported {
783 enum FailureCode {
784 FAILURE_UNKNOWN = 0;
785 FAILURE_ASSOCIATION_TIMEOUT = 1;
786 FAILURE_ASSOCIATION_REJECTION = 2;
787 FAILURE_AUTHENTICATION_GENERAL = 3;
788 FAILURE_AUTHENTICATION_EAP = 4;
789 FAILURE_DHCP = 5;
790 FAILURE_NETWORK_DISCONNECTION = 6;
791 FAILURE_ROAM_TIMEOUT = 7;
792 }
793 // true represents a successful connection
794 optional bool connection_result = 1;
795 // reason for the connection failure
796 optional FailureCode failure_code = 2;
797 // scan rssi before the connection attempt
798 optional int32 rssi = 3;
799}
800
801/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700802 * Logs when memory stats of a process is reported.
803 *
804 * Logged from:
805 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
806 */
807message ProcessMemoryStatReported {
808 optional int32 uid = 1;
809 optional string process_name = 2;
810 optional string package_name = 3;
811 //TODO: remove this when validation is done
812 optional int64 version = 9;
813 optional int64 pss = 4;
814 optional int64 uss = 5;
815 optional int64 rss = 6;
816 enum Type {
817 ADD_PSS_INTERNAL_SINGLE = 0;
818 ADD_PSS_INTERNAL_ALL_MEM = 1;
819 ADD_PSS_INTERNAL_ALL_POLL = 2;
820 ADD_PSS_EXTERNAL = 3;
821 ADD_PSS_EXTERNAL_SLOW = 4;
822 }
823 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800824 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700825}
826
827/**
Bookatzc1a050a2017-10-10 15:49:28 -0700828 * Logs that a process started, finished, crashed, or ANRed.
829 *
830 * Logged from:
831 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
832 */
833message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700834 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700835
David Chen0b5c90c2018-01-25 16:51:49 -0800836 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800837 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700838
Bookatzddccf0a2017-11-28 16:48:14 -0800839 // What lifecycle state the process changed to.
840 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800841 enum State {
842 FINISHED = 0;
843 STARTED = 1;
844 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800845 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800846 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700847}
848
Bookatzc1a050a2017-10-10 15:49:28 -0700849/**
850 * Logs when the ble scan state changes.
851 *
852 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700853 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700854 */
855message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800856 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700857 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700858
859 enum State {
860 OFF = 0;
861 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700862 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
863 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700864 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800865 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700866 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800867 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700868 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800869 (state_field_option).nested = true
870 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700871
Bookatze5ec0b42018-03-26 13:34:56 -0700872 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700873 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700874 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700875 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700876 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700877 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700878}
879
880/**
881 * Logs reporting of a ble scan finding results.
882 *
883 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700884 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700885 */
Bookatzae6738e2018-09-13 11:38:56 -0700886// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700887message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800888 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700889
890 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800891 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700892}
893
894/**
895 * Logs when a sensor state changes.
896 *
897 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700898 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700899 */
900message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800901 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700902
Bookatzc1a050a2017-10-10 15:49:28 -0700903 // The id (int) of the sensor.
904 optional int32 sensor_id = 2;
905
906 enum State {
907 OFF = 0;
908 ON = 1;
909 }
910 optional State state = 3;
911}
912
Bookatzc1a050a2017-10-10 15:49:28 -0700913/**
914 * Logs when GPS state changes.
915 *
916 * Logged from:
917 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
918 */
919message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800920 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700921
922 enum State {
923 OFF = 0;
924 ON = 1;
925 }
926 optional State state = 2;
927}
928
Bookatz48d362e2018-11-06 15:49:08 -0800929/**
930 * Logs when GPS signal quality.
931 *
932 * Logged from:
933 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
934 */
935message GpsSignalQualityChanged {
936 optional android.server.location.GpsSignalQualityEnum level = 1;
937}
938
Bookatzc1a050a2017-10-10 15:49:28 -0700939
940/**
941 * Logs when a sync manager sync state changes.
942 *
943 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700944 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700945 */
946message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800947 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700948
David Chen0b5c90c2018-01-25 16:51:49 -0800949 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800950 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700951
952 enum State {
953 OFF = 0;
954 ON = 1;
955 }
956 optional State state = 3;
957}
958
Yangster-mac96353002018-09-05 11:18:55 -0700959/*
960 * Deferred job stats.
961 *
962 * Logged from:
963 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
964*/
965message DeferredJobStatsReported {
966 repeated AttributionNode attribution_node = 1;
967
968 // Number of jobs deferred.
969 optional int32 num_jobs_deferred = 2;
970
971 // Time since the last job runs.
972 optional int64 time_since_last_job_millis = 3;
973}
974
Bookatzc1a050a2017-10-10 15:49:28 -0700975/**
976 * Logs when a job scheduler job state changes.
977 *
978 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700979 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700980 */
981message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800982 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700983
984 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800985 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700986
987 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800988 FINISHED = 0;
989 STARTED = 1;
990 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700991 }
992 optional State state = 3;
993
Tej Singh33a412b2018-03-16 18:43:59 -0700994 // The reason a job has stopped.
995 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700996 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700997 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100998
999 // The standby bucket of the app that scheduled the job. These match the framework constants
1000 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1001 // already assigned 0.
1002 enum Bucket {
1003 UNKNOWN = -1;
1004 ACTIVE = 0;
1005 WORKING_SET = 1;
1006 FREQUENT = 2;
1007 RARE = 3;
1008 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001009 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001010 }
1011 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1012
1013 // The job id (as assigned by the app).
1014 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001015
1016 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1017 // constraints as they are always assumed to be set.
1018 optional bool has_charging_constraint = 7;
1019 optional bool has_battery_not_low_constraint = 8;
1020 optional bool has_storage_not_low_constraint = 9;
1021 optional bool has_timing_delay_constraint = 10;
1022 optional bool has_deadline_constraint = 11;
1023 optional bool has_idle_constraint = 12;
1024 optional bool has_connectivity_constraint = 13;
1025 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001026}
1027
1028/**
1029 * Logs when the audio state changes.
1030 *
1031 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001032 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001033 */
1034message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001035 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001036
1037 enum State {
1038 OFF = 0;
1039 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001040 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1041 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001042 }
1043 optional State state = 2;
1044}
1045
1046/**
1047 * Logs when the video codec state changes.
1048 *
1049 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001050 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001051 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001052message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001053 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001054
1055 enum State {
1056 OFF = 0;
1057 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001058 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1059 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001060 }
1061 optional State state = 2;
1062}
1063
1064/**
1065 * Logs when the flashlight state changes.
1066 *
1067 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001068 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001069 */
1070message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001071 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001072
1073 enum State {
1074 OFF = 0;
1075 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001076 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1077 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001078 }
1079 optional State state = 2;
1080}
1081
1082/**
1083 * Logs when the camera state changes.
1084 *
1085 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001086 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001087 */
1088message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001089 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001090
1091 enum State {
1092 OFF = 0;
1093 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001094 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1095 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001096 }
1097 optional State state = 2;
1098}
1099
1100/**
1101 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001102 *
1103 * Logged from:
1104 * TODO
1105 */
Bookatzd6746242017-10-24 18:39:35 -07001106message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001107 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001108 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001109
Bookatz1a1b0462018-01-12 11:47:03 -08001110 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1111 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001112 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001113
1114 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001115 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001116
1117 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001118 RELEASE = 0;
1119 ACQUIRE = 1;
1120 CHANGE_RELEASE = 2;
1121 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001122 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001123 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001124 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001125 (state_field_option).default_state_value = 0,
1126 (state_field_option).nested = true
1127 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001128}
1129
1130/**
Bookatzc1a050a2017-10-10 15:49:28 -07001131 * Logs when a partial wakelock is considered 'long' (over 1 min).
1132 *
1133 * Logged from:
1134 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1135 */
1136message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001137 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001138
Yao Chend54f9dd2017-10-17 17:37:48 +00001139 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1140 optional string tag = 2;
1141
Bookatzc1a050a2017-10-10 15:49:28 -07001142 // TODO: I have no idea what this is.
1143 optional string history_tag = 3;
1144
1145 enum State {
1146 OFF = 0;
1147 ON = 1;
1148 }
1149 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001150}
1151
Bookatzc1a050a2017-10-10 15:49:28 -07001152/**
Bookatza66083f2018-09-20 17:24:00 -07001153 * Logs when the device is interactive, according to the PowerManager Notifier.
1154 *
1155 * Logged from:
1156 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1157 */
1158message InteractiveStateChanged {
1159 enum State {
1160 OFF = 0;
1161 ON = 1;
1162 }
1163 optional State state = 1;
1164}
1165
1166/**
Bookatzc1a050a2017-10-10 15:49:28 -07001167 * Logs Battery Saver state change.
1168 *
1169 * Logged from:
1170 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1171 */
1172message BatterySaverModeStateChanged {
1173 enum State {
1174 OFF = 0;
1175 ON = 1;
1176 }
1177 optional State state = 1;
1178}
1179
1180/**
1181 * Logs Doze mode state change.
1182 *
1183 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001184 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001185 */
1186message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001187 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001188}
1189
1190
1191/**
1192 * Logs state change of Doze mode including maintenance windows.
1193 *
1194 * Logged from:
1195 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1196 */
1197message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001198 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001199}
1200
1201/**
1202 * Logs screen brightness level.
1203 *
1204 * Logged from:
1205 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1206 */
1207message ScreenBrightnessChanged {
1208 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1209 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001210}
1211
1212/**
1213 * Logs battery level (percent full, from 0 to 100).
1214 *
1215 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001216 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001217 */
1218message BatteryLevelChanged {
1219 // Battery level. Should be in [0, 100].
1220 optional int32 battery_level = 1;
1221}
1222
1223/**
1224 * Logs change in charging status of the device.
1225 *
1226 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001227 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001228 */
1229message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001230 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1231 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001232}
1233
1234/**
1235 * Logs whether the device is plugged in, and what power source it is using.
1236 *
1237 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001238 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001239 */
1240message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001241 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1242 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001243}
1244
Bookatz8c6571b2017-10-24 15:04:41 -07001245/**
1246 * Logs when an app's wakeup alarm fires.
1247 *
1248 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001249 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001250 */
1251message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001252 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001253
1254 // Name of the wakeup alarm.
1255 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001256
1257 // Name of source package (for historical reasons, since BatteryStats tracked it).
1258 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001259
Ben Murdoch3389f1522019-05-21 15:05:34 +01001260 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001261 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001262}
1263
1264/**
1265 * Logs when an an app causes the mobile radio to change state.
1266 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1267 *
1268 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001269 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001270 */
1271message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001272 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001273
Bookatz1a1b0462018-01-12 11:47:03 -08001274 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1275 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001276}
1277
1278/**
1279 * Logs when an an app causes the wifi radio to change state.
1280 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1281 *
1282 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001283 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001284 */
1285message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001286 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001287
Bookatz1a1b0462018-01-12 11:47:03 -08001288 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1289 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001290}
1291
1292/**
1293 * Logs kernel wakeup reasons and aborts.
1294 *
1295 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001296 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001297 */
1298message KernelWakeupReported {
1299 // Name of the kernel wakeup reason (or abort).
1300 optional string wakeup_reason_name = 1;
1301
1302 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001303 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001304}
1305
1306/**
Bookatzda1798c2018-12-13 14:16:00 -08001307 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001308 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001309 *
1310 * Logged from:
1311 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1312 */
1313message WifiEnabledStateChanged {
1314 enum State {
1315 OFF = 0;
1316 ON = 1;
1317 }
1318 optional State state = 1;
1319}
1320
1321/**
tsaichristinececebdc2020-02-04 14:05:56 -08001322 * This atom is deprecated starting in R.
1323 *
Bookatzda1798c2018-12-13 14:16:00 -08001324 * 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 -08001325 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1326 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001327 *
1328 * Logged from:
1329 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1330 */
1331message WifiRunningStateChanged {
1332 repeated AttributionNode attribution_node = 1;
1333
1334 enum State {
1335 OFF = 0;
1336 ON = 1;
1337 }
1338 optional State state = 2;
1339}
1340
1341/**
Bookatze5885242017-10-24 20:10:31 -07001342 * Logs wifi locks held by an app.
1343 *
1344 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001345 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001346 */
1347message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001348 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001349
1350 enum State {
1351 OFF = 0;
1352 ON = 1;
1353 }
1354 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001355
1356 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1357 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001358}
1359
1360/**
1361 * Logs wifi signal strength changes.
1362 *
1363 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001364 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001365 */
1366message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001367 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1368 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001369}
1370
1371/**
1372 * Logs wifi scans performed by an app.
1373 *
1374 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001375 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001376 */
1377message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001378 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001379
1380 enum State {
1381 OFF = 0;
1382 ON = 1;
1383 }
1384 optional State state = 2;
1385}
1386
1387/**
Tej Singh4503e102018-01-04 14:35:01 -08001388 * Logs wifi multicast locks held by an app
1389 *
1390 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001391 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001392 */
1393message WifiMulticastLockStateChanged {
1394 repeated AttributionNode attribution_node = 1;
1395
1396 enum State {
1397 OFF = 0;
1398 ON = 1;
1399 }
1400 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001401
1402 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001403}
1404
1405/**
Tej Singh1ea42892018-01-19 09:27:00 -08001406 * Logs shutdown reason and duration on next boot.
1407 *
1408 * Logged from:
1409 * frameworks/base/core/java/com/android/server/BootReceiver.java
1410 */
1411message ShutdownSequenceReported {
1412 // True if shutdown is for a reboot. Default: false if we do not know.
1413 optional bool reboot = 1;
1414
1415 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1416 optional string reason = 2;
1417
1418 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1419 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001420 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001421
1422 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001423 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001424}
1425
Tej Singh6483ea42018-01-25 17:45:49 -08001426
1427/**
1428 * Logs boot reason and duration.
1429 *
1430 * Logged from:
1431 * system/core/bootstat/bootstat.cpp
1432 */
1433message BootSequenceReported {
1434 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1435 // Default: "<EMPTY>" if not available.
1436 optional string bootloader_reason = 1;
1437
1438 // Reason for system boot. Eg. bootloader, reboot,userrequested
1439 // Default: "<EMPTY>" if not available.
1440 optional string system_reason = 2;
1441
1442 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001443 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001444
1445 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001446 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001447
1448 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001449 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001450
1451 // Time since last boot in ms. Default: 0 if not available.
1452 optional int64 time_since_last_boot = 6;
1453}
1454
Tej Singhc477d9c2018-02-05 18:31:39 -08001455
1456/**
1457 * Logs call state and disconnect cause (if applicable).
1458 *
1459 * Logged from:
1460 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1461 */
1462message CallStateChanged {
1463 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1464 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1465 optional android.telecom.CallStateEnum call_state = 1;
1466
1467 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1468 // This value is only applicable when the call_state is DISCONNECTED, and
1469 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1470 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1471 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1472
1473 // True if the call is self-managed, which are apps that use the
1474 // telecom infrastructure to make their own calls.
1475 optional bool self_managed = 3;
1476
1477 // True if call is external. External calls are calls on connected Wear
1478 // devices but show up in Telecom so the user can pull them onto the device.
1479 optional bool external_call = 4;
1480}
1481
Tej Singh1ea42892018-01-19 09:27:00 -08001482/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001483 * Logs keyguard state. The keyguard is the lock screen.
1484 *
1485 * Logged from:
1486 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1487 */
1488message KeyguardStateChanged {
1489 enum State {
1490 UNKNOWN = 0;
1491 // The keyguard is hidden when the phone is unlocked.
1492 HIDDEN = 1;
1493 // The keyguard is shown when the phone is locked (screen turns off).
1494 SHOWN= 2;
1495 // The keyguard is occluded when something is overlaying the keyguard.
1496 // Eg. Opening the camera while on the lock screen.
1497 OCCLUDED = 3;
1498 }
1499 optional State state = 1;
1500}
1501
1502/**
1503 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1504 * prompts the user to enter a password (pattern, pin, etc).
1505 *
1506 * Logged from:
1507 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1508 */
1509
1510message KeyguardBouncerStateChanged {
1511 enum State {
1512 UNKNOWN = 0;
1513 // Bouncer is hidden, either as a result of successfully entering the
1514 // password, screen timing out, or user going back to lock screen.
1515 HIDDEN = 1;
1516 // This is when the user is being prompted to enter the password.
1517 SHOWN = 2;
1518 }
1519 optional State state = 1;
1520}
1521
1522/**
1523 * Logs the result of entering a password into the keyguard bouncer.
1524 *
1525 * Logged from:
1526 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1527 */
1528message KeyguardBouncerPasswordEntered {
1529 enum BouncerResult {
1530 UNKNOWN = 0;
1531 // The password entered was incorrect.
1532 FAILURE = 1;
1533 // The password entered was correct.
1534 SUCCESS = 2;
1535 }
1536 optional BouncerResult result = 1;
1537}
1538
Tej Singha883b372018-02-15 11:30:01 -08001539/*
1540 * Logs changes to the configuration of the device. The configuration is defined
1541 * in frameworks/base/core/java/android/content/res/Configuration.java
1542 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1543 * Please go there to interpret the possible values each field can be.
1544 *
1545 * Logged from:
1546 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1547 */
1548message ResourceConfigurationChanged {
1549 // Bit mask of color capabilities of the screen.
1550 // Contains information about the color gamut and hdr mode of the screen.
1551 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001552 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001553
1554 // The target screen density being rendered to.
1555 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001556 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001557
1558 // Current user preference for the scaling factor for fonts,
1559 // relative to the base density scaling.
1560 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001561 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001562
1563 // Flag indicating whether the hard keyboard is hidden.
1564 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001565 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001566
1567 // The type of keyboard attached to the device.
1568 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1569 optional int32 keyboard = 5;
1570
1571 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1572 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001573 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001574
1575 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1576 // 0 if undefined.
1577 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1578 optional int32 mcc = 7;
1579
1580 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1581 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1582 // MNC_ZERO symbol defined in Configuration.java.
1583 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1584 optional int32 mnc = 8;
1585
1586 // The kind of navigation available on the device.
1587 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1588 optional int32 navigation = 9;
1589
1590 // Flag indicating whether the navigation is available.
1591 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001592 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001593
1594 // Overall orientation of the screen.
1595 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1596 optional int32 orientation = 11;
1597
1598 // The current height of the available screen space, in dp units.
1599 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001600 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001601
1602 // Bit mask of overall layout of the screen.
1603 // Contains information about screen size, whether the screen is wider/taller
1604 // than normal, whether the screen layout is right-tl-left or left-to-right,
1605 // and whether the screen has a rounded shape.
1606 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001607 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001608
1609 // Current width of the available screen space, in dp units.
1610 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001611 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001612
1613 // The smallest screen size an application will see in normal operation.
1614 // This is the smallest value of both screenWidthDp and screenHeightDp
1615 // in portrait and landscape.
1616 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001617 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001618
1619 // The type of touch screen attached to the device.
1620 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1621 optional int32 touchscreen = 16;
1622
1623 // Bit mask of the ui mode.
1624 // Contains information about the overall ui mode of the device.
1625 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1626 // Also contains information about whether the device is in night mode.
1627 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001628 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001629}
1630
Tej Singheee317b2018-03-07 19:28:05 -08001631
1632/**
1633 * Logs changes in the connection state of the mobile radio.
1634 *
1635 * Logged from:
1636 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1637 */
1638message MobileConnectionStateChanged {
1639 // States are from the state machine DataConnection.java.
1640 enum State {
1641 UNKNOWN = 0;
1642 // The connection is inactive, or disconnected.
1643 INACTIVE = 1;
1644 // The connection is being activated, or connecting.
1645 ACTIVATING = 2;
1646 // The connection is active, or connected.
1647 ACTIVE = 3;
1648 // The connection is disconnecting.
1649 DISCONNECTING = 4;
1650 // The connection is disconnecting after creating a connection.
1651 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1652 }
1653 optional State state = 1;
1654 // For multi-sim phones, this distinguishes between the sim cards.
1655 optional int32 sim_slot_index = 2;
1656 // Used to identify the connection. Starts at 0 and increments by 1 for
1657 // every new network created. Resets whenever the device reboots.
1658 optional int32 data_connection_id = 3;
1659 // A bitmask for the capabilities of this connection.
1660 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1661 // Default value (if we have no information): 0
1662 optional int64 capabilities = 4;
1663 // If this connection has internet.
1664 // This just checks if the DEFAULT bit of capabilities is set.
1665 optional bool has_internet = 5;
1666}
1667
1668/**
1669 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1670 *
1671 * Logged from:
1672 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1673 */
1674message MobileRadioTechnologyChanged {
1675 optional android.telephony.NetworkTypeEnum state = 1;
1676 // For multi-sim phones, this distinguishes between the sim cards.
1677 optional int32 sim_slot_index = 2;
1678}
1679
Andrew Chantb56388b2018-03-22 21:07:33 -07001680/**
1681 * Logs the VID and PID of any connected USB devices.
1682 *
1683 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1684 *
1685 * Logged by Vendor.
1686 */
1687message UsbDeviceAttached {
1688 optional int32 vid = 1;
1689 optional int32 pid = 2;
1690 optional bool has_audio = 3;
1691 optional bool has_hid = 4;
1692 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001693 enum State {
1694 STATE_DISCONNECTED = 0;
1695 STATE_CONNECTED = 1;
1696 }
1697 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001698 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001699}
1700
Tej Singheee317b2018-03-07 19:28:05 -08001701
Tej Singhdd7bd352018-02-09 19:33:15 -08001702/**
Tej Singh5d991e12018-03-09 19:48:11 -08001703 * Logs when Bluetooth is enabled and disabled.
1704 *
1705 * Logged from:
1706 * services/core/java/com/android/server/BluetoothManagerService.java
1707 */
1708message BluetoothEnabledStateChanged {
1709 repeated AttributionNode attribution_node = 1;
1710 // Whether or not bluetooth is enabled on the device.
1711 enum State {
1712 UNKNOWN = 0;
1713 ENABLED = 1;
1714 DISABLED = 2;
1715 }
1716 optional State state = 2;
1717 // The reason for being enabled/disabled.
1718 // Eg. Airplane mode, crash, application request.
1719 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1720 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001721 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001722}
1723
1724/**
Jack Hed9837c82019-01-09 01:19:13 -08001725 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001726 *
1727 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001728 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1729 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001730 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001731 */
1732message BluetoothConnectionStateChanged {
1733 // The state of the connection.
1734 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1735 optional android.bluetooth.ConnectionStateEnum state = 1;
1736 // An identifier that can be used to match connect and disconnect events.
1737 // Currently is last two bytes of a hash of a device level ID and
1738 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001739 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001740 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001741 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1742 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001743 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001744 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001745 // An identifier that can be used to match events for this device.
1746 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1747 // Salt: Randomly generated 256 bit value
1748 // Hash algorithm: HMAC-SHA256
1749 // Size: 32 byte
1750 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001751 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001752 // An identifier that can be used to match events for this device.
1753 // The incremental identifier is locally generated and guaranteed not derived
1754 // from any globally unique hardware id.
1755 // For paired devices, it stays consistent between Bluetooth toggling for the
1756 // same remote device.
1757 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1758 // session for the same remote device.
1759 // Default: 0 if the device's metric id is unknown.
1760 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001761}
1762
1763/**
1764 * Logs when a Bluetooth device connects and disconnects over ACL
1765 *
1766 * Logged from:
1767 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1768 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001769 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001770 */
1771message BluetoothAclConnectionStateChanged {
1772 // An identifier that can be used to match events for this device.
1773 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1774 // Salt: Randomly generated 256 bit value
1775 // Hash algorithm: HMAC-SHA256
1776 // Size: 32 byte
1777 // Default: null or empty if the device identifier is not known
1778 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1779 // The state of the connection.
1780 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1781 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001782 // An identifier that can be used to match events for this device.
1783 // The incremental identifier is locally generated and guaranteed not derived
1784 // from any globally unique hardware id.
1785 // For paired devices, it stays consistent between Bluetooth toggling for the
1786 // same remote device.
1787 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1788 // session for the same remote device.
1789 // Default: 0 if the device's metric id is unknown.
1790 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001791}
1792
1793/**
1794 * Logs when a Bluetooth device connects and disconnects over SCO
1795 *
1796 * Logged from:
1797 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1798 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1799 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001800 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001801 */
1802message BluetoothScoConnectionStateChanged {
1803 // An identifier that can be used to match events for this device.
1804 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1805 // Salt: Randomly generated 256 bit value
1806 // Hash algorithm: HMAC-SHA256
1807 // Size: 32 byte
1808 // Default: null or empty if the device identifier is not known
1809 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1810 // The state of the connection.
1811 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1812 optional android.bluetooth.ConnectionStateEnum state = 2;
1813 // Codec used for this SCO connection
1814 // Default: UNKNOWN
1815 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001816 // An identifier that can be used to match events for this device.
1817 // The incremental identifier is locally generated and guaranteed not derived
1818 // from any globally unique hardware id.
1819 // For paired devices, it stays consistent between Bluetooth toggling for the
1820 // same remote device.
1821 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1822 // session for the same remote device.
1823 // Default: 0 if the device's metric id is unknown.
1824 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001825}
1826
Jack Hec27040a2019-01-09 20:54:41 -08001827/**
1828 * Logged when active device of a profile changes
1829 *
1830 * Logged from:
1831 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1832 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1833 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1834 */
1835message BluetoothActiveDeviceChanged {
1836 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1837 // From android.bluetooth.BluetoothProfile
1838 optional int32 bt_profile = 1;
1839 // An identifier that can be used to match events for this new active device.
1840 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1841 // Salt: Randomly generated 256 bit value
1842 // Hash algorithm: HMAC-SHA256
1843 // Size: 32 byte
1844 // Default: null or empty if there is no active device for this profile
1845 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001846 // An identifier that can be used to match events for this device.
1847 // The incremental identifier is locally generated and guaranteed not derived
1848 // from any globally unique hardware id.
1849 // For paired devices, it stays consistent between Bluetooth toggling for the
1850 // same remote device.
1851 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1852 // session for the same remote device.
1853 // Default: 0 if the device's metric id is unknown.
1854 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001855}
1856
Jack Heab86dbd22018-12-18 15:43:27 -08001857// Logs when there is an event affecting Bluetooth device's link layer connection.
1858// - This event is triggered when there is a related HCI command or event
1859// - Users of this metrics can deduce Bluetooth device's connection state from these events
1860// - HCI commands are logged before the command is sent, after receiving command status, and after
1861// receiving command complete
1862// - HCI events are logged when they arrive
1863//
1864// Low level log from system/bt
1865//
1866// Bluetooth classic commands:
1867// - CMD_CREATE_CONNECTION
1868// - CMD_DISCONNECT
1869// - CMD_CREATE_CONNECTION_CANCEL
1870// - CMD_ACCEPT_CONNECTION_REQUEST
1871// - CMD_REJECT_CONNECTION_REQUEST
1872// - CMD_SETUP_ESCO_CONNECTION
1873// - CMD_ACCEPT_ESCO_CONNECTION
1874// - CMD_REJECT_ESCO_CONNECTION
1875// - CMD_ENH_SETUP_ESCO_CONNECTION
1876// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1877//
1878// Bluetooth low energy commands:
1879// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1880// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1881// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1882// - CMD_BLE_CLEAR_WHITE_LIST
1883// - CMD_BLE_ADD_WHITE_LIST
1884// - CMD_BLE_REMOVE_WHITE_LIST
1885//
1886// Bluetooth classic events:
1887// - EVT_CONNECTION_COMP
1888// - EVT_CONNECTION_REQUEST
1889// - EVT_DISCONNECTION_COMP
1890// - EVT_ESCO_CONNECTION_COMP
1891// - EVT_ESCO_CONNECTION_CHANGED
1892//
1893// Bluetooth low energy meta events:
1894// - BLE_EVT_CONN_COMPLETE_EVT
1895// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1896//
1897// Next tag: 10
1898message BluetoothLinkLayerConnectionEvent {
1899 // An identifier that can be used to match events for this device.
1900 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1901 // Salt: Randomly generated 256 bit value
1902 // Hash algorithm: HMAC-SHA256
1903 // Size: 32 byte
1904 // Default: null or empty if the device identifier is not known
1905 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1906 // Connection handle of this connection if available
1907 // Range: 0x0000 - 0x0EFF (12 bits)
1908 // Default: 0xFFFF if the handle is unknown
1909 optional int32 connection_handle = 2;
1910 // Direction of the link
1911 // Default: DIRECTION_UNKNOWN
1912 optional android.bluetooth.DirectionEnum direction = 3;
1913 // Type of this link
1914 // Default: LINK_TYPE_UNKNOWN
1915 optional android.bluetooth.LinkTypeEnum type = 4;
1916
1917 // Reason metadata for this link layer connection event, rules for interpretation:
1918 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1919 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1920 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1921 // set and valid, ignore hci_ble_event
1922
1923 // HCI command associated with this event
1924 // Default: CMD_UNKNOWN
1925 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1926 // HCI event associated with this event
1927 // Default: EVT_UNKNOWN
1928 optional android.bluetooth.hci.EventEnum hci_event = 6;
1929 // HCI BLE meta event associated with this event
1930 // Default: BLE_EVT_UNKNOWN
1931 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1932 // HCI command status code if this is triggerred by hci_cmd
1933 // Default: STATUS_UNKNOWN
1934 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1935 // HCI reason code associated with this event
1936 // Default: STATUS_UNKNOWN
1937 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001938 // An identifier that can be used to match events for this device.
1939 // The incremental identifier is locally generated and guaranteed not derived
1940 // from any globally unique hardware id.
1941 // For paired devices, it stays consistent between Bluetooth toggling for the
1942 // same remote device.
1943 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1944 // session for the same remote device.
1945 // Default: 0 if the device's metric id is unknown.
1946 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001947}
1948
Howard Roe103fe22019-01-17 16:52:16 -08001949/**
1950 * Logs when a module is rolled back by Watchdog.
1951 *
1952 * Logged from: Rollback Manager
1953 */
1954message WatchdogRollbackOccurred {
1955 enum RollbackType {
1956 UNKNOWN = 0;
1957 ROLLBACK_INITIATE = 1;
1958 ROLLBACK_SUCCESS = 2;
1959 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001960 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001961 }
1962 optional RollbackType rollback_type = 1;
1963
1964 optional string package_name = 2;
1965
1966 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001967
1968 enum RollbackReasonType {
1969 REASON_UNKNOWN = 0;
1970 REASON_NATIVE_CRASH = 1;
1971 REASON_EXPLICIT_HEALTH_CHECK = 2;
1972 REASON_APP_CRASH = 3;
1973 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001974 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001975 }
1976 optional RollbackReasonType rollback_reason = 4;
1977
1978 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1979 // is initiated. Empty if the package is unknown.
1980 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001981
1982 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001983}
1984
Jack Hec27040a2019-01-09 20:54:41 -08001985/**
1986 * Logs when there is a change in Bluetooth A2DP playback state
1987 *
1988 * Logged from:
1989 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1990 */
1991message BluetoothA2dpPlaybackStateChanged {
1992 // An identifier that can be used to match events for this device.
1993 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1994 // Salt: Randomly generated 256 bit value
1995 // Hash algorithm: HMAC-SHA256
1996 // Size: 32 byte
1997 // Default: null or empty if the device identifier is not known
1998 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1999 // Current playback state
2000 // Default: PLAYBACK_STATE_UNKNOWN
2001 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2002 // Current audio coding mode
2003 // Default: AUDIO_CODING_MODE_UNKNOWN
2004 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002005 // An identifier that can be used to match events for this device.
2006 // The incremental identifier is locally generated and guaranteed not derived
2007 // from any globally unique hardware id.
2008 // For paired devices, it stays consistent between Bluetooth toggling for the
2009 // same remote device.
2010 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2011 // session for the same remote device.
2012 // Default: 0 if the device's metric id is unknown.
2013 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002014}
2015
2016/**
2017 * Logs when there is a change in A2DP codec config for a particular remote device
2018 *
2019 * Logged from:
2020 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2021 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2022 */
2023message BluetoothA2dpCodecConfigChanged {
2024 // An identifier that can be used to match events for this device.
2025 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2026 // Salt: Randomly generated 256 bit value
2027 // Hash algorithm: HMAC-SHA256
2028 // Size: 32 byte
2029 // Default: null or empty if the device identifier is not known
2030 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2031 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2032 // Default SOURCE_CODEC_TYPE_INVALID
2033 optional int32 codec_type = 2;
2034 // Codec priroity, the higher the more preferred, -1 for disabled
2035 // Default: CODEC_PRIORITY_DEFAULT
2036 optional int32 codec_priority = 3;
2037 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2038 // Default: SAMPLE_RATE_NONE
2039 optional int32 sample_rate = 4;
2040 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2041 // Default: BITS_PER_SAMPLE_NONE
2042 optional int32 bits_per_sample = 5;
2043 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2044 // Default: CHANNEL_MODE_NONE
2045 optional int32 channel_mode = 6;
2046 // Codec specific values
2047 // Default 0
2048 optional int64 codec_specific_1 = 7;
2049 optional int64 codec_specific_2 = 8;
2050 optional int64 codec_specific_3 = 9;
2051 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002052 // An identifier that can be used to match events for this device.
2053 // The incremental identifier is locally generated and guaranteed not derived
2054 // from any globally unique hardware id.
2055 // For paired devices, it stays consistent between Bluetooth toggling for the
2056 // same remote device.
2057 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2058 // session for the same remote device.
2059 // Default: 0 if the device's metric id is unknown.
2060 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002061}
2062
2063/**
2064 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2065 * Each codec's capability is logged separately due to statsd restriction
2066 *
2067 * Logged from:
2068 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2069 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2070 */
2071message BluetoothA2dpCodecCapabilityChanged {
2072 // An identifier that can be used to match events for this device.
2073 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2074 // Salt: Randomly generated 256 bit value
2075 // Hash algorithm: HMAC-SHA256
2076 // Size: 32 byte
2077 // Default: null or empty if the device identifier is not known
2078 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2079 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2080 // Default SOURCE_CODEC_TYPE_INVALID
2081 optional int32 codec_type = 2;
2082 // Codec priroity, the higher the more preferred, -1 for disabled
2083 // Default: CODEC_PRIORITY_DEFAULT
2084 optional int32 codec_priority = 3;
2085 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2086 // in BluetoothCodecConfig
2087 // Default: empty and SAMPLE_RATE_NONE for individual item
2088 optional int32 sample_rate = 4;
2089 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2090 // in BluetoothCodecConfig
2091 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2092 optional int32 bits_per_sample = 5;
2093 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2094 // BluetoothCodecConfig
2095 // Default: empty and CHANNEL_MODE_NONE for individual item
2096 optional int32 channel_mode = 6;
2097 // Codec specific values
2098 // Default 0
2099 optional int64 codec_specific_1 = 7;
2100 optional int64 codec_specific_2 = 8;
2101 optional int64 codec_specific_3 = 9;
2102 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002103 // An identifier that can be used to match events for this device.
2104 // The incremental identifier is locally generated and guaranteed not derived
2105 // from any globally unique hardware id.
2106 // For paired devices, it stays consistent between Bluetooth toggling for the
2107 // same remote device.
2108 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2109 // session for the same remote device.
2110 // Default: 0 if the device's metric id is unknown.
2111 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002112}
2113
2114/**
2115 * Logs when A2DP failed to read from PCM source.
2116 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2117 *
2118 * Logged from:
2119 * system/bt
2120 */
2121message BluetoothA2dpAudioUnderrunReported {
2122 // An identifier that can be used to match events for this device.
2123 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2124 // Salt: Randomly generated 256 bit value
2125 // Hash algorithm: HMAC-SHA256
2126 // Size: 32 byte
2127 // Default: null or empty if the device identifier is not known
2128 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2129 // Encoding interval in nanoseconds
2130 // Default: 0
2131 optional int64 encoding_interval_nanos = 2;
2132 // Number of bytes of PCM data that could not be read from the source
2133 // Default: 0
2134 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002135 // An identifier that can be used to match events for this device.
2136 // The incremental identifier is locally generated and guaranteed not derived
2137 // from any globally unique hardware id.
2138 // For paired devices, it stays consistent between Bluetooth toggling for the
2139 // same remote device.
2140 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2141 // session for the same remote device.
2142 // Default: 0 if the device's metric id is unknown.
2143 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002144}
2145
2146/**
2147 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2148 * buffer queue is full and we have to drop data
2149 *
2150 * Logged from:
2151 * system/bt
2152 */
2153message BluetoothA2dpAudioOverrunReported {
2154 // An identifier that can be used to match events for this device.
2155 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2156 // Salt: Randomly generated 256 bit value
2157 // Hash algorithm: HMAC-SHA256
2158 // Size: 32 byte
2159 // Default: null or empty if the device identifier is not known
2160 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2161 // Encoding interval in nanoseconds
2162 // Default: 0
2163 optional int64 encoding_interval_nanos = 2;
2164 // Number of buffers dropped in this event
2165 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2166 // Default: 0
2167 optional int32 num_dropped_buffers = 3;
2168 // Number of encoded buffers dropped in this event
2169 // Default 0
2170 optional int32 num_dropped_encoded_frames = 4;
2171 // Number of encoded bytes dropped in this event
2172 // Default: 0
2173 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002174 // An identifier that can be used to match events for this device.
2175 // The incremental identifier is locally generated and guaranteed not derived
2176 // from any globally unique hardware id.
2177 // For paired devices, it stays consistent between Bluetooth toggling for the
2178 // same remote device.
2179 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2180 // session for the same remote device.
2181 // Default: 0 if the device's metric id is unknown.
2182 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002183}
2184
2185/**
2186 * Logs when we receive reports regarding a device's RSSI value
2187 *
2188 * Logged from:
2189 * system/bt
2190 */
2191message BluetoothDeviceRssiReported {
2192 // An identifier that can be used to match events for this device.
2193 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2194 // Salt: Randomly generated 256 bit value
2195 // Hash algorithm: HMAC-SHA256
2196 // Size: 32 byte
2197 // Default: null or empty if the device identifier is not known
2198 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2199 // Connection handle of this connection if available
2200 // Range: 0x0000 - 0x0EFF (12 bits)
2201 // Default: 0xFFFF if the handle is unknown
2202 optional int32 connection_handle = 2;
2203 // HCI command status code if this is triggerred by hci_cmd
2204 // Default: STATUS_UNKNOWN
2205 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2206 // BR/EDR
2207 // Range: -128 ≤ N ≤ 127 (signed integer)
2208 // Units: dB
2209 // LE:
2210 // Range: -127 to 20, 127 (signed integer)
2211 // Units: dBm
2212 // Invalid when an out of range value is reported
2213 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002214 // An identifier that can be used to match events for this device.
2215 // The incremental identifier is locally generated and guaranteed not derived
2216 // from any globally unique hardware id.
2217 // For paired devices, it stays consistent between Bluetooth toggling for the
2218 // same remote device.
2219 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2220 // session for the same remote device.
2221 // Default: 0 if the device's metric id is unknown.
2222 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002223}
2224
2225/**
2226 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2227 *
2228 * Logged from:
2229 * system/bt
2230 */
2231message BluetoothDeviceFailedContactCounterReported {
2232 // An identifier that can be used to match events for this device.
2233 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2234 // Salt: Randomly generated 256 bit value
2235 // Hash algorithm: HMAC-SHA256
2236 // Size: 32 byte
2237 // Default: null or empty if the device identifier is not known
2238 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2239 // Connection handle of this connection if available
2240 // Range: 0x0000 - 0x0EFF (12 bits)
2241 // Default: 0xFFFF if the handle is unknown
2242 optional int32 connection_handle = 2;
2243 // HCI command status code if this is triggerred by hci_cmd
2244 // Default: STATUS_UNKNOWN
2245 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2246 // Number of consecutive failed contacts for a connection corresponding to the Handle
2247 // Range: uint16_t, 0-0xFFFF
2248 // Default: 0xFFFFF
2249 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002250 // An identifier that can be used to match events for this device.
2251 // The incremental identifier is locally generated and guaranteed not derived
2252 // from any globally unique hardware id.
2253 // For paired devices, it stays consistent between Bluetooth toggling for the
2254 // same remote device.
2255 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2256 // session for the same remote device.
2257 // Default: 0 if the device's metric id is unknown.
2258 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002259}
2260
2261/**
2262 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2263 *
2264 * Logged from:
2265 * system/bt
2266 */
2267message BluetoothDeviceTxPowerLevelReported {
2268 // An identifier that can be used to match events for this device.
2269 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2270 // Salt: Randomly generated 256 bit value
2271 // Hash algorithm: HMAC-SHA256
2272 // Size: 32 byte
2273 // Default: null or empty if the device identifier is not known
2274 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2275 // Connection handle of this connection if available
2276 // Range: 0x0000 - 0x0EFF (12 bits)
2277 // Default: 0xFFFF if the handle is unknown
2278 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002279 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002280 // Default: STATUS_UNKNOWN
2281 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2282 // Range: -30 ≤ N ≤ 20
2283 // Units: dBm
2284 // Invalid when an out of range value is reported
2285 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002286 // An identifier that can be used to match events for this device.
2287 // The incremental identifier is locally generated and guaranteed not derived
2288 // from any globally unique hardware id.
2289 // For paired devices, it stays consistent between Bluetooth toggling for the
2290 // same remote device.
2291 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2292 // session for the same remote device.
2293 // Default: 0 if the device's metric id is unknown.
2294 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002295}
Jack Heab86dbd22018-12-18 15:43:27 -08002296
Tej Singh5d991e12018-03-09 19:48:11 -08002297/**
Jack He1021a612019-01-20 21:22:46 -08002298 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2299 * receiving an HCI command from the host
2300 *
2301 * Logged from: system/bt
2302 */
2303message BluetoothHciTimeoutReported {
2304 // HCI command associated with this event
2305 // Default: CMD_UNKNOWN
2306 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2307}
2308
2309/**
2310 * Logs when we receive Bluetooth Link Quality Report event from the controller
2311 * See Android Bluetooth HCI specification for more details
2312 *
2313 * Note: all count and bytes field are counted since last event
2314 *
2315 * Logged from: system/bt
2316 */
2317message BluetoothQualityReportReported {
2318 // Quality report ID
2319 // Original type: uint8_t
2320 // Default: BQR_ID_UNKNOWN
2321 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2322 // Packet type of the connection
2323 // Original type: uint8_t
2324 // Default: BQR_PACKET_TYPE_UNKNOWN
2325 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2326 // Connection handle of the connection
2327 // Original type: uint16_t
2328 optional int32 connection_handle = 3;
2329 // Performing Role for the connection
2330 // Original type: uint8_t
2331 optional int32 connection_role = 4;
2332 // Current Transmit Power Level for the connection. This value is the same as the controller's
2333 // response to the HCI_Read_Transmit_Power_Level HCI command
2334 // Original type: uint8_t
2335 optional int32 tx_power_level = 5;
2336 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2337 // absolute receiver signal strength value
2338 // Original type: int8_t
2339 optional int32 rssi = 6;
2340 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2341 // channels used by the link currently
2342 // Original type: uint8_t
2343 optional int32 snr = 7;
2344 // Indicates the number of unused channels in AFH_channel_map
2345 // Original type: uint8_t
2346 optional int32 unused_afh_channel_count = 8;
2347 // Indicates the number of the channels which are interfered and quality is bad but are still
2348 // selected for AFH
2349 // Original type: uint8_t
2350 optional int32 afh_select_unideal_channel_count = 9;
2351 // Current Link Supervision Timeout Setting
2352 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2353 // Original type: uint16_t
2354 optional int32 lsto = 10;
2355 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2356 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2357 // 0x01 (Piconet Clock)
2358 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2359 // Original type: uint32_t
2360 optional int64 connection_piconet_clock = 11;
2361 // The count of retransmission
2362 // Original type: uint32_t
2363 optional int64 retransmission_count = 12;
2364 // The count of no RX
2365 // Original type: uint32_t
2366 optional int64 no_rx_count = 13;
2367 // The count of NAK (Negative Acknowledge)
2368 // Original type: uint32_t
2369 optional int64 nak_count = 14;
2370 // Controller timestamp of last TX ACK
2371 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2372 // Original type: uint32_t
2373 optional int64 last_tx_ack_timestamp = 15;
2374 // The count of Flow-off (STOP)
2375 // Original type: uint32_t
2376 optional int64 flow_off_count = 16;
2377 // Controller timestamp of last Flow-on (GO)
2378 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2379 // Original type: uint32_t
2380 optional int64 last_flow_on_timestamp = 17;
2381 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2382 // Original type: uint32_t
2383 optional int64 buffer_overflow_bytes = 18;
2384 // Buffer underflow count (in byte) since last event
2385 // Original type: uint32_t
2386 optional int64 buffer_underflow_bytes = 19;
2387}
2388
2389/**
2390 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2391 *
2392 * Notes:
2393 * - Each event can be partially filled as we might learn different pieces of device
2394 * information at different time
2395 * - Multiple device info events can be combined to give more complete picture
2396 * - When multiple device info events tries to describe the same information, the
2397 * later one wins
2398 *
2399 * Logged from:
2400 * packages/apps/Bluetooth
2401 */
Jack Heaea26982019-04-04 11:19:48 -07002402message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002403 // An identifier that can be used to match events for this device.
2404 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2405 // Salt: Randomly generated 256 bit value
2406 // Hash algorithm: HMAC-SHA256
2407 // Size: 32 byte
2408 // Default: null or empty if the device identifier is not known
2409 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2410 // Where is this device info obtained from
2411 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2412 // Name of the data source
2413 // For EXTERNAL: package name of the data source
2414 // For INTERNAL: null for general case, component name otherwise
2415 optional string source_name = 3;
2416 // Name of the manufacturer of this device
2417 optional string manufacturer = 4;
2418 // Model of this device
2419 optional string model = 5;
2420 // Hardware version of this device
2421 optional string hardware_version = 6;
2422 // Software version of this device
2423 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002424 // An identifier that can be used to match events for this device.
2425 // The incremental identifier is locally generated and guaranteed not derived
2426 // from any globally unique hardware id.
2427 // For paired devices, it stays consistent between Bluetooth toggling for the
2428 // same remote device.
2429 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2430 // session for the same remote device.
2431 // Default: 0 if the device's metric id is unknown.
2432 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002433}
2434
2435/**
2436 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2437 * device, as documented by the Bluetooth Core HCI specification
2438 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2439 * Vol 2, Part E, Page 1118
2440 *
2441 * Logged from:
2442 * system/bt
2443 */
2444message BluetoothRemoteVersionInfoReported {
2445 // Connection handle of the connection
2446 // Original type: uint16_t
2447 optional int32 connection_handle = 1;
2448 // HCI command status code
2449 // Default: STATUS_UNKNOWN
2450 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2451 // 1 byte Version of current LMP in the remote controller
2452 optional int32 lmp_version = 3;
2453 // 2 bytes LMP manufacturer code of the remote controller
2454 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2455 optional int32 lmp_manufacturer_code = 4;
2456 // 4 bytes subversion of the LMP in the remote controller
2457 optional int32 lmp_subversion = 5;
2458}
2459
2460/**
2461 * Logs when certain Bluetooth SDP attributes are discovered
2462 * Constant definitions are from:
2463 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2464 *
2465 * Current logged attributes:
2466 * - BluetoothProfileDescriptorList
2467 * - Supported Features Bitmask
2468 *
2469 * Logged from:
2470 * system/bt
2471 */
2472message BluetoothSdpAttributeReported {
2473 // An identifier that can be used to match events for this device.
2474 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2475 // Salt: Randomly generated 256 bit value
2476 // Hash algorithm: HMAC-SHA256
2477 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2478 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2479 // Original type: uint16_t
2480 optional int32 protocol_uuid = 2;
2481 // Short form UUIDs used to identify Bluetooth SDP attribute types
2482 // Original type: uint16_t
2483 optional int32 attribute_id = 3;
2484 // Attribute value for the particular attribute
2485 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002486 // An identifier that can be used to match events for this device.
2487 // The incremental identifier is locally generated and guaranteed not derived
2488 // from any globally unique hardware id.
2489 // For paired devices, it stays consistent between Bluetooth toggling for the
2490 // same remote device.
2491 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2492 // session for the same remote device.
2493 // Default: 0 if the device's metric id is unknown.
2494 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002495}
2496
2497/**
2498 * Logs when bond state of a Bluetooth device changes
2499 *
2500 * Logged from:
2501 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2502 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2503 */
2504message BluetoothBondStateChanged {
2505 // An identifier that can be used to match events for this device.
2506 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2507 // Salt: Randomly generated 256 bit value
2508 // Hash algorithm: HMAC-SHA256
2509 // Size: 32 byte
2510 // Default: null or empty if the device identifier is not known
2511 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2512 // Preferred transport type to remote dual mode device
2513 // Default: TRANSPORT_AUTO means no preference
2514 optional android.bluetooth.TransportTypeEnum transport = 2;
2515 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2516 // Default: UNKNOWN
2517 optional android.bluetooth.DeviceTypeEnum type = 3;
2518 // Current bond state (NONE, BONDING, BONDED)
2519 // Default: BOND_STATE_UNKNOWN
2520 optional android.bluetooth.BondStateEnum bond_state = 4;
2521 // Bonding sub state
2522 // Default: BOND_SUB_STATE_UNKNOWN
2523 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2524 // Unbond Reason
2525 // Default: UNBOND_REASON_UNKNOWN
2526 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002527 // An identifier that can be used to match events for this device.
2528 // The incremental identifier is locally generated and guaranteed not derived
2529 // from any globally unique hardware id.
2530 // For paired devices, it stays consistent between Bluetooth toggling for the
2531 // same remote device.
2532 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2533 // session for the same remote device.
2534 // Default: 0 if the device's metric id is unknown.
2535 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002536}
2537
2538/**
2539 * Logs there is an event related Bluetooth classic pairing
2540 *
2541 * Logged from:
2542 * system/bt
2543 */
2544message BluetoothClassicPairingEventReported {
2545 // An identifier that can be used to match events for this device.
2546 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2547 // Salt: Randomly generated 256 bit value
2548 // Hash algorithm: HMAC-SHA256
2549 // Size: 32 byte
2550 // Default: null or empty if the device identifier is not known
2551 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2552 // Connection handle of this connection if available
2553 // Range: 0x0000 - 0x0EFF (12 bits)
2554 // Default: 0xFFFF if the handle is unknown
2555 optional int32 connection_handle = 2;
2556 // HCI command associated with this event
2557 // Default: CMD_UNKNOWN
2558 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2559 // HCI event associated with this event
2560 // Default: EVT_UNKNOWN
2561 optional android.bluetooth.hci.EventEnum hci_event = 4;
2562 // HCI command status code if this is triggerred by hci_cmd
2563 // Default: STATUS_UNKNOWN
2564 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2565 // HCI reason code associated with this event
2566 // Default: STATUS_UNKNOWN
2567 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002568 // A status value related to this specific event
2569 // Default: 0
2570 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002571 // An identifier that can be used to match events for this device.
2572 // The incremental identifier is locally generated and guaranteed not derived
2573 // from any globally unique hardware id.
2574 // For paired devices, it stays consistent between Bluetooth toggling for the
2575 // same remote device.
2576 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2577 // session for the same remote device.
2578 // Default: 0 if the device's metric id is unknown.
2579 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002580}
2581
2582/**
2583 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2584 *
2585 * Logged from:
2586 * system/bt
2587 */
2588message BluetoothSmpPairingEventReported {
2589 // An identifier that can be used to match events for this device.
2590 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2591 // Salt: Randomly generated 256 bit value
2592 // Hash algorithm: HMAC-SHA256
2593 // Size: 32 byte
2594 // Default: null or empty if the device identifier is not known
2595 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2596 // SMP command sent or received over L2CAP
2597 // Default: CMD_UNKNOWN
2598 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2599 // Whether this command is sent or received
2600 // Default: DIRECTION_UNKNOWN
2601 optional android.bluetooth.DirectionEnum direction = 3;
2602 // SMP failure reason code
2603 // Default: PAIRING_FAIL_REASON_DEFAULT
2604 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002605 // An identifier that can be used to match events for this device.
2606 // The incremental identifier is locally generated and guaranteed not derived
2607 // from any globally unique hardware id.
2608 // For paired devices, it stays consistent between Bluetooth toggling for the
2609 // same remote device.
2610 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2611 // session for the same remote device.
2612 // Default: 0 if the device's metric id is unknown.
2613 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002614}
2615
2616/**
Jack He815cdba2019-01-30 17:24:55 -08002617 * Logs when a Bluetooth socket’s connection state changed
2618 *
2619 * Logged from:
2620 * system/bt
2621 */
2622message BluetoothSocketConnectionStateChanged {
2623 // An identifier that can be used to match events for this device.
2624 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2625 // Salt: Randomly generated 256 bit value
2626 // Hash algorithm: HMAC-SHA256
2627 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002628 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002629 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002630 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002631 // Default 0 when unknown or don't care
2632 optional int32 port = 2;
2633 // Socket type as mentioned in
2634 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2635 // Default: SOCKET_TYPE_UNKNOWN
2636 optional android.bluetooth.SocketTypeEnum type = 3;
2637 // Socket connection state
2638 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2639 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2640 // Number of bytes sent to remote device during this connection
2641 optional int64 tx_bytes = 5;
2642 // Number of bytes received from remote device during this connection
2643 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002644 // Socket owner's UID
2645 optional int32 uid = 7 [(is_uid) = true];
2646 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2647 // |port| must be spawned by |server_port|
2648 // Default 0 when unknown or don't care
2649 optional int32 server_port = 8;
2650 // Whether this is a server listener socket
2651 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002652 // An identifier that can be used to match events for this device.
2653 // The incremental identifier is locally generated and guaranteed not derived
2654 // from any globally unique hardware id.
2655 // For paired devices, it stays consistent between Bluetooth toggling for the
2656 // same remote device.
2657 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2658 // session for the same remote device.
2659 // Default: 0 if the device's metric id is unknown.
2660 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002661}
2662
2663/**
Jack He71426802019-04-02 13:32:52 -07002664 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2665 *
2666 * Logged from:
2667 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2668 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2669 *
2670 */
2671message BluetoothClassOfDeviceReported {
2672 // An identifier that can be used to match events for this device.
2673 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2674 // Salt: Randomly generated 256 bit value
2675 // Hash algorithm: HMAC-SHA256
2676 // Size: 32 byte
2677 // Default: null or empty if this is a server listener socket
2678 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2679 // Class of Device (CoD) value including both Major, Minor device class and service class
2680 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2681 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2682 // Default: 0
2683 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002684 // An identifier that can be used to match events for this device.
2685 // The incremental identifier is locally generated and guaranteed not derived
2686 // from any globally unique hardware id.
2687 // For paired devices, it stays consistent between Bluetooth toggling for the
2688 // same remote device.
2689 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2690 // session for the same remote device.
2691 // Default: 0 if the device's metric id is unknown.
2692 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002693}
2694
2695/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002696 * Logs when something is plugged into or removed from the USB-C connector.
2697 *
2698 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002699 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002700 */
2701message UsbConnectorStateChanged {
2702 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002703 STATE_DISCONNECTED = 0;
2704 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002705 }
2706 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002707 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002708 // Last active session in ms.
2709 // 0 when the port is in connected state.
2710 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002711}
2712
2713/**
2714 * Logs the reported speaker impedance.
2715 *
2716 * Logged from:
2717 * Vendor audio implementation.
2718 */
2719message SpeakerImpedanceReported {
2720 optional int32 speaker_location = 1;
2721 optional int32 impedance = 2;
2722}
2723
2724/**
2725 * Logs the report of a failed hardware.
2726 *
2727 * Logged from:
2728 * Vendor HALs.
2729 *
2730 */
2731message HardwareFailed {
2732 enum HardwareType {
2733 HARDWARE_FAILED_UNKNOWN = 0;
2734 HARDWARE_FAILED_MICROPHONE = 1;
2735 HARDWARE_FAILED_CODEC = 2;
2736 HARDWARE_FAILED_SPEAKER = 3;
2737 HARDWARE_FAILED_FINGERPRINT = 4;
2738 }
2739 optional HardwareType hardware_type = 1;
2740
Maggie White6dcd8572019-01-31 14:11:50 -08002741 /**
2742 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002743 * the same hardware_type. The specific locations are vendor defined integers,
2744 * referring to board-specific numbering schemes.
2745 */
2746 optional int32 hardware_location = 2;
2747
Maggie White6dcd8572019-01-31 14:11:50 -08002748 /**
2749 * failure_code is specific to the HardwareType of the failed hardware.
2750 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002751 */
Maggie White6dcd8572019-01-31 14:11:50 -08002752 enum HardwareErrorCode {
2753 UNKNOWN = 0;
2754 COMPLETE = 1;
2755 SPEAKER_HIGH_Z = 2;
2756 SPEAKER_SHORT = 3;
2757 FINGERPRINT_SENSOR_BROKEN = 4;
2758 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002759 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002760 }
2761 optional int32 failure_code = 3;
2762}
2763
2764/**
2765 * Log an event when the device has been physically dropped.
2766 * Reported from the /vendor partition.
2767 */
2768message PhysicalDropDetected {
2769 // Confidence that the event was actually a drop, 0 -> 100
2770 optional int32 confidence_pctg = 1;
2771 // Peak acceleration of the drop, in 1/1000s of a g.
2772 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002773 // Duration of freefall in ms
2774 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002775}
2776
2777/**
2778 * Log bucketed battery charge cycles.
2779 *
2780 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002781 * a given charge point. For example, if 10 cycle buckets are
2782 * initialized, bucket 1 is the lowest 1/10th of the battery,
2783 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002784 *
2785 * Logged from:
2786 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2787 */
2788message ChargeCyclesReported {
2789 optional int32 cycle_bucket_1 = 1;
2790 optional int32 cycle_bucket_2 = 2;
2791 optional int32 cycle_bucket_3 = 3;
2792 optional int32 cycle_bucket_4 = 4;
2793 optional int32 cycle_bucket_5 = 5;
2794 optional int32 cycle_bucket_6 = 6;
2795 optional int32 cycle_bucket_7 = 7;
2796 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002797 optional int32 cycle_bucket_9 = 9;
2798 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002799}
2800
2801/**
Howard Roa46b6582018-09-18 16:45:02 -07002802 * Log battery health snapshot.
2803 *
2804 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2805 * are snapshotted periodically over 24hrs.
2806 */
2807message BatteryHealthSnapshot {
2808 enum BatterySnapshotType {
2809 UNKNOWN = 0;
2810 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2811 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2812 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2813 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2814 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2815 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2816 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2817 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2818 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2819 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2820 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2821 }
2822 optional BatterySnapshotType type = 1;
2823 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002824 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002825 // Voltage Battery Voltage, in microVolts.
2826 optional int32 voltage_micro_volt = 3;
2827 // Current Battery current, in microAmps.
2828 optional int32 current_micro_amps = 4;
2829 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2830 optional int32 open_circuit_micro_volt = 5;
2831 // Resistance Battery Resistance, in microOhms.
2832 optional int32 resistance_micro_ohm = 6;
2833 // Level Battery Level, as % of full.
2834 optional int32 level_percent = 7;
2835}
2836
2837/**
2838 * Log slow I/O operations on the primary storage.
2839 */
2840message SlowIo {
2841 // Classifications of IO Operations.
2842 enum IoOperation {
2843 UNKNOWN = 0;
2844 READ = 1;
2845 WRITE = 2;
2846 UNMAP = 3;
2847 SYNC = 4;
2848 }
2849 optional IoOperation operation = 1;
2850
2851 // The number of slow IO operations of this type over 24 hours.
2852 optional int32 count = 2;
2853}
2854
2855/**
2856 * Log battery caused shutdown with the last recorded voltage.
2857 */
2858message BatteryCausedShutdown {
2859 // The last recorded battery voltage prior to shutdown.
2860 optional int32 last_recorded_micro_volt = 1;
2861}
2862
2863/**
Tej Singha72344992019-04-17 18:55:08 -07002864 * Logs when ThermalService receives throttling events.
2865 *
2866 * Logged from:
2867 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2868 */
2869message ThermalThrottlingSeverityStateChanged {
2870 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2871 optional android.os.TemperatureTypeEnum sensor_type = 1;
2872
2873 // The name of the temperature source. Eg. CPU0
2874 optional string sensor_name = 2;
2875
2876 // Temperature in tenths of a degree C.
2877 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2878 optional int32 temperature_deci_celsius = 3;
2879
2880 // Relative severity of the throttling, see enum definition.
2881 optional android.os.ThrottlingSeverityEnum severity = 4;
2882}
2883
2884/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002885 * Logs the duration of a davey (jank of >=700ms) when it occurs
2886 *
2887 * Logged from:
2888 * frameworks/base/libs/hwui/JankTracker.cpp
2889 */
2890message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002891 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002892 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002893
Tej Singhbb8554a2018-01-26 11:59:14 -08002894 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002895 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002896}
2897
2898/**
Bookatze5885242017-10-24 20:10:31 -07002899 * Logs phone signal strength changes.
2900 *
2901 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002902 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002903 */
2904message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002905 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2906 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002907}
2908
Yangster4ccebea2018-10-09 17:09:02 -07002909
2910/**
2911 * Logs when the phone state, sim state or signal strength changes
2912 *
2913 * Logged from:
2914 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2915 */
2916message PhoneServiceStateChanged {
2917 optional android.telephony.ServiceStateEnum state = 1;
2918 optional android.telephony.SimStateEnum sim_state = 2;
2919 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2920}
2921
2922/**
2923 * Logs when the phone becomes on or off.
2924 *
2925 * Logged from:
2926 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2927 */
2928message PhoneStateChanged {
2929 enum State {
2930 OFF = 0;
2931 ON = 1;
2932 }
2933 optional State state = 1;
2934}
2935
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002936message BackGesture {
2937 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002938 DEFAULT_BACK_TYPE = 0;
2939 COMPLETED = 1;
2940 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2941 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2942 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
2943 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
2944 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
2945 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
2946 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002947 }
2948 optional BackType type = 1;
2949
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002950 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
2951 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
2952 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
2953 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
2954 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
2955 optional int32 left_boundary = 8; // left edge width + left inset
2956 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
2957
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002958 enum WindowHorizontalLocation {
2959 DEFAULT_LOCATION = 0;
2960 LEFT = 1;
2961 RIGHT = 2;
2962 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002963 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002964}
2965
2966message ExclusionRectStateChanged {
2967 optional string component_name = 1; // if not available, simply packageName
2968 optional int32 requested_height = 2; // px
2969 optional int32 rejected_height = 3; // px
2970
2971 enum WindowHorizontalLocation {
2972 DEFAULT_LOCATION = 0;
2973 LEFT = 1;
2974 RIGHT = 2;
2975 }
2976 optional WindowHorizontalLocation x_location = 4;
2977 optional bool landscape = 5;
2978 optional bool splitscreen = 6;
2979 optional int32 duration_millis = 7;
2980}
2981
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002982message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002983 optional android.stats.launcher.LauncherAction action = 1;
2984 optional android.stats.launcher.LauncherState src_state = 2;
2985 optional android.stats.launcher.LauncherState dst_state = 3;
2986 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002987 optional bool is_swipe_up_enabled = 5;
2988}
2989
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002990message StyleUIChanged {
2991 optional android.stats.style.Action action = 1;
2992 optional int32 color_package_hash = 2;
2993 optional int32 font_package_hash = 3;
2994 optional int32 shape_package_hash = 4;
2995 optional int32 clock_package_hash = 5;
2996 optional int32 launcher_grid = 6;
2997 optional int32 wallpaper_category_hash = 7;
2998 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002999 optional int32 color_preference = 9;
3000 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003001}
3002
David Chenc28b2bb2017-10-24 12:52:52 -07003003/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003004 * Logs when Settings UI has changed.
3005 *
3006 * Logged from:
3007 * packages/apps/Settings
3008 */
3009message SettingsUIChanged {
3010 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003011 * Where this SettingsUIChange event comes from. For example, if
3012 * it's a PAGE_VISIBLE event, where the page is opened from.
3013 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003014 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003015
3016 /**
3017 * What the UI action is.
3018 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003019 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003020
3021 /**
3022 * Where the action is happening
3023 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003024 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003025
3026 /**
3027 * What preference changed in this event.
3028 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003029 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003030
3031 /**
3032 * The new value of the changed preference.
3033 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003034 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003035}
3036
3037/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003038 * Logs basic timing information about touch events.
3039 * Reported at most every 5 minutes while device is being interacted with.
3040 *
3041 * Logged from:
3042 * frameworks/native/services/inputflinger
3043 */
3044message TouchEventReported {
3045 /**
3046 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003047 * and the standard deviation of the time spent processing touchscreen events
3048 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003049 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003050 * On supported devices, the starting point is taken during the hard interrupt inside the
3051 * kernel touch driver. On all other devices, the starting point is taken inside
3052 * the kernel's input event subsystem upon receipt of the input event.
3053 * The ending point is taken inside InputDispatcher, just after the input event
3054 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003055 */
3056 // Minimum value
3057 optional float latency_min_micros = 1;
3058 // Maximum value
3059 optional float latency_max_micros = 2;
3060 // Average value
3061 optional float latency_mean_micros = 3;
3062 // Standard deviation
3063 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003064 // Number of touch events (input_event) in this report
3065 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003066}
3067
3068/**
Philip Quinn0eded622019-01-29 12:46:28 -08003069 * Logs gesture classification and timing information for touch events.
3070 *
3071 * Logged from:
3072 * frameworks/base/core/java/android/view/GestureDetector.java
3073 * frameworks/base/core/java/android/view/View.java
3074 */
3075message TouchGestureClassified {
3076 // The source of the classification (e.g. Java class name).
3077 optional string source = 1;
3078
3079 enum Classification {
3080 UNKNOWN_CLASSIFICATION = 0;
3081 SINGLE_TAP = 1;
3082 DOUBLE_TAP = 2;
3083 LONG_PRESS = 3;
3084 DEEP_PRESS = 4;
3085 SCROLL = 5;
3086 }
3087 // The classification of the gesture.
3088 optional Classification classification = 2;
3089
3090 // The interval from the start of a touch event stream until the
3091 // classification was made.
3092 optional int32 latency_millis = 3;
3093
3094 // The distance from the location of the first touch event to the
3095 // location of the touch event when the classification was made.
3096 optional float displacement_px = 4;
3097}
3098
3099/**
David Chenc28b2bb2017-10-24 12:52:52 -07003100 * Logs that a setting was updated.
3101 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003102 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003103 * The tag and is_default allow resetting of settings to default values based on the specified
3104 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3105 */
3106message SettingChanged {
3107 // The name of the setting.
3108 optional string setting = 1;
3109
3110 // The change being imposed on this setting. May represent a number, eg "3".
3111 optional string value = 2;
3112
3113 // The new value of this setting. For most settings, this is same as value. For some settings,
3114 // value is +X or -X where X represents an element in a set. For example, if the previous value
3115 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3116 // The +/- feature is currently only used for location_providers_allowed.
3117 optional string new_value = 3;
3118
3119 // The previous value of this setting.
3120 optional string prev_value = 4;
3121
3122 // The tag used with the is_default for resetting sets of settings. This is generally null.
3123 optional string tag = 5;
3124
Bookatz90867622018-01-31 15:05:57 -08003125 // True if this setting with tag should be resettable.
3126 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003127
David Chenbd789912018-03-16 17:19:55 -07003128 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003129 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003130
3131 enum ChangeReason {
3132 UPDATED = 1; // Updated can be an insertion or an update.
3133 DELETED = 2;
3134 }
3135 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003136}
Chenjie Yub3dda412017-10-24 13:41:59 -07003137
Chenjie Yu05013b32017-11-21 10:21:41 -08003138/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003139 * Logs activity going to foreground or background
3140 *
3141 * Logged from:
3142 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3143 */
3144message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003145 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003146 optional string pkg_name = 2;
3147 optional string class_name = 3;
3148
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003149 enum State {
3150 BACKGROUND = 0;
3151 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003152 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003153 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003154}
David Chenc8a43242017-10-17 16:23:28 -07003155
3156/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003157 * Logs when a volume entered low Storage state.
3158 * Logged from:
3159 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3160 */
3161message LowStorageStateChanged {
3162 // Volume that ran out of storage.
3163 optional string volume_description = 1;
3164
3165 enum State {
3166 UNKNOWN = 0;
3167 OFF = 1;
3168 ON = 2;
3169 }
3170 optional State state = 2;
3171}
3172
3173/**
3174 * Logs when an app is downgraded.
3175 * Logged from:
3176 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3177 */
3178message AppDowngraded {
3179 optional string package_name = 1;
3180 // Size of the package (all data) before being downgraded.
3181 optional int64 size_in_bytes_before = 2;
3182 // Size of the package (all data) after being downgraded.
3183 optional int64 size_in_bytes_after = 3;
3184
3185 optional bool aggressive = 4;
3186}
3187
3188/**
3189 * Logs when an app is optimized after being downgraded.
3190 * Logged from:
3191 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3192 */
3193message AppOptimizedAfterDowngraded {
3194 optional string package_name = 1;
3195}
3196
3197/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003198 * Logs whenever an app is installed on external storage.
3199 * Logged from:
3200 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3201 */
3202message AppInstallOnExternalStorageReported {
3203 // The type of external storage.
3204 optional android.stats.storage.ExternalStorageType storage_type = 1;
3205 // The name of the package that is installed on the sd card.
3206 optional string package_name = 2;
3207}
3208
3209/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003210 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003211 * Logged from:
3212 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3213 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003214message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003215 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003216
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003217 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003218
3219 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003220 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003221 optional string process_name = 3;
3222
3223 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003224 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003225
3226 optional string package_name = 5;
3227
3228 enum InstantApp {
3229 UNAVAILABLE = 0;
3230 FALSE = 1;
3231 TRUE = 2;
3232 }
3233 optional InstantApp is_instant_app = 6;
3234
3235 enum ForegroundState {
3236 UNKNOWN = 0;
3237 BACKGROUND = 1;
3238 FOREGROUND = 2;
3239 }
3240 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003241
3242 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003243}
David Chen9e3808c2017-11-20 17:25:34 -08003244
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003245/**
3246 * Logs when a WTF (What a Terrible Failure) happened.
3247 * Logged from:
3248 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3249 */
3250message WTFOccurred {
3251 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003252
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003253 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003254
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003255 // The name of the process.
3256 // system_server if it is not by an app
3257 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003258
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003259 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003260 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003261
3262 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003263}
3264
3265/**
3266 * Logs when system server reports low memory.
3267 * Logged from:
3268 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3269 */
3270message LowMemReported {
3271}
3272
3273/**
3274 * Logs when an app ANR (App Not Responding) occurs.
3275 * Logged from:
3276 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3277 */
3278message ANROccurred {
3279 optional int32 uid = 1 [(is_uid) = true];
3280
3281 optional string process_name = 2;
3282
3283 optional string short_component_name = 3;
3284
3285 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003286
3287 enum InstantApp {
3288 UNAVAILABLE = 0;
3289 FALSE = 1;
3290 TRUE = 2;
3291 }
3292 optional InstantApp is_instant_app = 5;
3293
3294 enum ForegroundState {
3295 UNKNOWN = 0;
3296 BACKGROUND = 1;
3297 FOREGROUND = 2;
3298 }
3299 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003300
3301 optional android.server.ErrorSource error_source = 7;
3302
3303 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003304}
3305
Bookatza7020bd2018-08-28 16:29:35 -07003306/**
3307 * Logs when the vibrator state changes.
3308 * Logged from:
3309 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3310 */
3311message VibratorStateChanged {
3312 repeated AttributionNode attribution_node = 1;
3313
3314 enum State {
3315 OFF = 0;
3316 ON = 1;
3317 }
3318 optional State state = 2;
3319
3320 // Duration (in milliseconds) requested to keep the vibrator on.
3321 // Only applicable for State == ON.
3322 optional int64 duration_millis = 3;
3323}
3324
David Chen0a368b22017-12-06 16:28:16 -08003325/*
3326 * Allows other apps to push events into statsd.
3327 * Logged from:
3328 * frameworks/base/core/java/android/util/StatsLog.java
3329 */
David Chen0b5c90c2018-01-25 16:51:49 -08003330message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003331 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003332 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003333
3334 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3335 optional int32 label = 2;
3336
3337 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3338 // predicates for the metrics).
3339 enum State {
3340 UNKNOWN = 0;
3341 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3342 STOP = 2;
3343 START = 3;
3344 }
3345 optional State state = 3;
3346}
3347
David Chen9e3808c2017-11-20 17:25:34 -08003348/**
Bookatz7948c872018-09-04 12:58:33 -07003349 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3350 * For example, this could be due to the user manually changing the time.
3351 *
3352 * Logged from:
3353 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3354 */
3355message WallClockTimeShifted {
3356 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3357 optional int64 wall_clock_timestamp_millis = 1;
3358}
3359
3360/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003361 * Logs when statsd detects an anomaly.
3362 *
3363 * Logged from:
3364 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3365 */
3366message AnomalyDetected {
3367 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003368 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003369
Yangster-mac94e197c2018-01-02 16:03:03 -08003370 // Id of the config whose anomaly detection alert fired.
3371 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003372
Yangster-mac94e197c2018-01-02 16:03:03 -08003373 // Id of the alert (i.e. name of the anomaly that was detected).
3374 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003375}
3376
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003377message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003378 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003379 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003380
3381 // The app package name.
3382 optional string pkg_name = 2;
3383
3384 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003385 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003386 WARM = 1;
3387 HOT = 2;
3388 COLD = 3;
3389 }
3390 // The transition type.
3391 optional TransitionType type = 3;
3392
3393 // The activity name.
3394 optional string activity_name = 4;
3395
3396 // The name of the calling app. Empty if not set.
3397 optional string calling_pkg_name = 5;
3398
3399 // Whether the app is an instant app.
3400 optional bool is_instant_app = 6;
3401
3402 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003403 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003404
Bookatz80d11a02018-01-16 10:46:35 -08003405 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003406
David Chen0b5c90c2018-01-25 16:51:49 -08003407 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003408 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003409 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003410 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003411 optional int32 bind_application_delay_millis = 11;
3412 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003413
3414 // Empty if not set.
3415 optional string launch_token = 13;
3416
Calin Juravle759fbda2018-02-20 19:52:30 +00003417 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003418 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003419
3420 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003421 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003422}
3423
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003424message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003425 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003426 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003427
3428 // The app package name.
3429 optional string pkg_name = 2;
3430
3431 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003432 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003433 WARM = 1;
3434 HOT = 2;
3435 COLD = 3;
3436 }
3437 // The transition type.
3438 optional TransitionType type = 3;
3439
3440 // The activity name.
3441 optional string activity_name = 4;
3442}
3443
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003444message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003445 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003446 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003447
3448 // The app package name.
3449 optional string pkg_name = 2;
3450
3451 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003452 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003453 WITH_BUNDLE = 1;
3454 WITHOUT_BUNDLE = 2;
3455 }
3456 // The transition type.
3457 optional TransitionType type = 3;
3458
3459 // The activity name.
3460 optional string activity_name = 4;
3461
3462 optional bool transition_process_running = 5;
3463
3464 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003465 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003466}
3467
Bookatz8fcd09a2017-12-18 13:01:10 -08003468/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003469 * Logs a picture-in-picture action
3470 * Logged from:
3471 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3472 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3473 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3474 */
3475message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003476 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003477 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003478
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003479 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003480
Chenjie Yu52cacc62017-12-08 18:11:45 -08003481 enum State {
3482 ENTERED = 1;
3483 EXPANDED_TO_FULL_SCREEN = 2;
3484 MINIMIZED = 3;
3485 DISMISSED = 4;
3486 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003487 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003488}
3489
3490/**
Chenjie Yue8904192017-12-08 19:12:57 -08003491 * Logs overlay action
3492 * Logged from:
3493 * services/core/java/com/android/server/wm/Session.java
3494 */
3495message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003496 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003497
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003498 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003499
3500 optional bool using_alert_window = 3;
3501
3502 enum State {
3503 ENTERED = 1;
3504 EXITED = 2;
3505 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003506 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003507 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08003508 (state_field_option).nested = false,
3509 (state_field_option).default_state_value = 2
3510 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003511}
3512
Adam Bookatz38767932020-02-05 12:13:40 -08003513/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003514 * Logs foreground service starts and stops.
3515 * Note that this is not when a service starts or stops, but when it is
3516 * considered foreground.
3517 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003518 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003519 */
3520message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003521 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003522 // package_name + "/" + class_name
3523 optional string short_name = 2;
3524
3525 enum State {
3526 ENTER = 1;
3527 EXIT = 2;
3528 }
3529 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003530
3531 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3532 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3533 optional bool allow_while_in_use_permission = 4;
3534}
3535
3536/**
3537 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3538 * A foreground service session is any continuous period during which the uid holds at least one
3539 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3540 * Accesses initiated while the uid is in the TOP state are ignored.
3541 * Sessions with no attempted accesses are not logged.
3542 * Logged from
3543 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3544 */
3545message ForegroundServiceAppOpSessionEnded {
3546 optional int32 uid = 1 [(is_uid) = true];
3547
3548 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003549 // Only following four ops are logged
3550 // COARSE_LOCATION = 0
3551 // FINE_LOCATION = 1
3552 // CAMERA = 26
3553 // RECORD_AUDIO = 27
3554 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003555
3556 // The uid's permission mode for accessing the AppOp during this fgs session.
3557 enum Mode {
3558 MODE_UNKNOWN = 0;
3559 MODE_ALLOWED = 1; // Always allowed
3560 MODE_IGNORED = 2; // Denied
3561 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3562 }
3563 optional Mode app_op_mode = 3;
3564
3565 // Number of times this AppOp was requested and allowed.
3566 optional int32 count_ops_accepted = 4;
3567 // Number of times this AppOp was requested but denied.
3568 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003569}
3570
Chenjie Yue8904192017-12-08 19:12:57 -08003571/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003572 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3573 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3574 * attributed back to the parent (host) uid. One example is Chrome.
3575 *
3576 * Logged from:
3577 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3578 */
3579message IsolatedUidChanged {
3580 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003581 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003582 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003583 optional int32 parent_uid = 1;
3584
3585 optional int32 isolated_uid = 2;
3586
3587 // We expect an isolated uid to be removed before if it's used for another parent uid.
3588 enum Event {
3589 REMOVED = 0;
3590 CREATED = 1;
3591 }
3592 optional Event event = 3;
3593}
3594
3595/*
3596 * Logs the reception of an incoming network packet causing the main system to wake up for
3597 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3598 * and processed by WakeupController.cpp.
3599 */
3600message PacketWakeupOccurred {
3601 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3602 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003603 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003604 // The interface name on which the packet was received.
3605 optional string iface = 2;
3606 // The ethertype value of the packet.
3607 optional int32 ethertype = 3;
3608 // String representation of the destination MAC address of the packet.
3609 optional string destination_hardware_address = 4;
3610 // String representation of the source address of the packet if this was an IP packet.
3611 optional string source_ip = 5;
3612 // String representation of the destination address of the packet if this was an IP packet.
3613 optional string destination_ip = 6;
3614 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3615 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3616 // families.
3617 optional int32 ip_next_header = 7;
3618 // The source port if this was a TCP or UDP packet.
3619 optional int32 source_port = 8;
3620 // The destination port if this was a TCP or UDP packet.
3621 optional int32 destination_port = 9;
3622}
3623
3624/*
3625 * Logs the memory stats for an app on startup.
3626 * Logged from:
3627 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3628 */
3629message AppStartMemoryStateCaptured {
3630 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003631 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003632
3633 // The process name.
3634 optional string process_name = 2;
3635
3636 // The activity name.
3637 optional string activity_name = 3;
3638
3639 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003640 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003641
3642 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003643 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003644
3645 // RSS
3646 optional int64 rss_in_bytes = 6;
3647
3648 // CACHE
3649 optional int64 cache_in_bytes = 7;
3650
3651 // SWAP
3652 optional int64 swap_in_bytes = 8;
3653}
3654
3655/*
3656 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3657 * for LMK event.
3658 * Logged from:
3659 * system/core/lmkd/lmkd.c
3660 */
3661message LmkStateChanged {
3662 enum State {
3663 UNKNOWN = 0;
3664 START = 1;
3665 STOP = 2;
3666 }
3667 optional State state = 1;
3668}
3669
3670/*
3671 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3672 * Logged from:
3673 * system/core/lmkd/lmkd.c
3674 */
3675message LmkKillOccurred {
3676 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003677 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003678
3679 // The process name.
3680 optional string process_name = 2;
3681
3682 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003683 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003684
3685 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003686 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003687
3688 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003689 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003690
3691 // RSS
3692 optional int64 rss_in_bytes = 6;
3693
3694 // CACHE
3695 optional int64 cache_in_bytes = 7;
3696
3697 // SWAP
3698 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003699
3700 // The elapsed real time of start of the process.
3701 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003702
3703 // Min oom adj score considered by lmkd.
3704 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003705}
3706
Rajeev Kumar51b54602018-03-01 12:18:26 -08003707/*
3708 * Logs when the ActivityManagerService detects that an app died.
3709 *
3710 * Logged from:
3711 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3712 */
3713message AppDied {
3714 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003715 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003716}
3717
Howard Ro21a039c2018-08-06 14:55:47 -07003718/**
3719 * An atom for generic metrics logging. Available from Android Q.
3720 */
3721message GenericAtom {
3722 // The uid of the application that sent this custom atom.
3723 optional int32 uid = 1 [(is_uid) = true];
3724
3725 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003726 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003727}
3728
Tej Singhd6d6d772018-09-05 17:41:25 -07003729/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003730 * Atom for simple logging of user interaction and impression events, such as "the user touched
3731 * this button" or "this dialog was displayed".
3732 * Keep the UI event stream clean: don't use for system or background events.
3733 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003734 *
3735 * Logged from:
3736 * frameworks/base/services/core/java/com/android/server/
3737 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003738 */
3739message UiEventReported {
3740 // The event_id.
3741 optional int32 event_id = 1;
3742 // The event's source or target uid and package, if applicable.
3743 // For example, the package posting a notification, or the destination package of a share.
3744 optional int32 uid = 2 [(is_uid) = true];
3745 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003746 // An identifier used to disambiguate which logs refer to a particular instance of some
3747 // UI element. Useful when there might be multiple instances simultaneously active.
3748 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003749}
3750
3751/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003752 * Reports a notification was created or updated.
3753 *
3754 * Logged from:
3755 * frameworks/base/services/core/java/com/android/server/notification/
3756 */
3757message NotificationReported {
3758 // The event_id (as for UiEventReported).
3759 optional int32 event_id = 1;
3760 // The notifying app's uid and package.
3761 optional int32 uid = 2 [(is_uid) = true];
3762 optional string package_name = 3;
3763 // A small system-assigned identifier for the notification.
3764 // Locally probably-unique, but expect collisions across users and/or days.
3765 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003766 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3767 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003768
3769 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003770 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3771 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3772 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003773
3774 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003775 optional string category = 10; // App-assigned notification category (API-defined strings)
3776 optional int32 style = 11; // App-assigned notification style
3777 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003778
3779 // Ordering, importance and interruptiveness
3780
Will Brockman7614f6962020-02-10 19:43:03 -05003781 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003782
Will Brockman7614f6962020-02-10 19:43:03 -05003783 optional android.stats.sysui.NotificationImportance importance = 14;
3784 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003785
3786 enum NotificationImportanceExplanation {
3787 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3788 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3789 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3790 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3791 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3792 // Like _APP, but based on pre-channels priority signal.
3793 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3794 }
3795
Will Brockman7614f6962020-02-10 19:43:03 -05003796 optional NotificationImportanceExplanation importance_source = 16;
3797 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3798 optional NotificationImportanceExplanation importance_initial_source = 18;
3799 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3800 optional int32 assistant_hash = 20;
3801 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003802}
3803
3804message Notification {
3805 // The notifying app's uid and package.
3806 optional int32 uid = 1 [(is_uid) = true];
3807 optional string package_name = 2;
3808 // A small system-assigned identifier for the notification.
3809 optional int32 instance_id = 3;
3810
3811 // Grouping information.
3812 optional int32 group_instance_id = 4;
3813 optional bool is_group_summary = 5;
3814
3815 // The section of the shade that the notification is in.
3816 // See NotificationSectionsManager.PriorityBucket.
3817 enum NotificationSection {
3818 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003819 SECTION_HEADS_UP = 1;
3820 SECTION_PEOPLE = 2;
3821 SECTION_ALERTING = 3;
3822 SECTION_SILENT = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003823 }
3824 optional NotificationSection section = 6;
3825}
3826
3827message NotificationList {
3828 repeated Notification notifications = 1; // An ordered sequence of notifications.
3829}
3830
3831/**
3832 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3833 *
3834 * Logged from:
3835 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3836 */
3837message NotificationPanelReported {
3838 // The event_id (as for UiEventReported).
3839 optional int32 event_id = 1;
3840 optional int32 num_notifications = 2;
3841 // The notifications in the panel, in the order that they appear there.
3842 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3843}
3844
3845/**
3846 * Reports a notification channel, or channel group, was created, updated, or deleted.
3847 *
3848 * Logged from:
3849 * frameworks/base/services/core/java/com/android/server/notification/
3850 */
3851message NotificationChannelModified {
3852 // The event_id (as for UiEventReported).
3853 optional int32 event_id = 1;
3854 // The notifying app's uid and package.
3855 optional int32 uid = 2 [(is_uid) = true];
3856 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003857 // Hash of app-assigned notification channel ID or channel-group ID
3858 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003859 // Previous importance setting, if applicable
3860 optional android.stats.sysui.NotificationImportance old_importance = 5;
3861 // New importance setting
3862 optional android.stats.sysui.NotificationImportance importance = 6;
3863}
3864
3865
3866/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003867 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003868 *
3869 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003870 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003871 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003872message BiometricAcquired {
3873 // Biometric modality that was acquired.
3874 optional android.hardware.biometrics.ModalityEnum modality = 1;
3875 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3876 optional int32 user = 2;
3877 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3878 optional bool is_crypto = 3;
3879 // Action that the device is performing. Acquired messages are only expected for enroll and
3880 // authenticate. Other actions may indicate an error.
3881 optional android.hardware.biometrics.ActionEnum action = 4;
3882 // The client that this acquisition was received for.
3883 optional android.hardware.biometrics.ClientEnum client = 5;
3884 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3885 optional int32 acquire_info = 6;
3886 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3887 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003888 // Dictates if this message should trigger additional debugging.
3889 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003890}
3891
3892/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003893 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003894 *
3895 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003896 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003897 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003898message BiometricAuthenticated {
3899 // Biometric modality that was used.
3900 optional android.hardware.biometrics.ModalityEnum modality = 1;
3901 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3902 optional int32 user = 2;
3903 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3904 // storage.
3905 optional bool is_crypto = 3;
3906 // The client that this acquisition was received for.
3907 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003908 // If authentication requires user confirmation. See BiometricPrompt's
3909 // setRequireConfirmation(bool) method.
3910 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003911
Kevin Chyn1741a072019-01-17 11:54:40 -08003912 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003913 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003914 REJECTED = 1;
3915 PENDING_CONFIRMATION = 2;
3916 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003917 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003918
3919 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003920 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003921 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3922 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3923 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3924 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003925 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003926 // Dictates if this message should trigger additional debugging.
3927 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003928}
3929
3930/**
3931 * Logs when a biometric error occurs.
3932 *
3933 * Logged from:
3934 * frameworks/base/services/core/java/com/android/server/biometrics
3935 */
3936message BiometricErrorOccurred {
3937 // Biometric modality that was used.
3938 optional android.hardware.biometrics.ModalityEnum modality = 1;
3939 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3940 optional int32 user = 2;
3941 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3942 optional bool is_crypto = 3;
3943 // Action that the device is performing.
3944 optional android.hardware.biometrics.ActionEnum action = 4;
3945 // The client that this acquisition was received for.
3946 optional android.hardware.biometrics.ClientEnum client = 5;
3947 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3948 // are unique to modality.
3949 optional int32 error_info = 6;
3950 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3951 // by the vendor and not specified by the HIDL interface.
3952 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003953 // Dictates if this message should trigger additional debugging.
3954 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003955 // Time spent during the authentication attempt.
3956 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003957}
3958
3959/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003960 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003961 * Logged from:
3962 * frameworks/base/services/core/java/com/android/server/biometrics
3963 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003964message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003965 // Biometric modality.
3966 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003967 // Type of issue detected.
3968 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003969 // Dictates if this message should trigger additional debugging.
3970 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003971}
Howard Ro688ae182018-09-25 00:09:36 -07003972
joshmccloskey6f952b22019-03-25 20:59:35 -07003973/**
3974 * Logs when a biometric enrollment occurs.
3975 *
3976 * Logged from:
3977 * frameworks/base/services/core/java/com/android/server/biometrics
3978 */
3979message BiometricEnrolled {
3980 // Biometric modality that was used.
3981 optional android.hardware.biometrics.ModalityEnum modality = 1;
3982 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3983 optional int32 user = 2;
3984 // The amount of time the enrollment took in milliseconds.
3985 optional int64 latency_millis = 3;
3986 // Whether or not the enrollment was successful.
3987 optional bool success = 4;
3988}
3989
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003990/*
Tej Singh0d176952019-01-16 19:10:54 -08003991 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003992 */
Tej Singh0d176952019-01-16 19:10:54 -08003993message FlagFlipUpdateOccurred {
3994 // If the event is from a flag config package, specify the package name.
3995 optional string flag_flip_package_name = 1;
3996
3997 // The order id of the package
3998 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003999}
4000
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004001/**
4002 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004003 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004004 */
4005message TrainExperimentIds {
4006 repeated int64 experiment_id = 1;
4007}
4008
Yangster-macb89807e2018-11-15 21:10:57 -08004009/*
4010 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004011 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004012 */
4013message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004014 // Name of the train.
4015 optional string train_name = 1;
4016 // Version code for a "train" of packages that need to be installed atomically
4017 optional int64 train_version_code = 2;
4018 // After installation of this package, device requires a restart.
4019 optional bool requires_staging = 3;
4020 // Rollback should be enabled for this install.
4021 optional bool rollback_enabled = 4;
4022 // Requires low latency monitoring if possible.
4023 optional bool requires_low_latency_monitor = 5;
4024
Yangster-macb89807e2018-11-15 21:10:57 -08004025 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004026 UNKNOWN = 0;
4027 INSTALL_REQUESTED = 1;
4028 INSTALL_STARTED = 2;
4029 INSTALL_STAGED_NOT_READY = 3;
4030 INSTALL_STAGED_READY = 4;
4031 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004032 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4033 // and INSTALL_FAILURE_COMMIT.
4034 INSTALL_FAILURE = 6 [deprecated = true];
4035 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004036 INSTALL_CANCELLED = 7;
4037 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004038 INSTALLER_ROLLBACK_INITIATED = 9;
4039 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4040 INSTALLER_ROLLBACK_STAGED = 11;
4041 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4042 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4043 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4044 INSTALLER_ROLLBACK_SUCCESS = 15;
4045 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004046 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4047 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4048 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4049 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4050 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4051 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004052 INSTALL_FAILURE_DOWNLOAD = 23;
4053 INSTALL_FAILURE_STATE_MISMATCH = 24;
4054 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004055 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004056 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004057 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004058 // Possible experiment ids for monitoring this push.
4059 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4060 // user id
4061 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004062 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004063 // Whether or not this is a rollback event
4064 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004065}
4066
Tej Singhc9203082019-05-03 13:42:23 -07004067/* Test atom, is not logged anywhere */
4068message TestAtomReported {
4069 repeated AttributionNode attribution_node = 1;
4070 optional int32 int_field = 2;
4071 optional int64 long_field = 3;
4072 optional float float_field = 4;
4073 optional string string_field = 5;
4074 optional bool boolean_field = 6;
4075 enum State {
4076 UNKNOWN = 0;
4077 OFF = 1;
4078 ON = 2;
4079 }
4080 optional State state = 7;
4081 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4082}
4083
Maggie Whitefc1aa592018-11-28 21:55:23 -08004084/** Represents USB port overheat event. */
4085message UsbPortOverheatEvent {
4086 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4087 optional int32 plug_temperature_deci_c = 1;
4088
4089 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4090 optional int32 max_temperature_deci_c = 2;
4091
4092 /* Time between USB plug event and overheat threshold trip, in seconds. */
4093 optional int32 time_to_overheat_secs = 3;
4094
4095 /* Time between overheat threshold trip and hysteresis, in seconds. */
4096 optional int32 time_to_hysteresis_secs = 4;
4097
4098 /* Time between hysteresis and active mitigation ending, in seconds. */
4099 optional int32 time_to_inactive_secs = 5;
4100};
4101
Maggie White8735b852019-01-18 11:40:49 -08004102/**
4103 * Logs total effective full charge and discharge cycles on a battery.
4104 * Here are some examples of one effective cycle:
4105 * 1) the battery charges from 0% to 100% and drains back to 0%,
4106 * 2) charging from 50% to 100% and draining back to 50% twice.
4107 * Pulled from:
4108 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4109 */
4110message BatteryCycleCount {
4111 /* Number of total charge and discharge cycles on the system battery. */
4112 optional int32 cycle_count = 1;
4113}
4114
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004115/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004116 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4117 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004118 * Pulled from:
4119 * StatsCompanionService
4120 */
4121
Carmen Agimof12dec122019-03-06 16:14:38 +00004122message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004123
Carmen Agimof12dec122019-03-06 16:14:38 +00004124 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004125 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004126 PUBLIC = 1;
4127 PRIVATE = 2;
4128 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004129 }
4130
Carmen Agimof12dec122019-03-06 16:14:38 +00004131 // The type of external storage.
4132 optional android.stats.storage.ExternalStorageType storage_type = 1;
4133 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4134 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004135 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004136 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004137}
4138
Yangster-macb89807e2018-11-15 21:10:57 -08004139/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004140 * Logs when a connection becomes available and lost.
4141 * Logged in StatsCompanionService.java
4142 */
4143message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004144 // Id of the network.
4145 optional int32 net_id = 1;
4146
4147 enum State {
4148 UNKNOWN = 0;
4149 CONNECTED = 1;
4150 DISCONNECTED = 2;
4151 }
4152 // Connected state of a network.
4153 optional State state = 2;
4154}
4155
4156/**
4157 * Logs when a service starts and stops.
4158 * Logged from:
4159 * services/core/java/com/android/server/am/ActiveServices.java
4160 */
4161message ServiceStateChanged {
4162
4163 optional int32 uid = 1 [(is_uid) = true];
4164
4165 optional string package_name = 2;
4166
4167 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004168
4169 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004170 START = 1;
4171 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004172 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004173
4174 optional State state = 4;
4175}
4176
4177/**
4178 * Logs when a service is launched.
4179 * Logged from:
4180 * services/core/java/com/android/server/am/ActiveServices.java
4181 */
4182message ServiceLaunchReported {
4183
4184 optional int32 uid = 1 [(is_uid) = true];
4185
4186 optional string package_name = 2;
4187
4188 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004189}
Howard Ro688ae182018-09-25 00:09:36 -07004190
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004191/**
4192 * Logs when a hidden API is used.
4193 *
4194 * Logged from:
4195 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4196 */
4197message HiddenApiUsed {
4198 // The uid of the app making the hidden access.
4199 optional int32 uid = 1 [(is_uid) = true];
4200
4201 // Signature of the method or field accessed.
4202 optional string signature = 2;
4203
4204 enum AccessMethod {
4205 NONE = 0;
4206 REFLECTION = 1;
4207 JNI = 2;
4208 LINKING = 3;
4209 }
4210
4211 // Type of access.
4212 optional AccessMethod access_method = 3;
4213
4214 // Whether the access was prevented or not.
4215 optional bool access_denied = 4;
4216}
4217
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004218/**
4219 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4220 * - When user sees privacy chip
4221 * - When user clicks privacy chip
4222 * - How does the user exit the Privacy Dialog
4223 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004224 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4225 */
4226message PrivacyIndicatorsInteracted {
4227
4228 enum Type {
4229 UNKNOWN = 0;
4230 CHIP_VIEWED = 1;
4231 CHIP_CLICKED = 2;
4232 DIALOG_PRIVACY_SETTINGS = 3;
4233 DIALOG_DISMISS = 4;
4234 DIALOG_LINE_ITEM = 5;
4235 }
4236
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004237 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004238
4239 // Used if the type is LINE_ITEM
4240 optional string package_name = 2;
4241}
4242
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004243/**
4244 * Logs information about a package that is moved from the internal to external storage and vice
4245 * versa.
4246 * It logs the package name, the type of the external storage where the package is installed
4247 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4248 * and the move type: if it's from internal to external or the other way around.
4249 *
4250 * Logged from:
4251 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4252 */
4253message AppMovedStorageReported {
4254 enum MoveType {
4255 UNKNOWN = 0;
4256 TO_EXTERNAL = 1;
4257 TO_INTERNAL = 2;
4258 }
4259 // The type of the external storage.
4260 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4261 // The type of move.
4262 optional MoveType move_type = 2;
4263 // The name of the package that was moved.
4264 optional string package_name = 3;
4265}
4266
jianjin8f2dee02019-03-29 14:03:08 -07004267/**
4268 * Logs when system server watchdog occurs.
4269 * Logged from:
4270 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4271 */
4272message SystemServerWatchdogOccurred {
4273 optional string subject = 1;
4274}
4275
4276/**
4277 * Logs when new file added to tombstones.
4278 * Logged from:
4279 * frameworks/base/core/java/com/android/server/BootReceiver.java
4280 */
4281message TombStoneOccurred {
4282}
4283
Hai Zhang5d3328d2019-04-13 21:25:06 +08004284/*
4285 * Information about a role request
4286 *
4287 * Logged from:
4288 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4289 */
4290message RoleRequestResultReported {
4291 // UID of application requesting the role
4292 optional int32 requesting_uid = 1;
4293
4294 // Package name of application requesting the role
4295 optional string requesting_package_name = 2;
4296
4297 // The role to be granted
4298 optional string role_name = 3;
4299
4300 // The count of applications qualifying for the role
4301 optional int32 qualifying_count = 4;
4302
4303 // UID of application current granted the role
4304 optional int32 current_uid = 5;
4305
4306 // Package name of application current granted the role
4307 optional string current_package_name = 6;
4308
4309 // UID of another application that user chose to grant the role to, instead of the requesting
4310 // application
4311 optional int32 granted_another_uid = 7;
4312
4313 // Package name of another application that user chose to grant the role to, instead of the
4314 // requesting application
4315 optional string granted_another_package_name = 8;
4316
4317 enum Result {
4318 UNDEFINED = 0;
4319 // role request was ignored
4320 IGNORED = 1;
4321 // role request was ignored because it's already granted
4322 IGNORED_ALREADY_GRANTED = 2;
4323 // role request was ignored because the application isn't qualified
4324 IGNORED_NOT_QUALIFIED = 3;
4325 // role request was ignored because user said it should be always denied
4326 IGNORED_USER_ALWAYS_DENIED = 4;
4327 // role was granted by user action
4328 USER_GRANTED = 5;
4329 // role was denied by user action
4330 USER_DENIED = 6;
4331 // role was denied by user granting another application the role
4332 USER_DENIED_GRANTED_ANOTHER = 7;
4333 // role was denied and set to be always denied by the user
4334 USER_DENIED_WITH_ALWAYS = 8;
4335 }
4336 // The result of the role request
4337 optional Result result = 9;
4338}
4339
Mark Tabrya824a642019-11-05 12:26:12 -08004340/**
4341 * Logs when a Vehicle Maps Service client's connection state has changed
4342 *
4343 * Logged from:
4344 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4345 */
4346message VmsClientConnectionStateChanged {
4347 // The UID of the VMS client app
4348 optional int32 uid = 1 [(is_uid) = true];
4349
4350 enum State {
4351 UNKNOWN = 0;
4352 // Attempting to connect to the client
4353 CONNECTING = 1;
4354 // Client connection established
4355 CONNECTED = 2;
4356 // Client connection closed unexpectedly
4357 DISCONNECTED = 3;
4358 // Client connection closed by VMS
4359 TERMINATED = 4;
4360 // Error establishing the client connection
4361 CONNECTION_ERROR = 5;
4362 }
4363
4364 optional State state = 2;
4365}
4366
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004367/**
4368 * Logs when MediaProvider has successfully finished scanning a storage volume.
4369 *
4370 * Logged from:
4371 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4372 */
4373message MediaProviderScanEvent {
4374 enum Reason {
4375 // Scan triggered due to unknown reason
4376 UNKNOWN = 0;
4377 // Scan triggered due to storage volume being mounted
4378 MOUNTED = 1;
4379 // Scan triggered due to explicit user action or app request
4380 DEMAND = 2;
4381 // Scan triggered due to idle maintenance
4382 IDLE = 3;
4383 }
4384
4385 // Volume type that this event pertains to
4386 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4387 // Reason why this scan was triggered
4388 optional Reason reason = 2;
4389 // Total number of files scanned
4390 optional int64 item_count = 3;
4391 // Duration of scan, normalized per file
4392 optional float normalized_duration_millis = 4;
4393 // Number of database inserts, normalized per file
4394 optional float normalized_insert_count = 5;
4395 // Number of database updates, normalized per file
4396 optional float normalized_update_count = 6;
4397 // Number of database deletes, normalized per file
4398 optional float normalized_delete_count = 7;
4399}
4400
4401/**
4402 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4403 *
4404 * Logged from:
4405 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4406 */
4407message MediaProviderDeletionEvent {
4408 // Volume type that this event pertains to
4409 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4410 // Device timestamp when this deletion event occurred
4411 optional int64 timestamp_millis = 2;
4412 // App that requested deletion
4413 optional string package_name = 3;
4414 // Number of items that were deleted
4415 optional int32 item_count = 4;
4416}
4417
4418/**
4419 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4420 *
4421 * Logged from:
4422 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4423 */
4424message MediaProviderPermissionEvent {
4425 enum Result {
4426 UNKNOWN = 0;
4427 USER_GRANTED = 1;
4428 AUTO_GRANTED = 2;
4429 USER_DENIED = 3;
4430 USER_DENIED_WITH_PREJUDICE = 4;
4431 AUTO_DENIED = 5;
4432 }
4433
4434 // Volume type that this event pertains to
4435 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4436 // Device timestamp when this permission event occurred
4437 optional int64 timestamp_millis = 2;
4438 // App that requested permission
4439 optional string package_name = 3;
4440 // Number of items that were requested
4441 optional int32 item_count = 4;
4442 // Result of this request
4443 optional Result result = 5;
4444}
4445
4446/**
4447 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4448 *
4449 * Logged from:
4450 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4451 */
4452message MediaProviderSchemaChange {
4453 // Volume type that this event pertains to
4454 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4455 // Old database version code
4456 optional int32 version_from = 2;
4457 // New database version code
4458 optional int32 version_to = 3;
4459 // Total number of files in database
4460 optional int64 item_count = 4;
4461 // Duration of schema change, normalized per file
4462 optional float normalized_duration_millis = 5;
4463}
4464
4465/**
4466 * Logs when MediaProvider has finished an idle maintenance job.
4467 *
4468 * Logged from:
4469 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4470 */
4471message MediaProviderIdleMaintenance {
4472 // Volume type that this event pertains to
4473 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4474
4475 // Total number of files in database
4476 optional int64 item_count = 2;
4477 // Duration of idle maintenance, normalized per file
4478 optional float normalized_duration_millis = 3;
4479 // Number of thumbnails found to be stale, normalized per file
4480 optional float normalized_stale_thumbnails = 4;
4481 // Number of items found to be expired, normalized per file
4482 optional float normalized_expired_media = 5;
4483}
4484
Keun young Park3e033cb2019-12-18 11:27:35 -08004485/**
4486 * Represents boot time event with duration in ms.
4487 *
4488 * Logged from: bootstat and various system server components. Check each enums for details.
4489 */
4490message BootTimeEventDuration {
4491 enum DurationEvent {
4492 UNKNOWN = 0;
4493 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4494 ABSOLUTE_BOOT_TIME = 1;
4495 // Bootloader's 1st stage execution time.
4496 // Logged from bootstat.
4497 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4498 // Bootloader's 1st stage loading time.
4499 // Logged from bootstat.
4500 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4501 // Bootloader's kernel loading time.
4502 // Logged from bootstat.
4503 BOOTLOADER_KERNEL_LOAD = 4;
4504 // Bootloader's 2nd stage execution time.
4505 // Logged from bootstat.
4506 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4507 // Bootloader's 2nd stage loading time.
4508 // Logged from bootstat.
4509 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4510 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4511 // for locked device.
4512 // Logged from bootstat.
4513 BOOTLOADER_UI_WAIT = 7;
4514 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4515 // Logged from bootstat.
4516 BOOTLOADER_TOTAL = 8;
4517 // Shutdown duration inside init for the reboot before the current boot up.
4518 // Logged from f/b/services/.../BootReceiver.java.
4519 SHUTDOWN_DURATION = 9;
4520 // Total time for mounting of disk devices during bootup.
4521 // Logged from f/b/services/.../BootReceiver.java.
4522 MOUNT_DEFAULT_DURATION = 10;
4523 // Total time for early stage mounting of disk devices during bootup.
4524 // Logged from f/b/services/.../BootReceiver.java.
4525 MOUNT_EARLY_DURATION = 11;
4526 // Total time for late stage mounting of disk devices during bootup.
4527 // Logged from f/b/services/.../BootReceiver.java.
4528 MOUNT_LATE_DURATION = 12;
4529 // Average time to scan non-system app after OTA
4530 // Logged from f/b/services/.../PackageManagerService.java
4531 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4532 // Time to initialize Package manager after OTA
4533 // Logged from f/b/services/.../PackageManagerService.java
4534 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4535 // Time to scan all system app from Package manager after OTA
4536 // Logged from f/b/services/.../PackageManagerService.java
4537 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4538 // Init's total time for cold boot stage.
4539 // Logged from bootstat.
4540 COLDBOOT_WAIT = 16;
4541 // Init's total time for initializing selinux.
4542 // Logged from bootstat.
4543 SELINUX_INIT = 17;
4544 // Time since last factory reset.
4545 // Logged from bootstat.
4546 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004547 // Init's total time spent for completing the 1st stage.
4548 // Logged from bootstat.
4549 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004550 }
4551
4552 // Type of the event.
4553 optional DurationEvent event = 1;
4554 // Duration of the event in ms.
4555 optional int64 duration_millis = 2;
4556}
4557
4558/**
4559 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4560 * since boot-up.
4561 *
4562 * Logged from: bootstat and various system server components. Check each enums for details.
4563 */
4564message BootTimeEventElapsedTime {
4565 enum ElapsedTimeEvent {
4566 UNKNOWN = 0;
4567 // Time when init starts 1st stage. Logged from bootstat.
4568 ANDROID_INIT_STAGE_1 = 1;
4569 // Time when sys.boot_completed prop is set.
4570 // Logged from bootstat.
4571 BOOT_COMPLETE = 2;
4572 // BOOT_COMPLETE for encrypted device.
4573 BOOT_COMPLETE_ENCRYPTION = 3;
4574 // BOOT_COMPLETE for device with no encryption.
4575 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4576 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004577 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004578 // BOOT_COMPLETE after factory reset.
4579 FACTORY_RESET_BOOT_COMPLETE = 6;
4580 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4581 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004582 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4583 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004584 // BOOT_COMPLETE after OTA.
4585 OTA_BOOT_COMPLETE = 9;
4586 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4587 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004588 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4589 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004590 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4591 // Logged from f/b/services/.../UserController.java
4592 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4593 // Time when the system starts sending BOOT_COMPLETED broadcast.
4594 // Logged from f/b/services/.../UserController.java
4595 FRAMEWORK_BOOT_COMPLETED = 13;
4596 // Time when the package manager starts init.
4597 // Logged from f/b/services/.../SystemServer.java
4598 PACKAGE_MANAGER_INIT_START = 14;
4599 // Time when package manager is ready
4600 // Logged from f/b/services/.../SystemServer.java
4601 PACKAGE_MANAGER_INIT_READY = 15;
4602 // Represents the time when user has entered unlock credential for system with user pin.
4603 // Logged from bootstat.
4604 POST_DECRYPT = 16;
4605 // Represents the start of zygote's init.
4606 // Logged from zygote itself.
4607 ZYGOTE_INIT_START = 17;
4608 // Represents the start of secondary zygote's init.
4609 // TODO: add logging to zygote
4610 SECONDARY_ZYGOTE_INIT_START = 18;
4611 // Represents the start of system server's init.
4612 // Logged from f/b/services/.../SystemServer.java
4613 SYSTEM_SERVER_INIT_START = 19;
4614 // Represents the completion of system server's init.
4615 // Logged from f/b/services/.../SystemServer.java
4616 SYSTEM_SERVER_READY = 20;
4617 // Represents the start of launcher during boot-up.
4618 // TODO: add logging
4619 LAUNCHER_START = 21;
4620 // Represents the completion of launcher's initial rendering. User can use other apps from
4621 // launcher from this point.
4622 // TODO: add logging
4623 LAUNCHER_SHOWN = 22;
4624 }
4625
4626 // Type of the event.
4627 optional ElapsedTimeEvent event = 1;
4628 // Time since bootup for the event.
4629 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4630 optional int64 time_millis = 2;
4631}
4632
4633/**
4634 * Boot time events with UTC time.
4635 *
4636 * Logged from: bootstat and various system server components. Check each enums for details.
4637 */
4638message BootTimeEventUtcTime {
4639 enum UtcTimeEvent {
4640 UNKNOWN = 0;
4641 // Time of the bootstat's marking of 1st boot after the last factory reset.
4642 // Logged from bootstat.
4643 FACTORY_RESET_RESET_TIME = 1;
4644 // The time when bootstat records FACTORY_RESET_* events. This is close to
4645 // BOOT_COMPLETE time for the current bootup.
4646 // Logged from bootstat.
4647 FACTORY_RESET_CURRENT_TIME = 2;
4648 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4649 // Logged from bootstat.
4650 FACTORY_RESET_RECORD_VALUE = 3;
4651 }
4652
4653 // Type of the event.
4654 optional UtcTimeEvent event = 1;
4655 // UTC time for the event.
4656 optional int64 utc_time_secs = 2;
4657}
4658
4659/**
4660 * Boot time events representing specific error code during bootup.
4661 * Meaning of error code can be different per each event type.
4662 *
4663 * Logged from: bootstat and various system server components. Check each enums for details.
4664 */
4665message BootTimeEventErrorCode {
4666 enum ErrorCodeEvent {
4667 UNKNOWN = 0;
4668 // Linux error code for time() call to get the current UTC time.
4669 // Logged from bootstat.
4670 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4671 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4672 // as UMOUNT_STAT_* from init/reboot.cpp.
4673 // Logged from f/b/services/.../BootReceiver.java.
4674 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004675 // Reprepsents fie system mounting error code of /data partition for the current boot.
4676 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004677 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004678 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004679 }
4680
4681 // Type of the event.
4682 optional ErrorCodeEvent event = 1;
4683 // error code defined per each event type.
4684 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4685 // FS_MGR_FS_STAT.
4686 optional int32 error_code = 2;
4687}
4688
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004689/**
4690 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4691 * after an OTA.
4692 *
4693 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004694 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004695 */
4696message SnapshotMergeReported {
4697 // Keep in sync with
4698 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4699 enum UpdateState {
4700 // No update or merge is in progress.
4701 NONE = 0;
4702 // An update is applying; snapshots may already exist.
4703 INITIATED = 1;
4704 // An update is pending, but has not been successfully booted yet.
4705 UNVERIFIED = 2;
4706 // The kernel is merging in the background.
4707 MERGING = 3;
4708 // Post-merge cleanup steps could not be completed due to a transient
4709 // error, but the next reboot will finish any pending operations.
4710 MERGE_NEEDS_REBOOT = 4;
4711 // Merging is complete, and needs to be acknowledged.
4712 MERGE_COMPLETED = 5;
4713 // Merging failed due to an unrecoverable error.
4714 MERGE_FAILED = 6;
4715 // The update was implicitly cancelled, either by a rollback or a flash
4716 // operation via fastboot. This state can only be returned by WaitForMerge.
4717 CANCELLED = 7;
4718 };
4719
4720 // Status of the update after the merge attempts.
4721 optional UpdateState final_state = 1;
4722
4723 // Time to complete a merge operation in milliseconds.
4724 // A negative value corresponds to the case in which the merge operation
4725 // was interrupted and resumed (e.g. in case of a system reboot during the
4726 // merge).
4727 optional int64 duration_millis = 2;
4728
4729 // Number of reboots that occurred after issuing and before completing the
4730 // merge of all the snapshot devices.
4731 optional int32 intermediate_reboots = 3;
4732}
4733
Chenjie Yubbcbc602018-02-05 16:51:52 -08004734//////////////////////////////////////////////////////////////////////
4735// Pulled atoms below this line //
4736//////////////////////////////////////////////////////////////////////
4737
4738/**
David Chenc8a43242017-10-17 16:23:28 -07004739 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4740 *
4741 * Pulled from:
4742 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4743 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004744message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004745 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004746
4747 optional int64 rx_bytes = 2;
4748
4749 optional int64 rx_packets = 3;
4750
4751 optional int64 tx_bytes = 4;
4752
4753 optional int64 tx_packets = 5;
4754}
4755
4756/**
4757 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4758 *
4759 * Pulled from:
4760 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4761 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004762message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004763 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004764
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004765 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4766 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004767
4768 optional int64 rx_bytes = 3;
4769
4770 optional int64 rx_packets = 4;
4771
4772 optional int64 tx_bytes = 5;
4773
4774 optional int64 tx_packets = 6;
4775}
4776
4777/**
4778 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4779 *
4780 * Pulled from:
4781 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4782 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004783message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004784 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004785
4786 optional int64 rx_bytes = 2;
4787
4788 optional int64 rx_packets = 3;
4789
4790 optional int64 tx_bytes = 4;
4791
4792 optional int64 tx_packets = 5;
junyulaif8893302019-12-11 21:18:11 +08004793
4794 optional int32 rat_type = 6;
David Chenc8a43242017-10-17 16:23:28 -07004795}
4796
4797/**
4798 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4799 *
4800 * Pulled from:
4801 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4802 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004803message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004804 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004805
Yao Chenc40a19d2018-03-15 16:48:25 -07004806 // 1 denotes foreground and 0 denotes background. This is called Set in
4807 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004808 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004809
4810 optional int64 rx_bytes = 3;
4811
4812 optional int64 rx_packets = 4;
4813
4814 optional int64 tx_bytes = 5;
4815
4816 optional int64 tx_packets = 6;
junyulaif8893302019-12-11 21:18:11 +08004817
4818 optional int32 rat_type = 7;
David Chenc8a43242017-10-17 16:23:28 -07004819}
4820
4821/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004822 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4823 *
4824 * Pulled from:
4825 * StatsCompanionService
4826 */
4827message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004828 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004829
4830 optional int64 rx_bytes = 2;
4831
4832 optional int64 tx_bytes = 3;
4833}
4834
4835/**
David Chenc8a43242017-10-17 16:23:28 -07004836 * Pulls the kernel wakelock durations. This atom is adapted from
4837 * android/internal/os/KernelWakelockStats.java
4838 *
4839 * Pulled from:
4840 * StatsCompanionService using KernelWakelockReader.
4841 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004842message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004843 optional string name = 1;
4844
4845 optional int32 count = 2;
4846
4847 optional int32 version = 3;
4848
Yangster-maca8a30442018-10-13 23:46:34 -07004849 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004850}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004851
Chenjie Yu05013b32017-11-21 10:21:41 -08004852/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004853 * Pulls low power state information. If power.stats HAL is not available, this
4854 * includes platform and subsystem sleep state information,
4855 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4856 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004857 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004858 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004859 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4860 * as defined in:
4861 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004862 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004863message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004864 // Subsystem name
4865 optional string subsystem_name = 1;
4866 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4867 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004868 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4869 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004870 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004871 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004872 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004873 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004874 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004875}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004876
Chenjie Yu05013b32017-11-21 10:21:41 -08004877/**
Bookatz92da2832018-11-01 18:10:03 -07004878 * Pulls on-device power measurement information.
4879 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4880 * Pulled from:
4881 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4882 */
4883message OnDevicePowerMeasurement {
4884 // Name of the subsystem (to which the rail belongs).
4885 optional string subsystem_name = 1;
4886
4887 // Rail name. The rail lies within the subsystem.
4888 optional string rail_name = 2;
4889
4890 // Time (in ms since boot) at which the rail energy value was measured.
4891 // This may differ slightly from the time that statsd logs this information.
4892 optional uint64 measurement_timestamp_millis = 3;
4893
4894 // Accumulated energy used via the rail since device boot in uWs.
4895 optional uint64 energy_microwatt_secs = 4;
4896}
4897
4898/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004899 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004900 * Pulls the time the cpu spend on the frequency index. Frequency index
4901 * starts from highest to lowest. The value should be monotonically
4902 * increasing since boot. However, if there is a cpu
4903 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004904 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004905message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004906 optional uint32 cluster = 1;
4907 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004908 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004909}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004910
Chenjie Yu05013b32017-11-21 10:21:41 -08004911/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004912 * Pulls Cpu Time Per Uid.
4913 * Note that isolated process uid time should be attributed to host uids.
4914 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004915message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004916 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004917 optional uint64 user_time_micros = 2;
4918 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004919}
4920
4921/**
4922 * Pulls Cpu Time Per Uid per frequency.
4923 * Note that isolated process uid time should be attributed to host uids.
4924 * For each uid, we order the time by descending frequencies.
4925 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004926message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004927 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004928 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004929 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004930}
Hugo Benichi884970e2017-11-14 22:42:46 +09004931
Chenjie Yu05013b32017-11-21 10:21:41 -08004932/**
4933 * Pulls Wifi Controller Activity Energy Info
4934 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004935message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004936 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004937 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004938 // stack reported state
4939 // TODO: replace this with proto enum
4940 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004941 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004942 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004943 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004944 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004945 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004946 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004947 // product of current(mA), voltage(V) and time(ms)
4948 optional uint64 controller_energy_used = 6;
4949}
4950
4951/**
4952 * Pulls Modem Activity Energy Info
4953 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004954message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004955 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004956 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004957 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004958 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004959 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004960 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004961 /**
4962 * Tx power index
4963 * index 0 = tx_power < 0dBm
4964 * index 1 = 0dBm < tx_power < 5dBm
4965 * index 2 = 5dBm < tx_power < 15dBm
4966 * index 3 = 15dBm < tx_power < 20dBm
4967 * index 4 = tx_power > 20dBm
4968 */
4969 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004970 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004971 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004972 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004973 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004974 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004975 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004976 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004977 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004978 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004979 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004980 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004981 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004982 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004983}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004984
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004985/**
4986 * Pulls Bluetooth Activity Energy Info
4987 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4988 */
4989message BluetoothActivityInfo {
4990 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004991 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004992 // bluetooth stack state
4993 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004994 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004995 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004996 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004997 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004998 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004999 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005000 // product of current(mA), voltage(V) and time(ms)
5001 optional uint64 energy_used = 6;
5002}
5003
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005004/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005005 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005006 *
5007 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005008 */
5009message ProcessMemoryState {
5010 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005011 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005012
5013 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005014 // Usually package name, "system" for system server.
5015 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005016 optional string process_name = 2;
5017
Rafal Slawikda51b932018-12-13 16:31:33 +00005018 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005019 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005020
5021 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005022 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005023
5024 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005025 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005026
Rajeev Kumar90235992018-01-29 11:06:48 -08005027 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005028 // Value is read from memory.stat, field total_rss if per-app memory
5029 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005030 optional int64 rss_in_bytes = 6;
5031
5032 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005033 // Value is read from memory.stat, field total_cache if per-app memory
5034 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005035 optional int64 cache_in_bytes = 7;
5036
5037 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005038 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005039 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005040 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005041
Rafal Slawik203c3db2019-09-25 19:53:01 +01005042 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005043 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005044
Rafal Slawik203c3db2019-09-25 19:53:01 +01005045 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5046 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005047
Rafal Slawik203c3db2019-09-25 19:53:01 +01005048 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5049 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005050}
5051
5052/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005053 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005054 *
5055 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5056 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005057 *
5058 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005059 */
5060message ProcessMemoryHighWaterMark {
5061 // The uid if available. -1 means not available.
5062 optional int32 uid = 1 [(is_uid) = true];
5063
Rafal Slawikda51b932018-12-13 16:31:33 +00005064 // The process name.
5065 // Usually package name or process cmdline.
5066 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005067 optional string process_name = 2;
5068
Rafal Slawik239b6802019-09-09 18:46:01 +01005069 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5070 // computed by converting kilobytes to bytes.
5071 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5072
Rafal Slawik3bea8952018-11-15 12:39:33 +00005073 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5074 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005075 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005076}
5077
5078/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005079 * Logs the memory stats for a process.
5080 *
5081 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5082 * and for selected native processes.
5083 */
5084message ProcessMemorySnapshot {
5085 // The uid if available. -1 means not available.
5086 optional int32 uid = 1 [(is_uid) = true];
5087
5088 // The process name.
5089 // Usually package name or process cmdline.
5090 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5091 optional string process_name = 2;
5092
5093 // The pid of the process.
5094 // Allows to disambiguate instances of the process.
5095 optional int32 pid = 3;
5096
5097 // The current OOM score adjustment value.
5098 // Read from ProcessRecord for managed processes.
5099 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5100 optional int32 oom_score_adj = 4;
5101
5102 // The current RSS of the process.
5103 // VmRSS from /proc/pid/status.
5104 optional int32 rss_in_kilobytes = 5;
5105
5106 // The current anon RSS of the process.
5107 // RssAnon from /proc/pid/status.
5108 optional int32 anon_rss_in_kilobytes = 6;
5109
5110 // The current swap size of the process.
5111 // VmSwap from /proc/pid/status.
5112 optional int32 swap_in_kilobytes = 7;
5113
5114 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5115 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5116}
5117
5118/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005119 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005120 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005121message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005122 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005123}
5124
5125/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005126 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005127 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005128message SystemUptime {
5129 // Milliseconds since the system was booted.
5130 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5131 // for external input).
5132 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005133 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005134}
5135
5136/*
5137 * Reads from /proc/uid_concurrent_active_time which has the format:
5138 * active: X (X is # cores)
5139 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5140 * [uid1]: [time-0] [time-1] [time-2] ... ...
5141 * ...
5142 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5143 * The file contains a monotonically increasing count of time for a single boot.
5144 */
5145message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005146 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005147 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005148}
5149
5150/**
5151 * Reads from /proc/uid_concurrent_policy_time which has the format:
5152 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5153 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5154 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5155 * ...
5156 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5157 * The file contains a monotonically increasing count of time for a single boot.
5158 */
5159message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005160 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005161 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005162 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005163}
5164
5165/*
5166 * Pulls free disk space, for data, system partition and temporary directory.
5167 */
5168message DiskSpace {
5169 // available bytes in data partition
5170 optional uint64 data_available_bytes = 1;
5171 // available bytes in system partition
5172 optional uint64 system_available_bytes = 2;
5173 // available bytes in download cache or temp directories
5174 optional uint64 temp_available_bytes = 3;
5175}
Tej Singhbf972d92018-01-10 20:51:13 -08005176
5177/**
5178 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005179 *
5180 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005181 */
5182message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005183 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005184}
5185
5186/**
5187 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005188 * Pulled from:
5189 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005190 */
5191message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005192 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005193}
5194
5195/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005196 * Pulls battery voltage.
5197 * Pulled from:
5198 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5199 */
5200message BatteryVoltage {
5201 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005202 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005203}
5204
5205/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005206 * Pulls battery level (percent full, from 0 to 100).
5207 *
5208 * Pulled from:
5209 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5210 */
5211message BatteryLevel {
5212 // Battery level. Should be in [0, 100].
5213 optional int32 battery_level = 1;
5214}
5215
5216/**
Tej Singhd89137e2018-03-26 14:51:40 -07005217 * Pulls the temperature of various parts of the device.
5218 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005219 *
Maggie White442b6312019-04-05 16:26:44 -07005220 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005221 */
5222message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005223 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005224 optional android.os.TemperatureTypeEnum sensor_location = 1;
5225
5226 // The name of the temperature source. Eg. CPU0
5227 optional string sensor_name = 2;
5228
Tej Singhd89137e2018-03-26 14:51:40 -07005229 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005230 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005231 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005232
5233 // Relative severity of the throttling, see enum definition.
5234 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005235}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005236
5237/**
5238 * Pulls the statistics of calls to Binder.
5239 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005240 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5241 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005242 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005243 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005244 */
5245message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005246 // UID of the process responsible for the binder transaction. It will be set if the process
5247 // executing the binder transaction attribute the transaction to another uid using
5248 // Binder.setThreadWorkSource().
5249 //
5250 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005251 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005252 // UID of the process executing the binder transaction.
5253 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005254 // Fully qualified class name of the API call.
5255 //
5256 // This is a system server class name.
5257 //
5258 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5259 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5260 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5261 // commonly used APIs.
5262 optional string service_class_name = 2;
5263 // Method name of the API call. It can also be a transaction code if we cannot
5264 // resolve it to a name. See Binder#getTransactionName.
5265 //
5266 // This is a system server method name.
5267 optional string service_method_name = 3;
5268 // Total number of API calls.
5269 optional int64 call_count = 4;
5270 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5271 optional bool screen_interactive = 13;
5272 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5273 // call_count will be equal to recorded_call_count.
5274 //
5275 // If recorded_call_count is different than call_count, it means data collection has been
5276 // sampled. All the fields below will be sampled in this case.
5277 optional int64 recorded_call_count = 12;
5278 // Number of exceptions thrown by the API.
5279 optional int64 recorded_exception_count = 5;
5280 // Total latency of all API calls.
5281 // Average can be computed using total_latency_micros / recorded_call_count.
5282 optional int64 recorded_total_latency_micros = 6;
5283 // Maximum latency of one API call.
5284 optional int64 recorded_max_latency_micros = 7;
5285 // Total CPU usage of all API calls.
5286 // Average can be computed using total_cpu_micros / recorded_call_count.
5287 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5288 optional int64 recorded_total_cpu_micros = 8;
5289 // Maximum CPU usage of one API call.
5290 optional int64 recorded_max_cpu_micros = 9;
5291 // Maximum parcel reply size of one API call.
5292 optional int64 recorded_max_reply_size_bytes = 10;
5293 // Maximum parcel request size of one API call.
5294 optional int64 recorded_max_request_size_bytes = 11;
5295}
5296
5297/**
5298 * Pulls the statistics of exceptions during calls to Binder.
5299 *
5300 * Binder stats are cumulative from boot unless somebody reset the data using
5301 * > adb shell dumpsys binder_calls_stats --reset
5302 */
5303message BinderCallsExceptions {
5304 // Exception class name, e.g. java.lang.IllegalArgumentException.
5305 //
5306 // This is an exception class name thrown by the system server.
5307 optional string exception_class_name = 1;
5308 // Total number of exceptions.
5309 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005310}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005311
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005312/**
5313 * Pulls the statistics of message dispatching on HandlerThreads.
5314 *
5315 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5316 * config on the device.
5317 *
5318 * Next tag: 11
5319 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005320message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005321 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005322 optional int32 uid = 1 [(is_uid) = true];
5323
5324 // Fully qualified class name of the handler target class.
5325 //
5326 // This field does not contain PII. This is a system server class name.
5327 optional string handler_class_name = 2;
5328
5329 // The name of the thread that runs the Looper.
5330 //
5331 // This field does not contain PII. This is a system server thread name.
5332 optional string looper_thread_name = 3;
5333
5334 // The name of the dispatched message.
5335 //
5336 // This field does not contain PII. This is a system server constant or class
5337 // name.
5338 optional string message_name = 4;
5339
5340 // Total number of successfully dispatched messages.
5341 optional int64 message_count = 5;
5342
5343 // Total number of messages that failed dispatching.
5344 optional int64 exception_count = 6;
5345
5346 // Total number of processed messages we have data recorded for. If we
5347 // collected data for all the messages, message_count will be equal to
5348 // recorded_message_count.
5349 //
5350 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005351 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005352 optional int64 recorded_message_count = 7;
5353
5354 // Total latency of all processed messages.
5355 // Average can be computed using recorded_total_latency_micros /
5356 // recorded_message_count.
5357 optional int64 recorded_total_latency_micros = 8;
5358
5359 // Total CPU usage of all processed message.
5360 // Average can be computed using recorded_total_cpu_micros /
5361 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005362 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005363 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005364
5365 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5366 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005367
5368 // Max recorded CPU usage of all processed messages.
5369 optional int64 recorded_max_cpu_micros = 11;
5370
5371 // Max recorded latency of all processed messages.
5372 optional int64 recorded_max_latency_micros = 12;
5373
5374 // Total number of messages we tracked the dispatching delay for. If we
5375 // collected data for all the messages, message_count will be equal to
5376 // recorded_delay_message_count.
5377 //
5378 // If recorded_delay_message_count is different than message_count, it means data
5379 // collection has been sampled or/and not all messages specified the target dispatch time.
5380 // The fields below will be sampled in this case.
5381 optional int64 recorded_delay_message_count = 13;
5382
5383 // Total dispatching delay of all processed messages.
5384 // Calculated as a difference between the target dispatching time (Message.when)
5385 // and the actual dispatching time.
5386 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5387 optional int64 recorded_total_delay_millis = 14;
5388
5389 // Max dispatching delay of all processed messages.
5390 // Calculated as a difference between the target dispatching time (Message.when)
5391 // and the actual dispatching time.
5392 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005393}
Tej Singh86dc9db2018-09-06 00:39:57 +00005394
5395/**
5396 * Pulls disk information, such as write speed and latency.
5397 */
5398message DiskStats {
5399 // Time taken to open, write 512B to, and close a file.
5400 // -1 if error performing the check.
5401 optional int64 data_write_latency_millis = 1;
5402
5403 optional bool file_based_encryption = 2;
5404
5405 // Recent disk write speed in kB/s.
5406 // -1 if error querying storageed.
5407 // 0 if data is unavailable.
5408 optional int32 recent_disk_write_speed = 3;
5409}
5410
5411
5412/**
5413 * Free and total bytes of the Data, Cache, and System partition.
5414 */
5415message DirectoryUsage {
5416 enum Directory {
5417 UNKNOWN = 0;
5418 DATA = 1;
5419 CACHE = 2;
5420 SYSTEM = 3;
5421 }
5422 optional Directory directory = 1;
5423 optional int64 free_bytes = 2;
5424 optional int64 total_bytes = 3;
5425}
5426
5427
5428/**
5429 * Size of an application: apk size, data size, and cache size.
5430 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5431 * Information is only reported for apps with the primary user (user 0).
5432 * Sizes are aggregated by package name.
5433 */
5434message AppSize {
5435 // Including uids will involve modifying diskstats logic.
5436 optional string package_name = 1;
5437 // App size in bytes. -1 if unavailable.
5438 optional int64 app_size_bytes = 2;
5439 // App data size in bytes. -1 if unavailable.
5440 optional int64 app_data_size_bytes = 3;
5441 // App cache size in bytes. -1 if unavailable.
5442 optional int64 app_cache_size_bytes = 4;
5443 // Time that the cache file was produced.
5444 // Uses System.currentTimeMillis(), which is wall clock time.
5445 optional int64 cache_time_millis = 5;
5446}
5447
5448
5449/**
5450 * Size of a particular category. Eg: photos, videos.
5451 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5452 */
5453message CategorySize {
5454 enum Category {
5455 UNKNOWN = 0;
5456 APP_SIZE = 1;
5457 APP_DATA_SIZE = 2;
5458 APP_CACHE_SIZE = 3;
5459 PHOTOS = 4;
5460 VIDEOS = 5;
5461 AUDIO = 6;
5462 DOWNLOADS = 7;
5463 SYSTEM = 8;
5464 OTHER = 9;
5465 }
5466 optional Category category = 1;
5467 // Category size in bytes.
5468 optional int64 size_bytes = 2;
5469 // Time that the cache file was produced.
5470 // Uses System.currentTimeMillis(), which is wall clock time.
5471 optional int64 cache_time_millis = 3;
5472}
Tej Singhd6d6d772018-09-05 17:41:25 -07005473
5474/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005475 * Pulls per uid I/O stats. The stats are cumulative since boot.
5476 *
5477 * Read/write bytes are I/O events from a storage device
5478 * Read/write chars are data requested by read/write syscalls, and can be
5479 * satisfied by caching.
5480 *
5481 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5482 */
5483message DiskIo {
5484 optional int32 uid = 1 [(is_uid) = true];
5485 optional int64 fg_chars_read = 2;
5486 optional int64 fg_chars_write = 3;
5487 optional int64 fg_bytes_read = 4;
5488 optional int64 fg_bytes_write = 5;
5489 optional int64 bg_chars_read = 6;
5490 optional int64 bg_chars_write = 7;
5491 optional int64 bg_bytes_read = 8;
5492 optional int64 bg_bytes_write = 9;
5493 optional int64 fg_fsync = 10;
5494 optional int64 bg_fsync= 11;
5495}
5496
5497
5498/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005499 * Pulls the number of fingerprints for each user.
5500 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005501 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005502 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005503message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005504 // The associated user. Eg: 0 for owners, 10+ for others.
5505 // Defined in android/os/UserHandle.java
5506 optional int32 user = 1;
5507 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005508 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005509}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005510
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005511/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005512 * Pulls the number of faces for each user.
5513 *
5514 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5515 */
5516message NumFacesEnrolled {
5517 // The associated user. Eg: 0 for owners, 10+ for others.
5518 // Defined in android/os/UserHandle.java
5519 optional int32 user = 1;
5520 // Number of faces registered to that user.
5521 optional int32 num_faces_enrolled = 2;
5522}
5523/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005524 * A mapping of role holder -> role
5525 */
5526message RoleHolder {
5527 // uid of the role holder
5528 optional int32 uid = 1 [(is_uid) = true];
5529
5530 // package name of the role holder
5531 optional string package_name = 2;
5532
5533 // the role held
5534 optional string role = 3;
5535}
5536
Yangsteraf9aee72018-10-12 09:26:16 -07005537message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005538 // These are all in byte resolution.
5539 optional int64 min = 1 [deprecated = true];
5540 optional int64 average = 2 [deprecated = true];
5541 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005542
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005543 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5544 // int64 fields.
5545 optional int32 mean_kb = 4;
5546 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005547}
5548
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005549// A reduced subset of process states; reducing the number of possible states allows more
5550// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5551enum ProcessStateAggregated {
5552 PROCESS_STATE_UNKNOWN = 0;
5553 // Persistent system process.
5554 PROCESS_STATE_PERSISTENT = 1;
5555 // Top activity; actually any visible activity.
5556 PROCESS_STATE_TOP = 2;
5557 // Process binding to top or a foreground service.
5558 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5559 // Processing running a foreground service.
5560 PROCESS_STATE_FGS = 4;
5561 // Important foreground process (ime, wallpaper, etc).
5562 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5563 // Important background process.
5564 PROCESS_STATE_BACKGROUND = 6;
5565 // Process running a receiver.
5566 PROCESS_STATE_RECEIVER = 7;
5567 // All kinds of cached processes.
5568 PROCESS_STATE_CACHED = 8;
5569}
5570
5571// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005572message ProcessStatsStateProto {
5573 optional android.service.procstats.ScreenState screen_state = 1;
5574
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005575 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005576
5577 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5578 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005579 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5580
5581 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005582
5583 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005584 optional int64 duration_millis = 4 [deprecated = true];
5585 // Same as above, but with minute resolution so it fits into an int32.
5586 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005587
5588 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005589 optional int64 realtime_duration_millis = 9 [deprecated = true];
5590 // Same as above, but with minute resolution so it fits into an int32.
5591 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005592
5593 // # of samples taken
5594 optional int32 sample_size = 5;
5595
5596 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005597 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005598
5599 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005600 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005601
5602 // RSS is memory resident for this process
5603 optional AggStats rss = 8;
5604}
5605
5606// Next Tag: 7
5607message ProcessStatsProto {
5608 // Name of process.
5609 optional string process = 1;
5610
5611 // Uid of the process.
5612 optional int32 uid = 2;
5613
5614 // Information about how often kills occurred
5615 message Kill {
5616 // Count of excessive CPU kills
5617 optional int32 cpu = 1;
5618
5619 // Count of kills when cached
5620 optional int32 cached = 2;
5621
5622 // PSS stats during cached kill
5623 optional AggStats cached_pss = 3;
5624 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005625 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005626
5627 // Time and memory spent in various states.
5628 repeated ProcessStatsStateProto states = 5;
5629
5630 // Total time process has been running... screen_state, memory_state, and process_state
5631 // will not be set.
5632 optional ProcessStatsStateProto total_running_state = 6;
5633}
5634
5635message PackageServiceOperationStatsProto {
5636 // Operate enum: Started, Foreground, Bound, Executing
5637 optional android.service.procstats.ServiceOperationState operation = 1;
5638
5639 // Number of times the service was in this operation.
5640 optional int32 count = 2;
5641
5642 // Information about a state the service can be in.
5643 message StateStats {
5644 // Screen state enum.
5645 optional android.service.procstats.ScreenState screen_state = 1;
5646 // Memory state enum.
5647 optional android.service.procstats.MemoryState memory_state = 2;
5648
5649 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005650 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005651 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005652 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005653 }
5654 repeated StateStats state_stats = 3;
5655}
5656
5657message PackageServiceStatsProto {
5658 // Name of service component.
5659 optional string service_name = 1;
5660
5661 // The operation stats.
5662 // The package_name, package_uid, package_version, service_name will not be set to save space.
5663 repeated PackageServiceOperationStatsProto operation_stats = 2;
5664}
5665
5666message PackageAssociationSourceProcessStatsProto {
5667 // Uid of the process.
5668 optional int32 process_uid = 1;
5669 // Process name.
5670 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005671 // Package name.
5672 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005673 // Total count of the times this association appeared.
5674 optional int32 total_count = 3;
5675
5676 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005677 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005678
5679 // Total count of the times this association became actively impacting its target process.
5680 optional int32 active_count = 5;
5681
5682 // Information on one source in this association.
5683 message StateStats {
5684 // Process state enum.
5685 optional android.service.procstats.ProcessState process_state = 1;
5686 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005687 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005688 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005689 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005690 }
5691 repeated StateStats active_state_stats = 6;
5692}
5693
5694message PackageAssociationProcessStatsProto {
5695 // Name of the target component.
5696 optional string component_name = 1;
5697 // Information on one source in this association.
5698 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5699}
5700
5701
5702message ProcessStatsPackageProto {
5703 // Name of package.
5704 optional string package = 1;
5705
5706 // Uid of the package.
5707 optional int32 uid = 2;
5708
5709 // Version of the package.
5710 optional int64 version = 3;
5711
5712 // Stats for each process running with the package loaded in to it.
5713 repeated ProcessStatsProto process_stats = 4;
5714
5715 // Stats for each of the package's services.
5716 repeated PackageServiceStatsProto service_stats = 5;
5717
5718 // Stats for each association with the package.
5719 repeated PackageAssociationProcessStatsProto association_stats = 6;
5720}
5721
5722message ProcessStatsSectionProto {
5723 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005724 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005725
5726 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005727 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005728
5729 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005730 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005731
5732 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005733 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005734
5735 // System runtime library. e.g. "libdvm.so", "libart.so".
5736 optional string runtime = 5;
5737
5738 // whether kernel reports swapped pss.
5739 optional bool has_swapped_pss = 6;
5740
5741 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5742 enum Status {
5743 STATUS_UNKNOWN = 0;
5744 STATUS_COMPLETE = 1;
5745 STATUS_PARTIAL = 2;
5746 STATUS_SHUTDOWN = 3;
5747 STATUS_SYSPROPS = 4;
5748 }
5749 repeated Status status = 7;
5750
Chenjie Yub2ecc792019-01-17 10:27:26 -08005751 // Number of pages available of various types and sizes, representation fragmentation.
5752 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5753
Yangsteraf9aee72018-10-12 09:26:16 -07005754 // Stats for each process.
5755 repeated ProcessStatsProto process_stats = 8;
5756
5757 // Stats for each package.
5758 repeated ProcessStatsPackageProto package_stats = 9;
5759}
5760
Chenjie Yub2ecc792019-01-17 10:27:26 -08005761message ProcessStatsAvailablePagesProto {
5762 // Node these pages are in (as per /proc/pagetypeinfo)
5763 optional int32 node = 1;
5764
5765 // Zone these pages are in (as per /proc/pagetypeinfo)
5766 optional string zone = 2;
5767
5768 // Label for the type of these pages (as per /proc/pagetypeinfo)
5769 optional string label = 3;
5770
5771 // Distribution of number of pages available by order size. First entry in array is
5772 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5773 repeated int32 pages_per_order = 4;
5774}
5775
Chenjie Yu12e5e672018-09-14 15:54:59 -07005776/**
5777 * Pulled from ProcessStatsService.java
5778 */
5779message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005780 optional ProcessStatsSectionProto proc_stats_section = 1;
5781}
5782
Chenjie Yuf910b7802019-01-11 16:08:20 -08005783/**
5784 * Pulled from ProcessStatsService.java
5785 */
5786message ProcStatsPkgProc {
5787 optional ProcessStatsSectionProto proc_stats_section = 1;
5788}
5789
Chris Wrencdea3b72019-11-22 16:58:17 -05005790// Next Tag: 2
5791message PackageRemoteViewInfoProto {
5792 optional string package_name = 1;
5793 // add per-package additional info here (like channels)
5794}
5795
5796// Next Tag: 2
5797message NotificationRemoteViewsProto {
5798 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5799}
5800
5801/**
5802 * Pulled from NotificationManagerService.java
5803 */
5804message NotificationRemoteViews {
5805 optional NotificationRemoteViewsProto notification_remote_views = 1;
5806}
5807
Yotam Aron74299972020-01-16 16:20:58 +02005808/**
5809 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5810 */
5811message PackageNotificationPreferences {
5812 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005813 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005814 // Notification importance, which specifies when and how a notification is displayed.
5815 // Specified under core/java/android/app/NotificationManager.java.
5816 optional int32 importance = 2;
5817 // Lockscreen visibility as set by the user.
5818 optional int32 visibility = 3;
5819 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5820 // PreferencesHelper.java)
5821 optional int32 user_locked_fields = 4;
5822}
5823
5824/**
5825 * Atom that contains a list of a package's channel preferences, pulled from
5826 * NotificationManagerService.java.
5827 */
5828message PackageNotificationChannelPreferences {
5829 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005830 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005831 // Channel's ID. Should always be available.
5832 optional string channel_id = 2;
5833 // Channel's name. Should always be available.
5834 optional string channel_name = 3;
5835 // Channel's description. Optionally set by the channel creator.
5836 optional string description = 4;
5837 // Notification importance, which specifies when and how a notification is displayed. Specified
5838 // under core/java/android/app/NotificationManager.java.
5839 optional int32 importance = 5;
5840 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5841 // at core/java/android/app/NotificationChannel.java
5842 optional int32 user_locked_fields = 6;
5843 // Indicates if the channel was deleted by the app.
5844 optional bool is_deleted = 7;
5845}
5846
5847/**
5848 * Atom that contains a list of a package's channel group preferences, pulled from
5849 * NotificationManagerService.java.
5850 */
5851message PackageNotificationChannelGroupPreferences {
5852 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005853 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005854 // Channel Group's ID. Should always be available.
5855 optional string group_id = 2;
5856 // Channel Group's name. Should always be available.
5857 optional string group_name = 3;
5858 // Channel Group's description. Optionally set by group creator.
5859 optional string description = 4;
5860 // Indicates if notifications from this channel group are blocked.
5861 optional bool is_blocked = 5;
5862 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5863 // at core/java/android/app/NotificationChannelGroup.java
5864 optional int32 user_locked_fields = 6;
5865}
5866
Yangsteraf9aee72018-10-12 09:26:16 -07005867message PowerProfileProto {
5868 optional double cpu_suspend = 1;
5869
5870 optional double cpu_idle = 2;
5871
5872 optional double cpu_active = 3;
5873
5874 message CpuCluster {
5875 optional int32 id = 1;
5876 optional double cluster_power = 2;
5877 optional int32 cores = 3;
5878 repeated int64 speed = 4;
5879 repeated double core_power = 5;
5880 }
5881
5882 repeated CpuCluster cpu_cluster = 40;
5883
5884 optional double wifi_scan = 4;
5885
5886 optional double wifi_on = 5;
5887
5888 optional double wifi_active = 6;
5889
5890 optional double wifi_controller_idle = 7;
5891
5892 optional double wifi_controller_rx = 8;
5893
5894 optional double wifi_controller_tx = 9;
5895
5896 repeated double wifi_controller_tx_levels = 10;
5897
5898 optional double wifi_controller_operating_voltage = 11;
5899
5900 optional double bluetooth_controller_idle = 12;
5901
5902 optional double bluetooth_controller_rx = 13;
5903
5904 optional double bluetooth_controller_tx = 14;
5905
5906 optional double bluetooth_controller_operating_voltage = 15;
5907
5908 optional double modem_controller_sleep = 16;
5909
5910 optional double modem_controller_idle = 17;
5911
5912 optional double modem_controller_rx = 18;
5913
5914 repeated double modem_controller_tx = 19;
5915
5916 optional double modem_controller_operating_voltage = 20;
5917
5918 optional double gps_on = 21;
5919
5920 repeated double gps_signal_quality_based = 22;
5921
5922 optional double gps_operating_voltage = 23;
5923
5924 optional double bluetooth_on = 24;
5925
5926 optional double bluetooth_active = 25;
5927
5928 optional double bluetooth_at_cmd = 26;
5929
5930 optional double ambient_display = 27;
5931
5932 optional double screen_on = 28;
5933
5934 optional double radio_on = 29;
5935
5936 optional double radio_scanning = 30;
5937
5938 optional double radio_active = 31;
5939
5940 optional double screen_full = 32;
5941
5942 optional double audio = 33;
5943
5944 optional double video = 34;
5945
5946 optional double flashlight = 35;
5947
5948 optional double memory = 36;
5949
5950 optional double camera = 37;
5951
5952 optional double wifi_batched_scan = 38;
5953
5954 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005955}
Chenjie Yuab530202018-09-26 12:39:20 -07005956
5957/**
5958 * power_profile.xml and other constants for power model calculations.
5959 * Pulled from PowerProfile.java
5960 */
5961message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005962 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005963}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005964
5965/**
arangelovd5db50e2018-10-12 20:24:39 +01005966 * Logs when a user restriction was added or removed.
5967 *
5968 * Logged from:
5969 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5970 */
5971message UserRestrictionChanged {
5972 // The raw string of the user restriction as defined in UserManager.
5973 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5974 optional string restriction = 1;
5975 // Whether the restriction is enabled or disabled.
5976 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005977}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005978
5979/**
5980 * Pulls process user time and system time. Puller takes a snapshot of all pids
5981 * in the system and returns cpu stats for those that are working at the time.
5982 * Dead pids will be dropped. Kernel processes are excluded.
5983 * Min cool-down is 5 sec.
5984 */
5985message ProcessCpuTime {
5986 optional int32 uid = 1 [(is_uid) = true];
5987
5988 optional string process_name = 2;
5989 // Process cpu time in user space, cumulative from boot/process start
5990 optional int64 user_time_millis = 3;
5991 // Process cpu time in system space, cumulative from boot/process start
5992 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005993}
Misha Wagner5a51e002018-10-03 15:04:09 +01005994
5995/**
5996 * Pulls the CPU usage for each thread.
5997 *
5998 * Read from /proc/$PID/task/$TID/time_in_state files.
5999 *
6000 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6001 * time_in_state files not being present on some phones, have not been addressed. These should be
6002 * considered before a public release.
6003 */
6004message CpuTimePerThreadFreq {
6005 // UID that owns the process.
6006 optional int32 uid = 1 [(is_uid) = true];
6007 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006008 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006009 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006010 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006011 // Name of the process taken from `/proc/$PID/cmdline`.
6012 optional string process_name = 4;
6013 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6014 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006015
6016 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6017 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6018 // frequencies are given here as the alternative is sending eight separate atoms. This method
6019 // significantly reduces the amount of data created
6020 optional int32 frequency1_khz = 6;
6021 optional int32 time1_millis = 7;
6022 optional int32 frequency2_khz = 8;
6023 optional int32 time2_millis = 9;
6024 optional int32 frequency3_khz = 10;
6025 optional int32 time3_millis = 11;
6026 optional int32 frequency4_khz = 12;
6027 optional int32 time4_millis = 13;
6028 optional int32 frequency5_khz = 14;
6029 optional int32 time5_millis = 15;
6030 optional int32 frequency6_khz = 16;
6031 optional int32 time6_millis = 17;
6032 optional int32 frequency7_khz = 18;
6033 optional int32 time7_millis = 19;
6034 optional int32 frequency8_khz = 20;
6035 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006036}
Bookatz75ee60422018-11-09 12:27:37 -08006037
6038/**
Bookatz366a4432018-11-20 09:42:33 -08006039 * Pulls information about the device's build.
6040 */
6041message BuildInformation {
6042 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6043 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6044 optional string fingerprint = 1;
6045
6046 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6047 optional string brand = 2;
6048
6049 // Build.PRODUCT. The name of the overall product.
6050 optional string product = 3;
6051
6052 // Build.DEVICE. The name of the industrial design.
6053 optional string device = 4;
6054
6055 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6056 optional string version_release = 5;
6057
6058 // Build.ID. E.g. a label like "M4-rc20".
6059 optional string id = 6;
6060
6061 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6062 // represent this build.
6063 optional string version_incremental = 7;
6064
6065 // Build.TYPE. The type of build, like "user" or "eng".
6066 optional string type = 8;
6067
6068 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6069 optional string tags = 9;
6070}
6071
6072/**
Adam He420947c2019-01-23 15:59:09 -08006073 * Logs information about mismatched caller for content capture.
6074 *
6075 * Logged from:
6076 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6077 */
6078message ContentCaptureCallerMismatchReported {
6079 optional string intended_package = 1;
6080 optional string calling_package = 2;
6081}
6082
6083/**
6084 * Logs information about content capture service events.
6085 *
6086 * Logged from:
6087 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6088 */
6089message ContentCaptureServiceEvents {
6090 // The type of event.
6091 enum Event {
6092 UNKNOWN = 0;
6093 ON_CONNECTED = 1;
6094 ON_DISCONNECTED = 2;
6095 SET_WHITELIST = 3;
6096 SET_DISABLED = 4;
6097 ON_USER_DATA_REMOVED = 5;
6098 }
6099 optional Event event = 1;
6100 // component/package of content capture service.
6101 optional string service_info = 2;
6102 // component/package of target.
6103 // it's a concatenated list of component/package for SET_WHITELIST event
6104 // separated by " ".
6105 optional string target_info = 3;
6106}
6107
6108/**
6109 * Logs information about content capture session events.
6110 *
6111 * Logged from:
6112 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6113 */
6114message ContentCaptureSessionEvents {
6115 // The type of event.
6116 enum Event {
6117 UNKNOWN = 0;
6118 ON_SESSION_STARTED = 1;
6119 ON_SESSION_FINISHED = 2;
6120 SESSION_NOT_CREATED = 3;
6121 }
6122 optional int32 session_id = 1;
6123 optional Event event = 2;
6124 // (n/a on session finished)
6125 optional int32 state_flags = 3;
6126 // component/package of content capture service.
6127 optional string service_info = 4;
6128 // component/package of app.
6129 // (n/a on session finished)
6130 optional string app_info = 5;
6131 optional bool is_child_session = 6;
6132}
6133
6134/**
6135 * Logs information about session being flushed.
6136 *
6137 * Logged from:
6138 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6139 */
6140message ContentCaptureFlushed {
6141 optional int32 session_id = 1;
6142 // component/package of content capture service.
6143 optional string service_info = 2;
6144 // component/package of app.
6145 optional string app_info = 3;
6146 // session start/finish events
6147 optional int32 child_session_started = 4;
6148 optional int32 child_session_finished = 5;
6149 // count of view events.
6150 optional int32 view_appeared_count = 6;
6151 optional int32 view_disappeared_count = 7;
6152 optional int32 view_text_changed_count = 8;
6153
6154 // Flush stats.
6155 optional int32 max_events = 9;
6156 optional int32 idle_flush_freq = 10;
6157 optional int32 text_flush_freq = 11;
6158 optional int32 flush_reason = 12;
6159}
6160
6161/**
Bookatz75ee60422018-11-09 12:27:37 -08006162 * Pulls on-device BatteryStats power use calculations for the overall device.
6163 */
6164message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006165 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6166 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6167 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6168 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006169}
6170
6171/**
6172 * Pulls on-device BatteryStats power use calculations broken down by uid.
6173 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6174 * that is attributed to non-uid items. They must all be included to get the total power use.
6175 */
6176message DeviceCalculatedPowerBlameUid {
6177 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6178 optional int32 uid = 1 [(is_uid) = true];
6179
Bookatz3dbc13a2018-12-21 12:16:51 -08006180 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6181 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6182 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006183}
6184
6185/**
6186 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6187 * drain type.
6188 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6189 * is attributed uids. They must all be included to get the total power use.
6190 */
6191message DeviceCalculatedPowerBlameOther {
6192 // The type of item whose power use is being reported.
6193 enum DrainType {
6194 AMBIENT_DISPLAY = 0;
6195 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6196 BLUETOOTH = 2;
6197 CAMERA = 3;
6198 // Cell-standby
6199 CELL = 4;
6200 FLASHLIGHT = 5;
6201 IDLE = 6;
6202 MEMORY = 7;
6203 // Amount that total computed drain exceeded the drain estimated using the
6204 // battery level changes and capacity.
6205 OVERCOUNTED = 8;
6206 PHONE = 9;
6207 SCREEN = 10;
6208 // Amount that total computed drain was below the drain estimated using the
6209 // battery level changes and capacity.
6210 UNACCOUNTED = 11;
6211 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6212 WIFI = 13;
6213 }
6214 optional DrainType drain_type = 1;
6215
Bookatz3dbc13a2018-12-21 12:16:51 -08006216 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6217 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6218 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006219}
arangelov4e994062018-11-13 16:12:38 +00006220
6221/**
6222 * Logs device policy features.
6223 *
6224 * Logged from:
6225 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6226 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6227 */
6228message DevicePolicyEvent {
6229 // The event id - unique for each event.
6230 optional android.stats.devicepolicy.EventId event_id = 1;
6231 // The admin package name.
6232 optional string admin_package_name = 2;
6233 // A generic integer parameter.
6234 optional int32 integer_value = 3;
6235 // A generic boolean parameter.
6236 optional bool boolean_value = 4;
6237 // A parameter specifying a time period in milliseconds.
6238 optional uint64 time_period_millis = 5;
6239 // A parameter specifying a list of package names, bundle extras or string parameters.
6240 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6241}
shawnlinea5b66b2018-11-13 15:05:29 +08006242
6243/**
6244 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6245 *
6246 * Logged from:
6247 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6248 */
6249message DocsUILaunchReported {
6250 optional android.stats.docsui.LaunchAction launch_action = 1;
6251 optional bool has_initial_uri = 2;
6252 optional android.stats.docsui.MimeType mime_type = 3;
6253 optional android.stats.docsui.Root initial_root = 4;
6254}
6255
6256/**
6257 * Logs root/app visited event in file managers/picker. Call this when the user
6258 * taps on root/app in hamburger menu.
6259 *
6260 * Logged from:
6261 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6262 */
6263message DocsUIRootVisitedReported {
6264 optional android.stats.docsui.ContextScope scope = 1;
6265 optional android.stats.docsui.Root root = 2;
6266}
6267
6268/**
6269 * Logs file operation stats. Call this when a file operation has completed.
6270 *
6271 * Logged from:
6272 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6273 */
6274message DocsUIFileOperationReported {
6275 optional android.stats.docsui.Provider provider = 1;
6276 optional android.stats.docsui.FileOperation file_op = 2;
6277}
6278
6279/**
6280 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6281 * mode.
6282 *
6283 * Logged from:
6284 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6285 */
6286message DocsUIFileOperationCopyMoveModeReported {
6287 optional android.stats.docsui.FileOperation file_op = 1;
6288 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6289}
6290
6291
6292/**
6293 * Logs file sub operation stats. Call this when a file operation has failed.
6294 *
6295 * Logged from:
6296 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6297 */
6298message DocsUIFileOperationFailureReported {
6299 optional android.stats.docsui.Authority authority = 1;
6300 optional android.stats.docsui.SubFileOperation sub_op = 2;
6301}
6302
6303/**
6304* Logs the cancellation of a file operation. Call this when a job is canceled
6305*
6306* Logged from:
6307* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6308*/
6309message DocsUIFileOperationCanceledReported {
6310 optional android.stats.docsui.FileOperation file_op = 1;
6311}
6312
6313/**
6314 * Logs startup time in milliseconds.
6315 *
6316 * Logged from:
6317 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6318 */
6319message DocsUIStartupMsReported {
6320 optional int32 startup_millis = 1;
6321}
6322
6323/**
6324 * Logs the action that was started by user.
6325 *
6326 * Logged from:
6327 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6328 */
6329message DocsUIUserActionReported {
6330 optional android.stats.docsui.UserAction action = 1;
6331}
6332
6333/**
6334 * Logs the invalid type when invalid scoped access is requested.
6335 *
6336 * Logged from:
6337 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6338 */
6339message DocsUIInvalidScopedAccessRequestReported {
6340 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006341}
Ben Murdochbab399f62018-12-06 11:01:38 +00006342
6343/**
shawnlina75e82d2019-01-07 10:31:12 +08006344 * Logs the package name that launches docsui picker mode.
6345 *
6346 * Logged from:
6347 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6348 */
6349message DocsUIPickerLaunchedFromReported {
6350 optional string package_name = 1;
6351}
6352
6353/**
6354 * Logs the search type.
6355 *
6356 * Logged from:
6357 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6358 */
6359message DocsUISearchTypeReported {
6360 optional android.stats.docsui.SearchType search_type = 1;
6361}
6362
6363/**
6364 * Logs the search mode.
6365 *
6366 * Logged from:
6367 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6368 */
6369message DocsUISearchModeReported {
6370 optional android.stats.docsui.SearchMode search_mode = 1;
6371}
6372
6373/**
6374 * Logs the pick result information.
6375 *
6376 * Logged from:
6377 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6378 */
6379message DocsUIPickResultReported {
6380 optional int32 total_action_count = 1;
6381 optional int64 duration_millis = 2;
6382 optional int32 file_count= 3;
6383 optional bool is_searching = 4;
6384 optional android.stats.docsui.Root picked_from = 5;
6385 optional android.stats.docsui.MimeType mime_type = 6;
6386 optional int32 repeatedly_pick_times = 7;
6387}
6388
6389/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006390 * Logs when an app's memory is compacted.
6391 *
6392 * Logged from:
6393 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6394 */
6395message AppCompacted {
6396 // The pid of the process being compacted.
6397 optional int32 pid = 1;
6398
6399 // The name of the process being compacted.
6400 optional string process_name = 2;
6401
6402 // The type of compaction.
6403 enum Action {
6404 UNKNOWN = 0;
6405 SOME = 1;
6406 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006407 PERSISTENT = 3;
6408 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006409 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006410 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006411
6412 // Total RSS in kilobytes consumed by the process prior to compaction.
6413 optional int64 before_rss_total_kilobytes = 4;
6414
6415 // File RSS in kilobytes consumed by the process prior to compaction.
6416 optional int64 before_rss_file_kilobytes = 5;
6417
6418 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6419 optional int64 before_rss_anon_kilobytes = 6;
6420
6421 // Swap in kilobytes consumed by the process prior to compaction.
6422 optional int64 before_swap_kilobytes = 7;
6423
6424 // Total RSS in kilobytes consumed by the process after compaction.
6425 optional int64 after_rss_total_kilobytes = 8;
6426
6427 // File RSS in kilobytes consumed by the process after compaction.
6428 optional int64 after_rss_file_kilobytes = 9;
6429
6430 // Anonymous RSS in kilobytes consumed by the process after compaction.
6431 optional int64 after_rss_anon_kilobytes = 10;
6432
6433 // Swap in kilobytes consumed by the process after compaction.
6434 optional int64 after_swap_kilobytes = 11;
6435
6436 // The time taken to perform compaction in milliseconds.
6437 optional int64 time_to_compact_millis = 12;
6438
6439 // The last compaction action performed for this app.
6440 optional Action last_action = 13;
6441
Ben Murdoch01720b82018-12-19 18:03:44 +00006442 // The last time that compaction was attempted on this process in milliseconds
6443 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6444 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006445
Ben Murdoch885c21b2019-03-15 18:02:04 +00006446 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006447 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006448
6449 // The process state at the time of compaction.
6450 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006451
6452 // Free ZRAM in kilobytes before compaction.
6453 optional int64 before_zram_free_kilobytes = 17;
6454
6455 // Free ZRAM in kilobytes after compaction.
6456 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006457}
lifr157fc552018-12-12 16:38:04 +08006458
6459/**
lifrb6b90b62019-03-29 00:40:17 +08006460 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6461 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6462 *
lifr1f74b052019-04-16 22:16:30 +08006463 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6464 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6465 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6466 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006467 */
6468message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006469 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006470
lifr1f74b052019-04-16 22:16:30 +08006471 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006472
6473 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006474 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006475
lifr1f74b052019-04-16 22:16:30 +08006476 // Only valid for event_type = EVENT_GETADDRINFO.
6477 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006478
lifr1f74b052019-04-16 22:16:30 +08006479 // Flags passed to android_res_nsend() defined in multinetwork.h
6480 // Only valid for event_type = EVENT_RESNSEND.
6481 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006482
lifrad9becc2019-05-20 11:04:41 +08006483 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006484
6485 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006486 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006487
6488 // Additional pass-through fields opaque to statsd.
6489 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006490 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006491
6492 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6493 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006494}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006495
6496/**
6497 * Logs when a data stall event occurs.
6498 *
6499 * Log from:
6500 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6501 */
6502message DataStallEvent {
6503 // Data stall evaluation type.
6504 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6505 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6506 optional int32 evaluation_type = 1;
6507 // See definition in data_stall_event.proto.
6508 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6509 // See definition in data_stall_event.proto.
6510 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6511 // See definition in data_stall_event.proto.
6512 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6513 // See definition in data_stall_event.proto.
6514 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6515 // See definition in data_stall_event.proto.
6516 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6517}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006518
6519/*
6520 * Logs when RescueParty resets some set of experiment flags.
6521 *
6522 * Logged from:
6523 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6524 */
6525message RescuePartyResetReported {
6526 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6527 optional int32 rescue_level = 1;
6528}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006529
6530/**
6531 * Logs when signed config is received from an APK, and if that config was applied successfully.
6532 * Logged from:
6533 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6534 */
6535message SignedConfigReported {
6536 enum Type {
6537 UNKNOWN_TYPE = 0;
6538 GLOBAL_SETTINGS = 1;
6539 }
6540 optional Type type = 1;
6541
6542 // The final status of the signed config received.
6543 enum Status {
6544 UNKNOWN_STATUS = 0;
6545 APPLIED = 1;
6546 BASE64_FAILURE_CONFIG = 2;
6547 BASE64_FAILURE_SIGNATURE = 3;
6548 SECURITY_EXCEPTION = 4;
6549 INVALID_CONFIG = 5;
6550 OLD_CONFIG = 6;
6551 SIGNATURE_CHECK_FAILED = 7;
6552 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006553 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006554 }
6555 optional Status status = 2;
6556
6557 // The version of the signed config processed.
6558 optional int32 version = 3;
6559
6560 // The package name that the config was extracted from.
6561 optional string from_package = 4;
6562
6563 enum Key {
6564 NO_KEY = 0;
6565 DEBUG = 1;
6566 PRODUCTION = 2;
6567 }
6568 // Which key was used to verify the config.
6569 optional Key verified_with = 5;
6570}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006571
6572/*
6573 * Logs GNSS Network-Initiated (NI) location events.
6574 *
6575 * Logged from:
6576 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6577 */
6578message GnssNiEventReported {
6579 // The type of GnssNiEvent.
6580 enum EventType {
6581 UNKNOWN = 0;
6582 NI_REQUEST = 1;
6583 NI_RESPONSE = 2;
6584 }
6585 optional EventType event_type = 1;
6586
6587 // An ID generated by HAL to associate NI notifications and UI responses.
6588 optional int32 notification_id = 2;
6589
6590 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006591 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006592
6593 // NI requires notification.
6594 optional bool need_notify = 4;
6595
6596 // NI requires verification.
6597 optional bool need_verify = 5;
6598
6599 // NI requires privacy override, no notification/minimal trace.
6600 optional bool privacy_override = 6;
6601
6602 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6603 // seconds.
6604 optional int32 timeout = 7;
6605
6606 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006607 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006608
6609 // String representing the requester of the network inititated location request.
6610 optional string requestor_id = 9;
6611
6612 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6613 // network initiated location request.
6614 optional string text = 10;
6615
6616 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006617 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006618
6619 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006620 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006621
6622 // True if SUPL ES is enabled.
6623 optional bool is_supl_es_enabled = 13;
6624
6625 // True if GNSS location is enabled.
6626 optional bool is_location_enabled = 14;
6627
6628 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006629 optional android.server.location.GnssUserResponseType user_response = 15;
6630}
6631
6632/**
6633 * Logs GNSS non-framework (NFW) location notification.
6634 *
6635 * Logged from:
6636 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6637 */
6638message GnssNfwNotificationReported {
6639 // Package name of the Android proxy application representing the non-framework entity that
6640 // requested location. Set to empty string if unknown.
6641 optional string proxy_app_package_name = 1;
6642
6643 // Protocol stack that initiated the non-framework location request.
6644 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6645
6646 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6647 // set to empty string. This field is opaque to the framework and used for logging purposes.
6648 optional string other_protocol_stack_name = 3;
6649
6650 // Source initiating/receiving the location information.
6651 optional android.server.location.NfwRequestor requestor = 4;
6652
6653 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6654 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6655 // and used for logging purposes.
6656 optional string requestor_id = 5;
6657
6658 // Indicates whether location information was provided for this request.
6659 optional android.server.location.NfwResponseType response_type = 6;
6660
6661 // True if the device is in user initiated emergency session.
6662 optional bool in_emergency_mode = 7;
6663
6664 // True if cached location is provided.
6665 optional bool is_cached_location = 8;
6666
6667 // True if proxy app permission mismatch between framework and GNSS HAL.
6668 optional bool is_permission_mismatched = 9;
6669}
6670
6671/**
6672 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6673 *
6674 * Logged from:
6675 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6676 */
6677message GnssConfigurationReported {
6678 // SUPL host name.
6679 optional string supl_host = 1;
6680
6681 // SUPL port number.
6682 optional int32 supl_port = 2;
6683
6684 // C2K host name.
6685 optional string c2k_host = 3;
6686
6687 // C2K port number.
6688 optional int32 c2k_port = 4;
6689
6690 // The SUPL version requested by Carrier.
6691 optional int32 supl_ver = 5;
6692
6693 // The SUPL mode.
6694 optional android.server.location.SuplMode supl_mode = 6;
6695
6696 // True if NI emergency SUPL restrictions is enabled.
6697 optional bool supl_es = 7;
6698
6699 // LTE Positioning Profile settings
6700 optional android.server.location.LppProfile lpp_profile = 8;
6701
6702 // Positioning protocol on A-Glonass system.
6703 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6704
6705 // True if emergency PDN is used. Otherwise, regular PDN is used.
6706 optional bool use_emergency_pdn_for_emergency_supl= 10;
6707
6708 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6709 optional android.server.location.GpsLock gps_lock = 11;
6710
6711 // Number of seconds to extend the emergency session duration post emergency call.
6712 optional int32 es_extension_sec = 12;
6713
6714 // The full list of package names of proxy Android applications representing the non-framework
6715 // location access entities (on/off the device) for which the framework user has granted
6716 // non-framework location access permission. The package names are concatenated in one string
6717 // with spaces as separators.
6718 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006719}
Jack Yu95b64f32018-12-13 18:26:11 +08006720
6721/**
6722 * Logs when a NFC device's error occurred.
6723 * Logged from:
6724 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6725 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6726 */
6727message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006728 enum Type {
6729 UNKNOWN = 0;
6730 CMD_TIMEOUT = 1;
6731 ERROR_NOTIFICATION = 2;
6732 AID_OVERFLOW = 3;
6733 }
6734 optional Type type = 1;
6735 // If it's nci cmd timeout, log the timeout command.
6736 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006737
Alex Salod7c3eef2019-01-25 14:43:27 -08006738 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006739}
6740
6741/**
6742 * Logs when a NFC device's state changed event
6743 * Logged from:
6744 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6745 */
6746message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006747 enum State {
6748 UNKNOWN = 0;
6749 OFF = 1;
6750 ON = 2;
6751 ON_LOCKED = 3; // Secure Nfc enabled.
6752 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6753 }
6754 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006755}
6756
6757/**
6758 * Logs when a NFC Beam Transaction occurred.
6759 * Logged from:
6760 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6761 */
6762message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006763 enum Operation {
6764 UNKNOWN = 0;
6765 SEND = 1;
6766 RECEIVE = 2;
6767 }
6768 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006769}
6770
6771/**
6772 * Logs when a NFC Card Emulation Transaction occurred.
6773 * Logged from:
6774 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6775 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6776 */
6777message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006778 enum Category {
6779 UNKNOWN = 0;
6780 HCE_PAYMENT = 1;
6781 HCE_OTHER = 2;
6782 OFFHOST = 3;
6783 }
6784 // Transaction belongs to HCE payment or HCE other category, or offhost.
6785 optional Category category = 1;
6786 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6787 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006788}
6789
6790/**
6791 * Logs when a NFC Tag event occurred.
6792 * Logged from:
6793 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6794 */
6795message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006796 enum Type {
6797 UNKNOWN = 0;
6798 URL = 1;
6799 BT_PAIRING = 2;
6800 PROVISION = 3;
6801 WIFI_CONNECT = 4;
6802 APP_LAUNCH = 5;
6803 OTHERS = 6;
6804 }
6805 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006806}
6807
6808/**
6809 * Logs when Hce transaction triggered
6810 * Logged from:
6811 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6812 */
6813message NfcHceTransactionOccurred {
6814 // The latency period(in microseconds) it took for the first HCE data
6815 // exchange.
6816 optional uint32 latency_micros = 1;
6817}
6818
6819/**
6820 * Logs when SecureElement state event changed
6821 * Logged from:
6822 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6823 */
6824message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006825 enum State {
6826 UNKNOWN = 0;
6827 INITIALIZED = 1;
6828 DISCONNECTED = 2;
6829 CONNECTED = 3;
6830 HALCRASH = 4;
6831 }
6832 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006833
Alex Salod7c3eef2019-01-25 14:43:27 -08006834 optional string state_change_reason = 2;
6835 // SIMx or eSEx.
6836 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006837}
6838
6839/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006840 * Information about a permission grant request
6841 */
6842message PermissionGrantRequestResultReported {
6843 // unique value identifying an API call. A API call might result in multiple of these atoms
6844 optional int64 request_id = 1;
6845
6846 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006847 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006848
6849 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006850 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006851
6852 // The permission to be granted
6853 optional string permission_name = 4;
6854
6855 // If the permission was explicitly requested via the API or added by the system
6856 optional bool is_implicit = 5;
6857
6858 enum Result {
6859 UNDEFINED = 0;
6860 // permission request was ignored
6861 IGNORED = 1;
6862 // permission request was ignored because it was user fixed
6863 IGNORED_USER_FIXED = 2;
6864 // permission request was ignored because it was policy fixed
6865 IGNORED_POLICY_FIXED = 3;
6866 // permission was granted by user action
6867 USER_GRANTED = 4;
6868 // permission was automatically granted
6869 AUTO_GRANTED = 5;
6870 // permission was denied by user action
6871 USER_DENIED = 6;
6872 // permission was denied with prejudice by the user
6873 USER_DENIED_WITH_PREJUDICE = 7;
6874 // permission was automatically denied
6875 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006876 // permission request was ignored because permission is restricted
6877 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006878 // one time permission was granted by user action
6879 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006880 // user ignored request by leaving the request screen without choosing any option
6881 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006882 // user granted the permission after being linked to settings
6883 USER_GRANTED_IN_SETTINGS = 12;
6884 // user denied the permission after being linked to settings
6885 USER_DENIED_IN_SETTINGS = 13;
6886 // user denied the permission with prejudice after being linked to settings
6887 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6888 // permission was automatically revoked after one-time permission expired
6889 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006890 // permission was automatically revoked for unused app
6891 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006892 }
6893 // The result of the permission grant
6894 optional Result result = 6;
6895}
6896
6897/**
Jack Yu95b64f32018-12-13 18:26:11 +08006898 * Logs when Omapi API used
6899 * Logged from:
6900 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6901 */
6902message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006903 enum Operation {
6904 UNKNOWN = 0;
6905 OPEN_CHANNEL = 1;
6906 }
6907 optional Operation operation = 1;
6908 // SIMx or eSEx.
6909 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006910
Alex Salod7c3eef2019-01-25 14:43:27 -08006911 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006912}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006913
6914/**
Alex Saloa060aee2019-01-21 14:36:41 -08006915 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6916 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006917 * Logged from:
6918 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6919 */
6920message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006921 optional int64 dispatch_latency_millis = 1;
6922}
6923
6924/**
6925 * Logs AttentionManagerService attention check result.
6926 *
6927 * Logged from:
6928 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6929 */
6930message AttentionManagerServiceResultReported {
6931 // See core/java/android/service/attention/AttentionService.java
6932 enum AttentionCheckResult {
6933 UNKNOWN = 20;
6934 ATTENTION_SUCCESS_ABSENT = 0;
6935 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006936 ATTENTION_FAILURE_UNKNOWN = 2;
6937 ATTENTION_FAILURE_CANCELLED = 3;
6938 ATTENTION_FAILURE_PREEMPTED = 4;
6939 ATTENTION_FAILURE_TIMED_OUT = 5;
6940 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006941 }
6942 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006943}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006944
6945/**
6946 * Logs when an adb connection changes state.
6947 *
6948 * Logged from:
6949 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6950 */
6951message AdbConnectionChanged {
6952 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6953 // previously selected for this system.
6954 optional int64 last_connection_time_millis = 1;
6955
6956 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6957 // to reconnect via adb without user interaction.
6958 optional int64 auth_window_millis = 2;
6959
6960 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6961 optional android.debug.AdbConnectionStateEnum state = 3;
6962
6963 // True if the 'always allow' option was selected for this system.
6964 optional bool always_allow = 4;
6965}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006966
6967/*
6968 * Logs the reported speech DSP status.
6969 *
6970 * Logged from:
6971 * Vendor audio implementation.
6972 */
6973message SpeechDspStatReported {
6974 // The total Speech DSP uptime in milliseconds.
6975 optional int32 total_uptime_millis = 1;
6976 // The total Speech DSP downtime in milliseconds.
6977 optional int32 total_downtime_millis = 2;
6978 optional int32 total_crash_count = 3;
6979 optional int32 total_recover_count = 4;
6980}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006981
6982/**
6983 * Logs USB connector contaminant status.
6984 *
6985 * Logged from: USB Service.
6986 */
6987message UsbContaminantReported {
6988 optional string id = 1;
6989 optional android.service.usb.ContaminantPresenceStatus status = 2;
6990}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006991
6992/**
6993 * This atom is for debugging purpose.
6994 */
6995message DebugElapsedClock {
6996 // Monotically increasing value for each pull.
6997 optional int64 pull_count = 1;
6998 // Time from System.elapsedRealtime.
6999 optional int64 elapsed_clock_millis = 2;
7000 // Time from System.elapsedRealtime.
7001 optional int64 same_elapsed_clock_millis = 3;
7002 // Diff between current elapsed time and elapsed time from previous pull.
7003 optional int64 elapsed_clock_diff_millis = 4;
7004
7005 enum Type {
7006 TYPE_UNKNOWN = 0;
7007 ALWAYS_PRESENT = 1;
7008 PRESENT_ON_ODD_PULLS = 2;
7009 }
7010 // Type of behavior for the pulled data.
7011 optional Type type = 5;
7012}
7013
7014/**
7015 * This atom is for debugging purpose.
7016 */
7017message DebugFailingElapsedClock {
7018 // Monotically increasing value for each pull.
7019 optional int64 pull_count = 1;
7020 // Time from System.elapsedRealtime.
7021 optional int64 elapsed_clock_millis = 2;
7022 // Time from System.elapsedRealtime.
7023 optional int64 same_elapsed_clock_millis = 3;
7024 // Diff between current elapsed time and elapsed time from previous pull.
7025 optional int64 elapsed_clock_diff_millis = 4;
7026}
Steven Wuacef6bb2019-01-23 14:21:17 -05007027
7028/** Logs System UI bubbles event changed.
7029 *
7030 * Logged from:
7031 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7032 */
7033message BubbleUIChanged {
7034
7035 // The app package that is posting the bubble.
7036 optional string package_name = 1;
7037
7038 // The notification channel that is posting the bubble.
7039 optional string notification_channel = 2;
7040
7041 // The notification id associated with the posted bubble.
7042 optional int32 notification_id = 3;
7043
7044 // The position of the bubble within the bubble stack.
7045 optional int32 position = 4;
7046
7047 // The total number of bubbles within the bubble stack.
7048 optional int32 total_number = 5;
7049
7050 // User interactions with the bubble.
7051 enum Action {
7052 UNKNOWN = 0;
7053 POSTED = 1;
7054 UPDATED = 2;
7055 EXPANDED = 3;
7056 COLLAPSED = 4;
7057 DISMISSED = 5;
7058 STACK_DISMISSED = 6;
7059 STACK_MOVED = 7;
7060 HEADER_GO_TO_APP = 8;
7061 HEADER_GO_TO_SETTINGS = 9;
7062 PERMISSION_OPT_IN = 10;
7063 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007064 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007065 SWIPE_LEFT = 13;
7066 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007067 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007068 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007069 }
7070 optional Action action = 6;
7071
7072 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7073 optional float normalized_x_position = 7;
7074 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007075
7076 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7077 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007078
7079 // Whether the bubble is an on-going one.
7080 optional bool is_ongoing = 10;
7081
7082 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007083 // This is deprecated and the value should be ignored.
7084 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007085}
Kweku Adams8845d012018-12-11 20:06:45 -08007086
7087/**
Steven Wu552f63f2019-02-05 13:41:36 -05007088 * Logs System UI bubbles developer errors.
7089 *
7090 * Logged from:
7091 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7092 */
7093message BubbleDeveloperErrorReported {
7094
7095 // The app package that is posting the bubble.
7096 optional string package_name = 1;
7097
7098 // Bubble developer error type enums.
7099 enum Error {
7100 UNKNOWN = 0;
7101 ACTIVITY_INFO_MISSING = 1;
7102 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7103 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7104 }
7105 optional Error error = 2 [default = UNKNOWN];
7106}
7107
7108/**
Kweku Adams8845d012018-12-11 20:06:45 -08007109 * Logs that a constraint for a scheduled job has changed.
7110 *
7111 * Logged from:
7112 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7113 */
7114message ScheduledJobConstraintChanged {
7115 repeated AttributionNode attribution_node = 1;
7116
7117 // Name of the job.
7118 optional string job_name = 2;
7119
7120 optional com.android.server.job.ConstraintEnum constraint = 3;
7121
7122 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007123 UNKNOWN = 0;
7124 UNSATISFIED = 1;
7125 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007126 }
7127 optional State state = 4;
7128}
Alex Salod7c3eef2019-01-25 14:43:27 -08007129
7130/**
7131 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7132 * returns true.
7133 *
7134 * Logged from:
7135 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7136 */
7137message ScreenTimeoutExtensionReported {
7138 // Describes how many times in a row did the power manager reset the screen off timeout.
7139 optional uint32 consecutive_timeout_extended_count = 1;
7140}
Hui Yu885aca12019-01-10 17:11:34 -08007141
7142/*
7143* Logs number of milliseconds it takes to start a process.
7144* The definition of app process start time is from the app launch time to
7145* the time that Zygote finished forking the app process and loaded the
7146* application package's java classes.
7147
7148* This metric is different from AppStartOccurred which is for foreground
7149* activity only.
7150
7151* ProcessStartTime can report all processes (both foreground and background)
7152* start time.
7153*
7154* Logged from:
7155* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7156*/
7157message ProcessStartTime {
7158 // The uid of the ProcessRecord.
7159 optional int32 uid = 1 [(is_uid) = true];
7160
7161 // The process pid.
7162 optional int32 pid = 2;
7163
7164 // The process name.
7165 // Usually package name, "system" for system server.
7166 // Provided by ActivityManagerService.
7167 optional string process_name = 3;
7168
7169 enum StartType {
7170 UNKNOWN = 0;
7171 WARM = 1;
7172 HOT = 2;
7173 COLD = 3;
7174 }
7175
7176 // The start type.
7177 optional StartType type = 4;
7178
7179 // The elapsed realtime at the start of the process.
7180 optional int64 process_start_time_millis = 5;
7181
7182 // Number of milliseconds it takes to reach bind application.
7183 optional int32 bind_application_delay_millis = 6;
7184
7185 // Number of milliseconds it takes to finish start of the process.
7186 optional int32 process_start_delay_millis = 7;
7187
7188 // hostingType field in ProcessRecord, the component type such as "activity",
7189 // "service", "content provider", "broadcast" or other strings.
7190 optional string hosting_type = 8;
7191
7192 // hostingNameStr field in ProcessRecord. The component class name that runs
7193 // in this process.
7194 optional string hosting_name = 9;
7195}
7196
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007197/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007198 * Track Media Codec usage
7199 * Logged from:
7200 * frameworks/av/media/libstagefright/MediaCodec.cpp
7201 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7202 */
7203message MediametricsCodecReported {
7204 optional int64 timestamp_nanos = 1;
7205 optional string package_name = 2;
7206 optional int64 package_version_code = 3;
7207 optional int64 media_apex_version = 4;
7208
7209 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7210}
7211
7212/**
7213 * Track Media Extractor (pulling video/audio streams out of containers) usage
7214 * Logged from:
7215 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7216 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7217 */
7218message MediametricsExtractorReported {
7219 optional int64 timestamp_nanos = 1;
7220 optional string package_name = 2;
7221 optional int64 package_version_code = 3;
7222 optional int64 media_apex_version = 4;
7223
7224 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7225}
7226
7227/**
7228 * Track how we arbitrate between microphone/input requests.
7229 * Logged from
7230 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7231 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7232 */
7233message MediametricsAudiopolicyReported {
7234 optional int64 timestamp_nanos = 1;
7235 optional string package_name = 2;
7236 optional int64 package_version_code = 3;
7237 optional int64 media_apex_version = 4;
7238
7239 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7240}
7241
7242/**
7243 * Track how we arbitrate between microphone requests.
7244 * Logged from
7245 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7246 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7247 */
7248message MediametricsAudiorecordReported {
7249 optional int64 timestamp_nanos = 1;
7250 optional string package_name = 2;
7251 optional int64 package_version_code = 3;
7252 optional int64 media_apex_version = 4;
7253
7254 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7255}
7256
7257/**
7258 * Track how we arbitrate between microphone/input requests.
7259 * Logged from
7260 * frameworks/av/media/libnblog/ReportPerformance.cpp
7261 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7262 */
7263message MediametricsAudiothreadReported {
7264 optional int64 timestamp_nanos = 1;
7265 optional string package_name = 2;
7266 optional int64 package_version_code = 3;
7267 optional int64 media_apex_version = 4;
7268
7269 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7270}
7271
7272/**
7273 * Track how we arbitrate between microphone/input requests.
7274 * Logged from
7275 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7276 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7277 */
7278message MediametricsAudiotrackReported {
7279 optional int64 timestamp_nanos = 1;
7280 optional string package_name = 2;
7281 optional int64 package_version_code = 3;
7282 optional int64 media_apex_version = 4;
7283
7284 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7285}
7286
7287/**
7288 * Track information about DRM framework performance
7289 * Logged from
7290 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7291 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7292 */
7293message MediametricsMediadrmReported {
7294 optional int64 timestamp_nanos = 1;
7295 optional string package_name = 2;
7296 optional int64 package_version_code = 3;
7297 optional int64 media_apex_version = 4;
7298
7299 // vendor+description tell about which DRM plugin is in use on this device
7300 optional string vendor = 5;
7301 optional string description = 6;
7302 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7303 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7304}
7305
7306/**
7307 * Track information about the widevine DRM plugin performance
7308 * Logged from
7309 * vendor/widevine/libwvdrmengine/cdm/metrics
7310 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7311 */
7312message MediametricsDrmWidevineReported {
7313 optional int64 timestamp_nanos = 1;
7314 optional string package_name = 2;
7315 optional int64 package_version_code = 3;
7316 optional int64 media_apex_version = 4;
7317
7318 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7319}
7320
7321/**
7322 * Track information about recordings (e.g. camcorder)
7323 * Logged from
7324 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7325 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7326 */
7327message MediametricsRecorderReported {
7328 optional int64 timestamp_nanos = 1;
7329 optional string package_name = 2;
7330 optional int64 package_version_code = 3;
7331 optional int64 media_apex_version = 4;
7332
7333 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7334}
7335
7336/**
7337 * Track Media Player usage
7338 * Logged from:
7339 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7340 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7341 */
7342message MediametricsNuPlayerReported {
7343 optional int64 timestamp_nanos = 1;
7344 optional string package_name = 2;
7345 optional int64 package_version_code = 3;
7346 optional int64 media_apex_version = 4;
7347
7348 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7349}
7350
7351/**
Robert Shiha4beed32019-08-19 14:15:23 -07007352 * Track Legacy DRM usage
7353 * Logged from
7354 * frameworks/av/drm/drmserver/DrmManager.cpp
7355 */
7356message MediametricsDrmManagerReported {
7357 optional int64 timestamp_nanos = 1;
7358 optional string package_name = 2;
7359 optional int64 package_version_code = 3;
7360 optional int64 media_apex_version = 4;
7361
7362 enum Method {
7363 METHOD_NOT_FOUND = -1;
7364 GET_CONSTRAINTS = 0;
7365 GET_METADATA = 1;
7366 CAN_HANDLE = 2;
7367 PROCESS_DRM_INFO = 3;
7368 ACQUIRE_DRM_INFO = 4;
7369 SAVE_RIGHTS = 5;
7370 GET_ORIGINAL_MIME_TYPE = 6;
7371 GET_DRM_OBJECT_TYPE = 7;
7372 CHECK_RIGHTS_STATUS = 8;
7373 REMOVE_RIGHTS = 9;
7374 REMOVE_ALL_RIGHTS = 10;
7375 OPEN_CONVERT_SESSION = 11;
7376 OPEN_DECRYPT_SESSION = 12;
7377 }
7378
7379 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7380 optional string plugin_id = 5;
7381 optional string description = 6;
7382 optional Method method = 7;
7383 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007384
7385 optional int64 get_constraints_count = 9;
7386 optional int64 get_metadata_count = 10;
7387 optional int64 can_handle_count = 11;
7388 optional int64 process_drm_info_count = 12;
7389 optional int64 acquire_drm_info_count = 13;
7390 optional int64 save_rights_count = 14;
7391 optional int64 get_original_mime_type_count = 15;
7392 optional int64 get_drm_object_type_count = 16;
7393 optional int64 check_rights_status_count = 17;
7394 optional int64 remove_rights_count = 18;
7395 optional int64 remove_all_rights_count = 19;
7396 optional int64 open_convert_session_count = 20;
7397 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007398}
7399
7400/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007401 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007402 * Pulled from: StatsCompanionService
7403*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007404message DangerousPermissionState {
7405 // Name of the permission
7406 optional string permission_name = 1;
7407
7408 // Uid of the package
7409 optional int32 uid = 2 [(is_uid) = true];
7410
7411 // Package requesting the permission
7412 optional string package_name = 3;
7413
7414 // If the permission is granted to the uid
7415 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007416
7417 // Permission flags as per android.content.pm.PermissionFlags
7418 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007419}
7420
Michael Groover4a0ca942019-01-24 17:41:25 -08007421/**
7422 * Logs when a package is denied access to a device identifier based on the new access requirements.
7423 *
7424 * Logged from:
7425 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7426 */
7427message DeviceIdentifierAccessDenied {
7428 // The name of the package denied access to the requested device identifier.
7429 optional string package_name = 1;
7430
7431 // The name of the device identifier method the package attempted to invoke.
7432 optional string method_name = 2;
7433
7434 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007435 // Starting from Android 11, this boolean is not set and will always be false.
7436 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007437
7438 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007439 // Starting from Android 11, this boolean is not set and will always be false.
7440 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007441}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007442
7443/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007444 * Pulls the ongoing mainline install train version code.
7445 * Pulled from StatsCompanionService
7446 */
7447message TrainInfo {
7448 optional int64 train_version_code = 1;
7449
7450 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007451
7452 optional string train_name = 3;
7453
7454 enum Status {
7455 UNKNOWN = 0;
7456 INSTALL_REQUESTED = 1;
7457 INSTALL_STARTED = 2;
7458 INSTALL_STAGED_NOT_READY = 3;
7459 INSTALL_STAGED_READY = 4;
7460 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007461 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7462 // and INSTALL_FAILURE_COMMIT.
7463 INSTALL_FAILURE = 6 [deprecated = true];
7464 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007465 INSTALL_CANCELLED = 7;
7466 INSTALLER_ROLLBACK_REQUESTED = 8;
7467 INSTALLER_ROLLBACK_INITIATED = 9;
7468 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7469 INSTALLER_ROLLBACK_STAGED = 11;
7470 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7471 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7472 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7473 INSTALLER_ROLLBACK_SUCCESS = 15;
7474 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007475 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7476 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7477 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7478 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7479 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7480 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007481 INSTALL_FAILURE_DOWNLOAD = 23;
7482 INSTALL_FAILURE_STATE_MISMATCH = 24;
7483 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007484 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007485 }
7486 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007487}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007488
7489/**
7490 * Logs the gesture stage changed event.
7491 *
7492 * Logged from:
7493 * frameworks/base/packages/SystemUI/
7494 */
7495message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007496 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007497}
7498
7499/**
7500 * Logs the feedback type.
7501 *
7502 * Logged from:
7503 * frameworks/base/packages/SystemUI/
7504 */
7505message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007506 // Whether or not the gesture was used.
7507 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007508}
7509
7510/**
7511 * Logs the progress.
7512 *
7513 * Logged from:
7514 * frameworks/base/packages/SystemUI/
7515 */
7516message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007517 // [0,100] progress for the assist gesture.
7518 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007519}
Neil Fullerdb14b482019-02-05 19:44:44 +00007520
7521/*
7522 * Information about the time zone data on a device.
7523 */
7524message TimeZoneDataInfo {
7525 // A version identifier for the data set on device. e.g. "2018i"
7526 optional string tzdb_version = 1;
7527}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007528
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007529/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007530 * Logs the GPU stats global health information.
7531 *
7532 * Logged from:
7533 * frameworks/native/services/gpuservice/gpustats/
7534 */
7535message GpuStatsGlobalInfo {
7536 // Package name of the gpu driver.
7537 optional string driver_package_name = 1;
7538
7539 // Version name of the gpu driver.
7540 optional string driver_version_name = 2;
7541
7542 // Version code of the gpu driver.
7543 optional int64 driver_version_code = 3;
7544
7545 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7546 optional int64 driver_build_time = 4;
7547
7548 // Total count of the gl driver gets loaded.
7549 optional int64 gl_loading_count = 5;
7550
7551 // Total count of the gl driver fails to be loaded.
7552 optional int64 gl_loading_failure_count = 6;
7553
7554 // Total count of the Vulkan driver gets loaded.
7555 optional int64 vk_loading_count = 7;
7556
7557 // Total count of the Vulkan driver fails to be loaded.
7558 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007559
7560 // Api version of the system Vulkan driver.
7561 optional int32 vulkan_version = 9;
7562
7563 // Api version of the system CPU Vulkan driver.
7564 optional int32 cpu_vulkan_version = 10;
7565
7566 // Api version of the system GLES driver.
7567 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007568
7569 // Total count of the angle driver gets loaded.
7570 optional int64 angle_loading_count = 12;
7571
7572 // Total count of the angle driver fails to be loaded.
7573 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007574}
7575
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007576/**
7577 * GPU driver loading time info.
7578 */
7579message GpuDriverLoadingTime {
7580 // List of all the driver loading times for this app. The list size is
7581 // capped at 50.
7582 repeated int64 driver_loading_time = 1;
7583}
7584
7585/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007586 * Logs the GPU stats per app health information.
7587 *
7588 * Logged from:
7589 * frameworks/native/services/gpuservice/gpustats/
7590 */
7591message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007592 // Package name of the application that loads the gpu driver. Total number
7593 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007594 optional string app_package_name = 1;
7595
7596 // Version code of the gpu driver this app loads.
7597 optional int64 driver_version_code = 2;
7598
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007599 // gl driver loading time info.
7600 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7601 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007602
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007603 // Vulkan driver loading time info.
7604 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7605 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007606
7607 // Angle driver loading time info.
7608 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7609 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007610
7611 // CPU Vulkan implementation is in use.
7612 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007613
7614 // App is not doing pre-rotation correctly.
7615 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007616
7617 // App creates GLESv1 context.
7618 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007619}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007620
7621/*
7622 * Logs the size of the system ion heap.
7623 *
7624 * Pulled from StatsCompanionService.
7625 */
7626message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007627 // Deprecated due to limited support of ion stats in debugfs.
7628 // Use `IonHeapSize` instead.
7629 option deprecated = true;
7630
Rafal Slawikd4e87572019-03-12 13:08:38 +00007631 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007632 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007633 optional int64 size_in_bytes = 1;
7634}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007635
Rafal Slawik77987ed2019-06-17 12:28:23 +01007636/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007637 * Logs the total size of the ion heap.
7638 *
7639 * Pulled from StatsCompanionService.
7640 */
7641message IonHeapSize {
7642 // Total size of all ion heaps in kilobytes.
7643 // Read from: /sys/kernel/ion/total_heaps_kb.
7644 optional int32 total_size_kb = 1;
7645}
7646
7647/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007648 * Logs the per-process size of the system ion heap.
7649 *
7650 * Pulled from StatsCompanionService.
7651 */
7652message ProcessSystemIonHeapSize {
7653 // The uid if available. -1 means not available.
7654 optional int32 uid = 1 [(is_uid) = true];
7655
7656 // The process name (from /proc/PID/cmdline).
7657 optional string process_name = 2;
7658
7659 // Sum of sizes of all allocations.
7660 optional int32 total_size_in_kilobytes = 3;
7661
7662 // Number of allocations.
7663 optional int32 allocation_count = 4;
7664
7665 // Size of the largest allocation.
7666 optional int32 max_size_in_kilobytes = 5;
7667}
7668
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007669/**
7670 * Push network stack events.
7671 *
7672 * Log from:
7673 * frameworks/base/packages/NetworkStack/
7674 */
7675message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007676 // The id that indicates the event reported from NetworkStack.
7677 optional int32 event_id = 1;
7678 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007679 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7680}
Carmen Agimofa769c152019-03-04 14:39:14 +00007681
7682/**
7683 * Logs the apps that are installed on the external storage.
7684 * Pulled from:
7685 * StatsCompanionService
7686 */
7687message AppsOnExternalStorageInfo {
7688 // The type of the external storage.
7689 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7690 // The name of the package that is installed on the external storage.
7691 optional string package_name = 2;
7692}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007693
7694/**
7695 * Logs the settings related to Face.
7696 * Logged from:
7697 * frameworks/base/services/core/java/com/android/server/stats
7698 */
7699message FaceSettings {
7700 // Whether or not face unlock is allowed on Keyguard.
7701 optional bool unlock_keyguard_enabled = 1;
7702 // Whether or not face unlock dismisses the Keyguard.
7703 optional bool unlock_dismisses_keyguard = 2;
7704 // Whether or not face unlock requires attention.
7705 optional bool unlock_attention_required = 3;
7706 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7707 optional bool unlock_app_enabled = 4;
7708 // Whether or not face unlock always requires user confirmation.
7709 optional bool unlock_always_require_confirmation = 5;
7710 // Whether or not a diverse set of poses are required during enrollment.
7711 optional bool unlock_diversity_required = 6;
7712}
Maggie White442b6312019-04-05 16:26:44 -07007713
7714/**
7715 * Logs cooling devices maintained by the kernel.
7716 *
7717 * Pulled from StatsCompanionService.java
7718 */
7719message CoolingDevice {
7720 // The type of cooling device being reported. Eg. CPU, GPU...
7721 optional android.os.CoolingTypeEnum device_location = 1;
7722 // The name of the cooling device source. Eg. CPU0
7723 optional string device_name = 2;
7724 // Current throttle state of the cooling device. The value can any unsigned
7725 // integer between 0 and max_state defined in its driver. 0 means device is
7726 // not in throttling, higher value means deeper throttling.
7727 optional int32 state = 3;
7728}
Ben Blount763a5d52019-04-10 11:48:58 -07007729
7730/**
7731 * Intelligence has several counter-type events that don't warrant a
7732 * full separate atom. These are primarily API call counters but also include
7733 * counters for feature usage and specific failure modes.
7734 *
7735 * Logged from the Intelligence mainline module.
7736 */
7737message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007738 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007739 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007740 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007741 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007742 // How many times the event occured (to report a batch of high frequency events).
7743 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007744 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007745 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007746}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007747
7748/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007749 * Logs when Car Power state changed.
7750 *
7751 * Logged from:
7752 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7753 */
7754message CarPowerStateChanged {
7755 // States come from CpmsState in CarPowerManagementService.java.
7756 enum State {
7757 WAIT_FOR_VHAL = 0;
7758 ON = 1;
7759 SHUTDOWN_PREPARE = 2;
7760 WAIT_FOR_FINISH = 3;
7761 SUSPEND = 4;
7762 SIMULATE_SLEEP = 5;
7763 }
7764 optional State state = 1;
7765}
7766
7767/**
7768 * Logs whether GarageMode is entered.
7769 *
7770 * Logged from:
7771 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7772 */
7773message GarageModeInfo {
7774 // Whether GarageMode is entered.
7775 optional bool is_garage_mode = 1;
7776}
Martijn Coenencd95d462019-04-25 17:09:45 +02007777
7778/**
7779 * Historical app ops data per package.
7780 */
7781message AppOps {
7782 // Uid of the package requesting the op
7783 optional int32 uid = 1 [(is_uid) = true];
7784
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007785 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007786 optional string package_name = 2;
7787
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007788 // operation id
7789 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02007790
7791 // The number of times the op was granted while the app was in the
7792 // foreground (only for trusted requests)
7793 optional int64 trusted_foreground_granted_count = 4;
7794
7795 // The number of times the op was granted while the app was in the
7796 // background (only for trusted requests)
7797 optional int64 trusted_background_granted_count = 5;
7798
7799 // The number of times the op was rejected while the app was in the
7800 // foreground (only for trusted requests)
7801 optional int64 trusted_foreground_rejected_count = 6;
7802
7803 // The number of times the op was rejected while the app was in the
7804 // background (only for trusted requests)
7805 optional int64 trusted_background_rejected_count = 7;
7806
7807 // For long-running operations, total duration of the operation
7808 // while the app was in the foreground (only for trusted requests)
7809 optional int64 trusted_foreground_duration_millis = 8;
7810
7811 // For long-running operations, total duration of the operation
7812 // while the app was in the background (only for trusted requests)
7813 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007814
7815 // Whether AppOps is guarded by Runtime permission
7816 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007817}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007818
7819/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007820 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007821 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007822message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007823 // Uid of the package requesting the op
7824 optional int32 uid = 1 [(is_uid) = true];
7825
7826 // Name of the package performing the op
7827 optional string package_name = 2;
7828
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007829 // tag; provided by developer when accessing related API, limited at 50 chars by API.
7830 // Attributions must be provided through manifest using <attribution> tag available in R and
7831 // above.
7832 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007833
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007834 // operation id
7835 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007836
7837 // The number of times the op was granted while the app was in the
7838 // foreground (only for trusted requests)
7839 optional int64 trusted_foreground_granted_count = 5;
7840
7841 // The number of times the op was granted while the app was in the
7842 // background (only for trusted requests)
7843 optional int64 trusted_background_granted_count = 6;
7844
7845 // The number of times the op was rejected while the app was in the
7846 // foreground (only for trusted requests)
7847 optional int64 trusted_foreground_rejected_count = 7;
7848
7849 // The number of times the op was rejected while the app was in the
7850 // background (only for trusted requests)
7851 optional int64 trusted_background_rejected_count = 8;
7852
7853 // For long-running operations, total duration of the operation
7854 // while the app was in the foreground (only for trusted requests)
7855 optional int64 trusted_foreground_duration_millis = 9;
7856
7857 // For long-running operations, total duration of the operation
7858 // while the app was in the background (only for trusted requests)
7859 optional int64 trusted_background_duration_millis = 10;
7860
7861 // Whether AppOps is guarded by Runtime permission
7862 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00007863
7864 // Sampling rate used on device, from 0 to 100
7865 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007866}
7867
7868/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007869 * Location Manager API Usage information(e.g. API under usage,
7870 * API call's parameters).
7871 * Logged from:
7872 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7873 */
7874message LocationManagerApiUsageReported {
7875
7876 // Indicating if usage starts or usage ends.
7877 optional android.stats.location.UsageState state = 1;
7878
7879 // LocationManagerService's API in use.
7880 // We can identify which API from LocationManager is
7881 // invoking current LMS API by the combination of
7882 // API parameter(e.g. is_listener_null, is_intent_null,
7883 // is_location_request_null)
7884 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7885
7886 // Name of the package calling the API.
7887 optional string calling_package_name = 3;
7888
7889 // Type of the location provider.
7890 optional android.stats.location.ProviderType provider = 4;
7891
7892 // Quality of the location request
7893 optional android.stats.location.LocationRequestQuality quality = 5;
7894
7895 // The desired interval for active location updates, in milliseconds.
7896 // Bucketized to reduce cardinality.
7897 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7898
7899 // Minimum distance between location updates, in meters.
7900 // Bucketized to reduce cardinality.
7901 optional android.stats.location.SmallestDisplacementBucket
7902 bucketized_smallest_displacement = 7;
7903
7904 // The number of location updates.
7905 optional int64 num_updates = 8;
7906
7907 // The request expiration time, in millisecond since boot.
7908 // Bucketized to reduce cardinality.
7909 optional android.stats.location.ExpirationBucket
7910 bucketized_expire_in = 9;
7911
7912 // Type of Callback passed in for this API.
7913 optional android.stats.location.CallbackType callback_type = 10;
7914
7915 // The radius of the central point of the alert
7916 // region, in meters. Only for API REQUEST_GEOFENCE.
7917 // Bucketized to reduce cardinality.
7918 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7919
7920 // Activity Importance of API caller.
7921 // Categorized to 3 types that are interesting from location's perspective.
7922 optional android.stats.location.ActivityImportance activiy_importance = 12;
7923}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007924
7925/**
7926 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7927 */
7928message ReviewPermissionsFragmentResultReported {
7929 // unique value identifying a permission group change. A permission group change might result
7930 // in multiple of these atoms
7931 optional int64 change_id = 1;
7932
7933 // UID of package the permission belongs to
7934 optional int32 uid = 2 [(is_uid) = true];
7935
7936 // Name of package the permission belongs to
7937 optional string package_name = 3;
7938
7939 // The permission to be granted
7940 optional string permission_name = 4;
7941
7942 // The result of the permission grant
7943 optional bool permission_granted = 5;
7944}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007945
7946/**
7947* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7948* Logged from: RuntimePermissionUpdgradeController
7949*/
7950message RuntimePermissionsUpgradeResult {
7951 // Permission granted as result of upgrade
7952 optional string permission_name = 1;
7953
7954 // UID of package granted permission
7955 optional int32 uid = 2 [(is_uid) = true];
7956
7957 // Name of package granted permission
7958 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007959}
7960
7961/**
7962* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7963*/
7964message GrantPermissionsActivityButtonActions {
7965 // Permission granted as result of upgrade
7966 optional string permission_group_name = 1;
7967
7968 // UID of package granted permission
7969 optional int32 uid = 2 [(is_uid) = true];
7970
7971 // Name of package requesting permission
7972 optional string package_name = 3;
7973
7974 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7975 // LABEL_ constants in GrantPermissionActivity.java
7976 optional int32 buttons_presented = 4;
7977
7978 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7979 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007980
7981 // id which identifies single session of user interacting with permission controller
7982 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007983}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007984
7985/**
7986 * Information about LocationAccessCheck notification presented to user
7987 */
7988message LocationAccessCheckNotificationAction {
7989
7990 // id which identifies single session of user interacting with permission controller
7991 optional int64 session_id = 1;
7992
7993 // Uid of package for which location access check is presented
7994 optional int32 package_uid = 2;
7995
7996 // Name of package for which location access check is presented
7997 optional string package_name = 3;
7998
7999 enum Result {
8000 UNDEFINED = 0;
8001 // notification was presented to the user
8002 NOTIFICATION_PRESENTED = 1;
8003 // notification was declined by the user
8004 NOTIFICATION_DECLINED = 2;
8005 // notification was clicked by the user
8006 NOTIFICATION_CLICKED = 3;
8007 }
8008
8009 // View / interaction recorded
8010 optional Result result = 4;
8011}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008012
8013/**
8014 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8015 */
8016message AppPermissionFragmentActionReported {
8017 // id which identifies single session of user interacting with permission controller
8018 optional int64 session_id = 1;
8019
8020 // unique value identifying a permission group change. A permission group change might result
8021 // in multiple of these atoms
8022 optional int64 change_id = 2;
8023
8024 // UID of package the permission belongs to
8025 optional int32 uid = 3 [(is_uid) = true];
8026
8027 // Name of package the permission belongs to
8028 optional string package_name = 4;
8029
8030 // The permission to be granted
8031 optional string permission_name = 5;
8032
8033 // The result of the permission grant
8034 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008035
8036 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8037 optional int32 permission_flags = 7;
8038
8039 enum Button {
8040 UNDEFINED = 0;
8041 // Allow button
8042 ALLOW = 1;
8043 // Deny button
8044 DENY = 2;
8045 // Ask every time button
8046 ASK_EVERY_TIME = 3;
8047 // Allow all the time button
8048 ALLOW_ALWAYS = 4;
8049 // Allow only while using the app button
8050 ALLOW_FOREGROUND = 5;
8051 // Same is Deny button but shown in while in use dialog
8052 DENY_FOREGROUND = 6;
8053 }
8054
8055 // Button pressed in the dialog
8056 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008057}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008058
8059/**
8060* Information about a AppPermissionFragment viewed by user
8061*/
8062message AppPermissionFragmentViewed {
8063 // id which identifies single session of user interacting with permission controller
8064 optional int64 session_id = 1;
8065
8066 // UID of package for which permissions are viewed
8067 optional int32 uid = 2 [(is_uid) = true];
8068
8069 // Name of package for which permissions are viewed
8070 optional string package_name = 3;
8071
8072 // Permission group viewed
8073 optional string permission_group_name = 4;
8074}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008075
8076/**
8077* Information about a AppPermissionsFragment viewed by user
8078*/
8079message AppPermissionsFragmentViewed {
8080 // id which identifies single session of user interacting with permission controller
8081 optional int64 session_id = 1;
8082
8083 // id which identifies single view as every view might have several logging records
8084 // with different package information attached
8085 optional int64 view_id = 2;
8086
8087 // Permission group viewed
8088 optional string permission_group_name = 3;
8089
8090 // UID of package for which permissions are viewed
8091 optional int32 uid = 4 [(is_uid) = true];
8092
8093 // Name of package for which permissions are viewed
8094 optional string package_name = 5;
8095
8096 // Category in which permission is included
8097 enum Category {
8098 UNDEFINED = 0;
8099 ALLOWED = 1;
8100 ALLOWED_FOREGROUND = 2;
8101 DENIED = 3;
8102 }
8103 optional Category category = 6;
8104}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008105
8106/**
8107* Information about a PermissionAppsFragment viewed by user.
8108* Logged from ui/handheld/PermissionAppsFragment.java
8109*/
8110message PermissionAppsFragmentViewed {
8111 // id which identifies single session of user interacting with permission controller
8112 optional int64 session_id = 1;
8113
8114 // id which identifies single view as every view might have several logging records
8115 // with different package information attached
8116 optional int64 view_id = 2;
8117
8118 // Permission group viewed
8119 optional string permission_group_name = 3;
8120
8121 // UID of package for which permissions are viewed
8122 optional int32 uid = 4 [(is_uid) = true];
8123
8124 // Name of package for which permissions are viewed
8125 optional string package_name = 5;
8126
8127 // Category in which app is included
8128 enum Category {
8129 UNDEFINED = 0;
8130 ALLOWED = 1;
8131 ALLOWED_FOREGROUND = 2;
8132 DENIED = 3;
8133 }
8134 optional Category category = 6;
8135}
Tony Make2b1b672019-07-29 16:59:47 +01008136
8137/**
8138 * Logs when there is a smart selection related event.
8139 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8140 * Logged from: TextClassifierEventLogger.java
8141 */
8142message TextSelectionEvent {
8143 // A session ID.
8144 optional string session_id = 1;
8145
8146 // Event type of this event.
8147 optional android.stats.textclassifier.EventType event_type = 2;
8148
Tony Mak9c84bd22019-12-09 07:27:25 +00008149 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008150 optional string model_name = 3;
8151
8152 // Type of widget that was involved in triggering this event.
8153 optional android.stats.textclassifier.WidgetType widget_type = 4;
8154
8155 // Index of this event in a session.
8156 optional int32 event_index = 5;
8157
8158 // Entity type that is involved.
8159 optional string entity_type = 6;
8160
8161 // Relative word index of the start of the selection.
8162 optional int32 relative_word_start_index = 7;
8163
8164 // Relative word (exclusive) index of the end of the selection.
8165 optional int32 relative_word_end_index = 8;
8166
8167 // Relative word index of the start of the smart selection.
8168 optional int32 relative_suggested_word_start_index = 9;
8169
8170 // Relative word (exclusive) index of the end of the smart selection.
8171 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008172
8173 // Name of source package.
8174 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008175
8176 // Name of the LangID model that is involved in this event.
8177 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008178}
8179
8180/**
8181 * Logs when there is a smart linkify related event.
8182 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8183 * Logged from: TextClassifierEventLogger.java
8184 */
8185message TextLinkifyEvent {
8186 // A session ID.
8187 optional string session_id = 1;
8188
8189 // Event type of this event.
8190 optional android.stats.textclassifier.EventType event_type = 2;
8191
Tony Mak9c84bd22019-12-09 07:27:25 +00008192 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008193 optional string model_name = 3;
8194
8195 // Type of widget that was involved in triggering this event.
8196 optional android.stats.textclassifier.WidgetType widget_type = 4;
8197
8198 // Index of this event in a session.
8199 optional int32 event_index = 5;
8200
8201 // Entity type that is involved.
8202 optional string entity_type = 6;
8203
8204 // Number of links detected.
8205 optional int32 num_links = 7;
8206
8207 // The total length of all links.
8208 optional int32 linked_text_length = 8;
8209
8210 // Length of input text.
8211 optional int32 text_length = 9;
8212
8213 // Time spent on generating links in ms.
8214 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008215
8216 // Name of source package.
8217 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008218
8219 // Name of the LangID model that is involved in this event.
8220 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008221}
8222
8223/**
8224 * Logs when there is a conversation actions related event.
8225 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8226 * Logged from: TextClassifierEventLogger.java
8227 */
8228message ConversationActionsEvent {
8229 // A session ID.
8230 optional string session_id = 1;
8231
8232 // Event type of this event.
8233 optional android.stats.textclassifier.EventType event_type = 2;
8234
Tony Mak9c84bd22019-12-09 07:27:25 +00008235 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008236 optional string model_name = 3;
8237
8238 // Type of widget that was involved in triggering this event.
8239 optional android.stats.textclassifier.WidgetType widget_type = 4;
8240
8241 // The first entity type that is involved.
8242 optional string first_entity_type = 5;
8243
8244 // The second entity type that is involved.
8245 optional string second_entity_type = 6;
8246
8247 // The third entity type that is involved.
8248 optional string third_entity_type = 7;
8249
8250 // The score of the first entity type.
8251 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008252
8253 // Name of source package.
8254 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008255
8256 // Name of the annotator model that is involved in this event.
8257 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00008258
8259 // Name of the LangID model that is involved in this event.
8260 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008261}
8262
8263/**
8264 * Logs when there is a language detection related event.
8265 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8266 * Logged from: TextClassifierEventLogger.java
8267 */
8268message LanguageDetectionEvent {
8269 // A session ID.
8270 optional string session_id = 1;
8271
8272 // Event type of this event.
8273 optional android.stats.textclassifier.EventType event_type = 2;
8274
Tony Mak9c84bd22019-12-09 07:27:25 +00008275 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008276 optional string model_name = 3;
8277
8278 // Type of widget that was involved in triggering this event.
8279 optional android.stats.textclassifier.WidgetType widget_type = 4;
8280
8281 // Detected language.
8282 optional string language_tag = 5;
8283
8284 // Score of the detected language.
8285 optional float score = 6;
8286
8287 // Position of this action.
8288 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008289
8290 // Name of source package.
8291 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008292}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008293
8294/**
8295 * Information about an OTA update attempt by update_engine.
8296 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8297 */
8298message UpdateEngineUpdateAttemptReported {
8299 // The number of attempts for the update engine to apply a given payload.
8300 optional int32 attempt_number = 1;
8301
8302 optional android.stats.otaupdate.PayloadType payload_type = 2;
8303
8304 // The total time in minutes for the update engine to apply a given payload.
8305 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8306 // it's increased when the system is sleeping.
8307 optional int32 duration_boottime_in_minutes = 3;
8308
8309 // The total time in minutes for the update engine to apply a given payload.
8310 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8311 // and it's not increased when the system is sleeping.
8312 optional int32 duration_monotonic_in_minutes = 4;
8313
8314 // The size of the payload in MiBs.
8315 optional int32 payload_size_mib = 5;
8316
8317 // The attempt result reported by the update engine for an OTA update.
8318 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8319
8320 // The error code reported by the update engine after an OTA update attempt
8321 // on A/B devices.
8322 optional android.stats.otaupdate.ErrorCode error_code = 7;
8323
8324 // The build fingerprint of the source system. The value is read from a
8325 // system property when the device takes the update. e.g.
8326 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8327 optional string source_fingerprint = 8;
8328}
8329
8330/**
8331 * Information about all the attempts the device make before finishing the
8332 * successful update.
8333 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8334 */
8335message UpdateEngineSuccessfulUpdateReported {
8336 // The number of attempts for the update engine to apply the payload for a
8337 // successful update.
8338 optional int32 attempt_count = 1;
8339
8340 optional android.stats.otaupdate.PayloadType payload_type = 2;
8341
8342 optional int32 payload_size_mib = 3;
8343
8344 // The total number of bytes downloaded by update_engine since the last
8345 // successful update.
8346 optional int32 total_bytes_downloaded_mib = 4;
8347
8348 // The ratio in percentage of the over-downloaded bytes compared to the
8349 // total bytes needed to successfully install the update. e.g. 200 if we
8350 // download 200MiB in total for a 100MiB package.
8351 optional int32 download_overhead_percentage = 5;
8352
8353 // The total time in minutes for the update engine to apply the payload for a
8354 // successful update.
8355 optional int32 total_duration_minutes = 6;
8356
8357 // The number of reboot of the device during a successful update.
8358 optional int32 reboot_count = 7;
8359}
Alec Mourie088e762019-07-02 13:10:55 -07008360
8361/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008362 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8363 * key to indicate whether it was successful or not.
8364 *
8365 * Logged from:
8366 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8367 */
8368message RebootEscrowRecoveryReported {
8369 optional bool successful = 1;
8370}
8371
8372/**
Alec Mourie088e762019-07-02 13:10:55 -07008373 * Global display pipeline metrics reported by SurfaceFlinger.
8374 * Pulled from:
8375 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8376 */
8377message SurfaceflingerStatsGlobalInfo {
8378 // Total number of frames presented during the tracing period
8379 optional int64 total_frames = 1;
8380 // Total number of frames missed
8381 optional int64 missed_frames = 2;
8382 // Total number of frames that fell back to client composition
8383 optional int64 client_composition_frames = 3;
8384 // Total time the display was turned on
8385 optional int64 display_on_millis = 4;
8386 // Total time that was spent performing animations.
8387 // This is derived from the present-to-present layer histogram
8388 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008389 // Total number of event connections tracked by SurfaceFlinger at the time
8390 // of this pull. If this number grows prohibitively large, then this can
8391 // cause jank due to resource contention.
8392 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008393 // Set of timings measured from when SurfaceFlinger began compositing a
8394 // frame, until the frame was requested to be presented to the display. This
8395 // measures SurfaceFlinger's total CPU walltime on the critical path per
8396 // frame.
8397 optional FrameTimingHistogram frame_duration = 7
8398 [(android.os.statsd.log_mode) = MODE_BYTES];
8399 // Set of timings measured from when SurfaceFlinger first began using the
8400 // GPU to composite a frame, until the GPU has finished compositing that
8401 // frame. This measures the total additional time SurfaceFlinger needed to
8402 // perform due to falling back into GPU composition.
8403 optional FrameTimingHistogram render_engine_timing = 8
8404 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008405}
8406
8407/**
8408 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8409 * The number of layers uploaded will be restricted due to size limitations.
8410 * Pulled from:
8411 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8412 */
8413message SurfaceflingerStatsLayerInfo {
8414 // The layer for this set of metrics
8415 // For now we can infer that the package name is included in the layer
8416 // name.
8417 optional string layer_name = 1;
8418 // Total number of frames presented
8419 optional int64 total_frames = 2;
8420 // Total number of dropped frames while latching a buffer for this layer.
8421 optional int64 dropped_frames = 3;
8422 // Set of timings measured between successive presentation timestamps.
8423 optional FrameTimingHistogram present_to_present = 4
8424 [(android.os.statsd.log_mode) = MODE_BYTES];
8425 // Set of timings measured from when an app queued a buffer for
8426 // presentation, until the buffer was actually presented to the
8427 // display.
8428 optional FrameTimingHistogram post_to_present = 5
8429 [(android.os.statsd.log_mode) = MODE_BYTES];
8430 // Set of timings measured from when a buffer is ready to be presented,
8431 // until the buffer was actually presented to the display.
8432 optional FrameTimingHistogram acquire_to_present = 6
8433 [(android.os.statsd.log_mode) = MODE_BYTES];
8434 // Set of timings measured from when a buffer was latched by
8435 // SurfaceFlinger, until the buffer was presented to the display
8436 optional FrameTimingHistogram latch_to_present = 7
8437 [(android.os.statsd.log_mode) = MODE_BYTES];
8438 // Set of timings measured from the desired presentation to the actual
8439 // presentation time
8440 optional FrameTimingHistogram desired_to_present = 8
8441 [(android.os.statsd.log_mode) = MODE_BYTES];
8442 // Set of timings measured from when an app queued a buffer for
8443 // presentation, until the buffer was ready to be presented.
8444 optional FrameTimingHistogram post_to_acquire = 9
8445 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008446 // Frames missed latch because the acquire fence didn't fire
8447 optional int64 late_acquire_frames = 10;
8448 // Frames latched early because the desired present time was bad
8449 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008450}
8451
8452/**
8453 * Histogram of frame counts bucketed by time in milliseconds.
8454 * Because of size limitations, we hard-cap the number of buckets, with
8455 * buckets for corresponding to larger milliseconds being less precise.
8456 */
8457message FrameTimingHistogram {
8458 // Timings in milliseconds that describes a set of histogram buckets
8459 repeated int32 time_millis_buckets = 1;
8460 // Number of frames that match to each time_millis, i.e. the bucket
8461 // contents
8462 // It's required that len(time_millis) == len(frame_count)
8463 repeated int64 frame_counts = 2;
8464}
Emilian Peev6729f372019-08-29 09:14:09 -07008465
Emilian Peev6729f372019-08-29 09:14:09 -07008466/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008467 * Janky event as reported by SurfaceFlinger.
8468 * This event is intended to be consumed by a Perfetto subscriber for
8469 * automated trace collection.
8470 *
8471 * Logged from:
8472 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8473 */
8474message DisplayJankReported {
8475 // Informational field for how long the janky event lasted in milliseconds
8476 optional int64 event_duration_millis = 1;
8477 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8478 // the display on time.
8479 optional int32 present_deadlines_missed = 2;
8480}
8481
8482/**
Emilian Peev6729f372019-08-29 09:14:09 -07008483 * Information about camera facing and API level usage.
8484 * Logged from:
8485 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8486 */
8487message CameraActionEvent {
8488 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008489 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008490
8491 // Camera API level used
8492 optional int32 api_level = 2;
8493
8494 // Name of client package
8495 optional string package_name = 3;
8496
8497 // Camera facing
8498 enum Facing {
8499 UNKNOWN = 0;
8500 BACK = 1;
8501 FRONT = 2;
8502 EXTERNAL = 3;
8503 }
8504 optional Facing facing = 4;
8505}
atrost01a20932019-08-28 15:40:37 +01008506
8507/**
8508 * Logs when a compatibility change is affecting an app.
8509 *
8510 * Logged from:
8511 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8512 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8513 */
8514message AppCompatibilityChangeReported {
8515 // The UID of the app being affected by the compatibilty change.
8516 optional int32 uid = 1 [(is_uid) = true];
8517
8518 // The ID of the change affecting the app.
8519 optional int64 change_id = 2;
8520
8521 enum State {
8522 UNKNOWN_STATE = 0;
8523 ENABLED = 1;
8524 DISABLED = 2;
8525 LOGGED = 3;
8526 }
8527
8528 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8529 // logged otherwise.
8530 optional State state = 3;
8531
8532 enum Source {
8533 UNKNOWN_SOURCE = 0;
8534 APP_PROCESS = 1;
8535 SYSTEM_SERVER = 2;
8536 }
8537
8538 // Where it was logged from.
8539 optional Source source = 4;
8540
8541}
Hector Dearman40579f62019-11-01 13:19:30 +00008542
8543/**
8544 * Logged from
8545 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8546 */
8547message PerfettoUploaded {
8548 enum Event {
8549 PERFETTO_UNDEFINED = 0;
8550 PERFETTO_TRACE_BEGIN = 1;
8551 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8552 PERFETTO_ON_CONNECT = 3;
8553 PERFETTO_ON_TRACING_DISABLED = 4;
8554 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8555 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8556 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8557 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8558 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8559 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8560 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8561 PERFETTO_TRIGGER_BEGIN = 12;
8562 PERFETTO_TRIGGER_SUCCESS = 13;
8563 PERFETTO_TRIGGER_FAILURE = 14;
8564 PERFETTO_HIT_GUARDRAILS = 15;
8565 PERFETTO_ON_TIMEOUT = 16;
8566 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8567 }
8568
8569 // Which stage of the pipeline we are reporting from.
8570 optional Event event = 1;
8571
8572 // UUID matching the one set inside the SystemInfo trace packet.
8573 optional int64 trace_uuid_lsb = 2;
8574 optional int64 trace_uuid_msb = 3;
8575}
Mark Tabrya824a642019-11-05 12:26:12 -08008576
8577/**
8578 * Pulls client metrics on data transferred via Vehicle Maps Service.
8579 * Metrics are keyed by uid + layer.
8580 *
8581 * Pulled from:
8582 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8583 */
8584message VmsClientStats {
8585 // UID of the VMS client app
8586 optional int32 uid = 1 [(is_uid) = true];
8587
8588 // VMS layer definition
8589 optional int32 layer_type = 2;
8590 optional int32 layer_channel = 3;
8591 optional int32 layer_version = 4;
8592
8593 // Bytes and packets sent by the client for the layer
8594 optional int64 tx_bytes = 5;
8595 optional int64 tx_packets = 6;
8596
8597 // Bytes and packets received by the client for the layer
8598 optional int64 rx_bytes = 7;
8599 optional int64 rx_packets = 8;
8600
8601 // Bytes and packets dropped due to client error
8602 optional int64 dropped_bytes = 9;
8603 optional int64 dropped_packets = 10;
8604}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008605
8606/**
8607 * State of a dangerous permission requested by a package - sampled
8608 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8609*/
8610message DangerousPermissionStateSampled {
8611 // Name of the permission
8612 optional string permission_name = 1;
8613
8614 // Uid of the package
8615 optional int32 uid = 2 [(is_uid) = true];
8616
8617 // If the permission is granted to the uid
8618 optional bool is_granted = 3;
8619
8620 // Permission flags as per android.content.pm.PermissionFlags
8621 optional int32 permission_flags = 4;
8622}
8623
Stan Iliev637ba5e2019-08-16 13:43:08 -04008624/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008625 * HWUI stats for a given app.
8626 */
8627message GraphicsStats {
8628 // The package name of the app
8629 optional string package_name = 1;
8630
8631 // The version code of the app
8632 optional int64 version_code = 2;
8633
8634 // The start & end timestamps in UTC as
8635 // milliseconds since January 1, 1970
8636 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008637 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008638
Stan Ilievb6517192020-02-18 10:12:42 -05008639 optional int64 end_millis = 4;
8640
8641 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8642 enum PipelineType {
8643 UNKNOWN = 0;
8644 GL = 1;
8645 VULKAN = 2;
8646 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008647
8648 // HWUI renders pipeline type: GL or Vulkan.
8649 optional PipelineType pipeline = 5;
8650
8651 // Distinct frame count.
8652 optional int32 total_frames = 6;
8653
8654 // Number of "missed vsync" events.
8655 optional int32 missed_vsync_count = 7;
8656
8657 // Number of frames in triple-buffering scenario (high input latency)
8658 optional int32 high_input_latency_count = 8;
8659
8660 // Number of "slow UI thread" events.
8661 optional int32 slow_ui_thread_count = 9;
8662
8663 // Number of "slow bitmap upload" events.
8664 optional int32 slow_bitmap_upload_count = 10;
8665
8666 // Number of "slow draw" events.
8667 optional int32 slow_draw_count = 11;
8668
8669 // Number of frames that missed their deadline (aka, visibly janked)
8670 optional int32 missed_deadline_count = 12;
8671
8672 // The frame time histogram for the package
8673 optional FrameTimingHistogram cpu_histogram = 13
8674 [(android.os.statsd.log_mode) = MODE_BYTES];
8675
8676 // The gpu frame time histogram for the package
8677 optional FrameTimingHistogram gpu_histogram = 14
8678 [(android.os.statsd.log_mode) = MODE_BYTES];
8679
8680 // UI mainline module version.
8681 optional int64 version_ui_module = 15;
8682
8683 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8684 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8685 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8686 // more apps are running / rendering.
8687 optional bool is_today = 16;
8688}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008689
8690/**
8691 * Message related to dangerous (runtime) app ops access
8692 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008693message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008694 // Uid of the package accessing app op
8695 optional int32 uid = 1 [(is_uid) = true];
8696
8697 // Name of the package accessing app op
8698 optional string package_name = 2;
8699
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008700 // deprecated - set to empty string
8701 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008702
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008703 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008704 // API. Attributions must be provided through manifest using <attribution> tag available in R
8705 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008706 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008707
8708 // message related to app op access, limited to 600 chars by API
8709 optional string message = 5;
8710
8711 enum SamplingStrategy {
8712 DEFAULT = 0;
8713 UNIFORM = 1;
8714 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00008715 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008716 }
8717
8718 // sampling strategy used to collect this message
8719 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008720
8721 // operation id
8722 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008723}
8724
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008725/*
8726 * Logs userspace reboot outcome and duration.
8727 *
8728 * Logged from:
8729 * frameworks/base/core/java/com/android/server/BootReceiver.java
8730 */
8731message UserspaceRebootReported {
8732 // Possible outcomes of userspace reboot.
8733 enum Outcome {
8734 // Default value in case platform failed to determine the outcome.
8735 OUTCOME_UNKNOWN = 0;
8736 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8737 SUCCESS = 1;
8738 // Userspace reboot shutdown sequence was aborted.
8739 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8740 // Remounting userdata into checkpointing mode failed.
8741 FAILED_USERDATA_REMOUNT = 3;
8742 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8743 // reboot.
8744 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8745 }
8746 // Outcome of userspace reboot. Always set.
8747 optional Outcome outcome = 1;
8748 // Duration of userspace reboot in case it has a successful outcome.
8749 // Duration is measured as time between userspace reboot was initiated and until boot completed
8750 // (e.g. sys.boot_completed=1).
8751 optional int64 duration_millis = 2;
8752 // State of primary user's (user0) credential encryption storage.
8753 enum UserEncryptionState {
8754 // Default value.
8755 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8756 // Credential encrypted storage is unlocked.
8757 UNLOCKED = 1;
8758 // Credential encrypted storage is locked.
8759 LOCKED = 2;
8760 }
8761 // State of primary user's encryption storage at the moment boot completed. Always set.
8762 optional UserEncryptionState user_encryption_state = 3;
8763}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008764
8765/*
8766 * Logs integrity check information during each install.
8767 *
8768 * Logged from:
8769 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8770 */
8771message IntegrityCheckResultReported {
8772 optional string package_name = 1;
8773 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008774 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008775 optional string installer_package_name = 4;
8776 enum Response {
8777 UNKNOWN = 0;
8778 ALLOWED = 1;
8779 REJECTED = 2;
8780 FORCE_ALLOWED = 3;
8781 }
8782 optional Response response = 5;
8783 // An estimate on the cause of the response. This will only be populated for
8784 // REJECTED and FORCE_ALLOWED
8785 optional bool caused_by_app_cert_rule = 6;
8786 optional bool caused_by_installer_rule = 7;
8787}
8788
8789/**
8790 * Logs the information about the rules and the provider whenever rules are
8791 * pushed into AppIntegrityManager.
8792 *
8793 * Logged from:
8794 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8795 */
8796message IntegrityRulesPushed {
8797 optional bool success = 1;
8798 // Package name of the app that pushed the rules.
8799 optional string rule_provider = 2;
8800 // Version string of arbitrary format provided by the rule provider to
8801 // identify the rules.
8802 optional string rule_version = 3;
8803}
Jordan Liubedfa702019-12-20 15:08:45 -08008804
8805/**
8806 * Logs when a cell broadcast message is received on the device.
8807 *
8808 * Logged from CellBroadcastService module:
8809 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8810 */
8811message CellBroadcastMessageReported {
8812 // The type of Cell Broadcast message
8813 enum CbType {
8814 UNKNOWN_TYPE = 0;
8815 GSM = 1;
8816 CDMA = 2;
8817 CDMA_SPC = 3;
8818 }
8819
8820 // GSM, CDMA, CDMA-SCP
8821 optional CbType type = 1;
8822}
8823
8824/**
8825 * Logs when an error occurs while handling a cell broadcast message;
8826 *
8827 * Logged from CellBroadcastService module:
8828 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8829 */
8830message CellBroadcastMessageError {
8831 // The type of error raised when trying to handle a cell broadcast message
8832 enum ErrorType {
8833 UNKNOWN_TYPE = 0;
8834 CDMA_DECODING_ERROR = 1;
8835 CDMA_SCP_EMPTY = 2;
8836 CDMA_SCP_HANDLING_ERROR = 3;
8837 GSM_INVALID_HEADER_LENGTH = 4;
8838 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8839 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8840 GSM_INVALID_PDU = 7;
8841 GSM_INVALID_GEO_FENCING_DATA = 8;
8842 GSM_UMTS_INVALID_WAC = 9;
8843 FAILED_TO_INSERT_TO_DB = 10;
8844 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8845 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8846 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8847 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8848 }
8849
8850 // What kind of error occurred
8851 optional ErrorType type = 1;
8852
8853 // Exception message (or log message) associated with the error (max 1000 chars)
8854 optional string exception_message = 2;
8855}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008856
8857/**
8858 * Logs when the SDK Extensions test app has polled the current version.
8859 * This is atom ID 354.
8860 *
8861 * Logged from:
8862 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8863 */
8864message SdkExtensionStatus {
8865 enum ApiCallStatus {
8866 CALL_NOT_ATTEMPTED = 0;
8867 CALL_SUCCESSFUL = 1;
8868 CALL_FAILED = 2;
8869 }
8870
8871 optional ApiCallStatus result = 1;
8872
8873 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8874 optional int32 r_extension_version = 2;
8875
8876 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8877 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8878 optional int32 failed_call_symbol = 3;
8879}
Marco Ballesio497aff42020-01-24 08:39:42 -08008880
8881/**
8882 * Logs when an app is frozen or unfrozen.
8883 *
8884 * Logged from:
8885 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8886 */
8887message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008888 // The type of event.
8889 enum Action {
8890 UNKNOWN = 0;
8891 FREEZE_APP = 1;
8892 UNFREEZE_APP = 2;
8893 }
8894 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008895
Blake Kragten6ce382a2020-01-16 20:20:46 -08008896 // Pid of the process being frozen.
8897 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008898
Blake Kragten6ce382a2020-01-16 20:20:46 -08008899 // Name of the process being frozen.
8900 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008901
Blake Kragten6ce382a2020-01-16 20:20:46 -08008902 // Time since last unfrozen.
8903 optional int64 time_unfrozen_millis = 4;
8904}
8905
8906/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07008907 * Pulls information for a single voice call.
8908 *
8909 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
8910 *
8911 * Pulled from:
8912 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8913 */
8914message VoiceCallSession {
8915 // Bearer (IMS or CS) when the call started.
8916 optional android.telephony.CallBearerEnum bearer_at_start = 1;
8917
8918 // Bearer (IMS or CS) when the call ended.
8919 // The bearer may change during the call, e.g. due to SRVCC.
8920 optional android.telephony.CallBearerEnum bearer_at_end = 2;
8921
8922 // Direction of the call (incoming or outgoing).
8923 optional android.telephony.CallDirectionEnum direction = 3;
8924
8925 // Time spent setting up the call.
8926 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
8927
8928 // Whether the call ended before the setup was completed.
8929 optional bool setup_failed = 5;
8930
8931 // IMS reason code or CS disconnect cause.
8932 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
8933 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
8934 optional int32 disconnect_reason_code = 6;
8935
8936 // IMS extra code or CS precise disconnect cause.
8937 // For IMS, this code is vendor-specific
8938 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
8939 optional int32 disconnect_extra_code = 7;
8940
8941 // IMS extra message or CS vendor cause.
8942 optional string disconnect_extra_message = 8;
8943
8944 // Radio access technology (RAT) used when call started.
8945 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
8946
8947 // Radio access technology (RAT) used when call terminated.
8948 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
8949
8950 // Number of times RAT changed during the call.
8951 optional int64 rat_switch_count = 11;
8952
8953 // A bitmask of all codecs used during the call.
8954 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
8955 optional int64 codec_bitmask = 12;
8956
8957 // Number of other calls going on during call setup, for the same SIM slot.
8958 optional int32 concurrent_call_count_at_start = 13;
8959
8960 // Number of other calls going on during call termination, for the same SIM slot.
8961 optional int32 concurrent_call_count_at_end = 14;
8962
8963 // Index of the SIM is used, 0 for single-SIM devices.
8964 optional int32 sim_slot_index = 15;
8965
8966 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
8967 optional bool is_multi_sim = 16;
8968
8969 // Whether the call was made with an eSIM profile.
8970 optional bool is_esim = 17;
8971
8972 // Carrier ID of the SIM card.
8973 // See https://source.android.com/devices/tech/config/carrierid.
8974 optional int32 carrier_id = 18;
8975
8976 // Whether an SRVCC has been completed successfully.
8977 // SRVCC (CS fallback) should be recorded in the IMS call since there will be no more SRVCC
8978 // events once the call is switched to CS.
8979 optional bool srvcc_completed = 19;
8980
8981 // Number of SRVCC failures.
8982 optional int64 srvcc_failure_count = 20;
8983
8984 // Number of SRVCC cancellations.
8985 optional int64 srvcc_cancellation_count = 21;
8986
8987 // Whether the Real-Time Text (RTT) was ever used in the call.
8988 optional bool rtt_enabled = 22;
8989
8990 // Whether this was an emergency call.
8991 optional bool is_emergency = 23;
8992
8993 // Whether the call was performed while roaming.
8994 optional bool is_roaming = 24;
8995}
8996
8997/**
8998 * Pulls voice call radio access technology (RAT) usage.
8999 *
9000 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9001 * time. The atom will be skipped if not enough data is available.
9002 *
9003 * Pulled from:
9004 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
9005 */
9006message VoiceCallRatUsage {
9007 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9008 optional int32 carrier_id = 1;
9009
9010 // Radio access technology.
9011 optional android.telephony.NetworkTypeEnum rat = 2;
9012
9013 // Total duration that voice calls spent on this carrier and RAT.
9014 optional int64 total_duration_seconds = 3;
9015
9016 // Total number of calls using this carrier and RAT.
9017 // A call is counted once even if it used the RAT multiple times.
9018 optional int64 call_count = 4;
9019}
9020
9021/**
9022 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9023 *
9024 * Pulled from:
9025 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
9026 */
9027message SimSlotState {
9028 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9029 optional int32 active_slot_count = 1;
9030
9031 // Number of SIM cards (both physical and active eSIM profiles).
9032 // This number is always equal to or less than the number of active SIM slots.
9033 optional int32 sim_count = 2;
9034
9035 // Number of active eSIM profiles.
9036 // This number is always equal to or less than the number of SIMs.
9037 optional int32 esim_count = 3;
9038}
9039
9040/**
9041 * Pulls supported cellular radio access technologies.
9042 *
9043 * This atom reports the capabilities of the device, rather than the network it has access to.
9044 *
9045 * Pulled from:
9046 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
9047 */
9048message SupportedRadioAccessFamily {
9049 // A bitmask of supported radio technologies.
9050 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9051 optional int64 network_type_bitmask = 1;
9052}
9053
9054/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009055 * Logs gnss stats from location service provider
9056 *
9057 * Pulled from:
9058 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9059 */
9060
9061message GnssStats {
9062 // Number of location reports since boot
9063 optional int64 location_reports = 1;
9064
9065 // Total pulled reports of Location failures since boot
9066 optional int64 location_failure_reports = 2;
9067
9068 // Number of time to first fix reports since boot
9069 optional int64 time_to_first_fix_reports = 3;
9070
9071 // Total pulled reported time to first fix (in milli-seconds) since boot
9072 optional int64 time_to_first_fix_milli_s = 4;
9073
9074 // Number of position accuracy reports since boot
9075 optional int64 position_accuracy_reports = 5;
9076
9077 // Total pulled reported position accuracy (in meters) since boot
9078 optional int64 position_accuracy_meters = 6;
9079
9080 // Number of top 4 average CN0 reports since boot
9081 optional int64 top_four_average_cn0_reports = 7;
9082
9083 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9084 optional int64 top_four_average_cn0_db_mhz = 8;
9085
9086 // Number of l5 top 4 average CN0 reports since boot
9087 optional int64 l5_top_four_average_cn0_reports = 9;
9088
9089 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9090 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9091
9092 // Total number of sv status messages reports since boot
9093 optional int64 sv_status_reports = 11;
9094
9095 // Total number of sv status messages reports, where sv is used in fix since boot
9096 optional int64 sv_status_reports_used_in_fix = 12;
9097
9098 // Total number of L5 sv status messages reports since boot
9099 optional int64 l5_sv_status_reports = 13;
9100
9101 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9102 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009103}
Kweku Adams12752132020-02-18 15:36:48 -08009104
9105/**
9106 * Logs when an app is moved to a different standby bucket.
9107 *
9108 * Logged from:
9109 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9110 */
9111message AppStandbyBucketChanged {
9112 optional string package_name = 1;
9113
9114 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9115 optional int32 user_id = 2;
9116
9117 // These enum values match the constants defined in UsageStatsManager.java.
9118 enum Bucket {
9119 BUCKET_UNKNOWN = 0;
9120 BUCKET_EXEMPTED = 5;
9121 BUCKET_ACTIVE = 10;
9122 BUCKET_WORKING_SET = 20;
9123 BUCKET_FREQUENT = 30;
9124 BUCKET_RARE = 40;
9125 BUCKET_RESTRICTED = 45;
9126 BUCKET_NEVER = 50;
9127 }
9128 optional Bucket bucket = 3;
9129
9130 enum MainReason {
9131 MAIN_UNKNOWN = 0;
9132 MAIN_DEFAULT = 0x0100;
9133 MAIN_TIMEOUT = 0x0200;
9134 MAIN_USAGE = 0x0300;
9135 MAIN_FORCED_BY_USER = 0x0400;
9136 MAIN_PREDICTED = 0x0500;
9137 MAIN_FORCED_BY_SYSTEM = 0x0600;
9138 }
9139 optional MainReason main_reason = 4;
9140
9141 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9142 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9143 // UsageStatsManager.java.
9144 optional int32 sub_reason = 5;
9145}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009146
9147/**
9148* Reports a started sharesheet transaction.
9149*
9150* Logged from:
9151* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9152*/
9153message SharesheetStarted {
9154 // The event_id (as for UiEventReported).
9155 optional int32 event_id = 1;
9156 // The calling app's package name.
9157 optional string package_name = 2;
9158 // An identifier to tie together multiple logs relating to the same share event
9159 optional int32 instance_id = 3;
9160 // The mime type of the share
9161 optional string mime_type = 4;
9162 // The number of direct targets the calling app is providing that will be shown.
9163 optional int32 num_app_provided_direct_targets = 5;
9164 // The number of app targets the calling app is providing that will be shown.
9165 optional int32 num_app_provided_app_targets = 6;
9166 // True if the share originates from the workprofile
9167 optional bool is_workprofile = 7;
9168
9169 enum SharesheetPreviewType { // Constants from ChooserActivity.java
9170 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
9171 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
9172 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
9173 }
9174 // How the sharesheet preview is presented.
9175 optional SharesheetPreviewType previewType = 8;
9176
9177 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
9178 INTENT_DEFAULT = 0;
9179 INTENT_ACTION_VIEW = 1;
9180 INTENT_ACTION_EDIT = 2;
9181 INTENT_ACTION_SEND = 3;
9182 INTENT_ACTION_SENDTO = 4;
9183 INTENT_ACTION_SEND_MULTIPLE = 5;
9184 INTENT_ACTION_IMAGE_CAPTURE = 6;
9185 INTENT_ACTION_MAIN = 7;
9186 }
9187 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
9188 optional ResolverActivityIntent intentType = 9;
9189}
9190
9191/**
9192 * Reports a ranking selection event.
9193 *
9194 * Logged from:
9195 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9196 */
9197message RankingSelected {
9198 // The event_id (as for UiEventReported).
9199 optional int32 event_id = 1;
9200 // The relevant app's package name (can be source or picked package).
9201 optional string package_name = 2;
9202 // An identifier to tie together multiple logs relating to the same share event.
9203 optional int32 instance_id = 3;
9204 // Which of the ranked targets got picked, default starting position 0.
9205 optional int32 position_picked = 4;
9206}
Raff Tsaiea4db182020-03-06 07:45:43 +08009207
9208/**
Zhen Sun0bec8d42020-03-25 17:17:29 -07009209 * Logs when TvSettings UI is interacted at.
9210 *
9211 * Logged from: packages/apps/TvSettings
9212 */
9213message TvSettingsUIInteracted {
9214
9215 /** The UI action category */
9216 optional android.app.tvsettings.Action action = 1;
9217
9218 /** The ID of the entry that the users actioned on */
9219 optional android.app.tvsettings.ItemId item_id = 2;
9220
9221 /** Additional information (e.g., navigation direction on page focused) */
9222 optional string additional_info = 3;
9223}
9224
9225/**
Raff Tsaiea4db182020-03-06 07:45:43 +08009226 * Logs settings provider values.
9227 *
9228 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9229 * then write the value to proto.
9230 *
9231 */
9232message SettingSnapshot {
9233
9234 // Setting key
9235 optional string name = 1;
9236
9237 enum SettingsValueType {
9238 NOTASSIGNED = 0;
9239 ASSIGNED_BOOL_TYPE = 1;
9240 ASSIGNED_INT_TYPE = 2;
9241 ASSIGNED_FLOAT_TYPE = 3;
9242 ASSIGNED_STRING_TYPE = 4;
9243 };
9244 // Setting value type
9245 optional SettingsValueType type = 2;
9246
9247 optional bool bool_value = 3;
9248
9249 optional int32 int_value = 4;
9250
9251 optional float float_value = 5;
9252
9253 optional string str_value = 6;
9254
9255 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9256 optional int32 user_id = 7;
9257}