blob: 73ebdc3b7b4381b0cd4285dd1a9ac0aca847199b [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Fan Zhangf837b8e2018-10-23 12:38:30 -070025import "frameworks/base/core/proto/android/app/settings_enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070026import "frameworks/base/core/proto/android/app/job/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080027import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080028import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080029import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080030import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080031import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080032import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080033import "frameworks/base/core/proto/android/server/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080034import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070035import "frameworks/base/core/proto/android/service/procstats_enum.proto";
36import "frameworks/base/core/proto/android/stats/enums.proto";
shawnlinea5b66b2018-11-13 15:05:29 +080037import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070038import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080039import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080040import "frameworks/base/core/proto/android/telephony/enums.proto";
41import "frameworks/base/core/proto/android/view/enums.proto";
arangelov4e994062018-11-13 16:12:38 +000042import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
43import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080044
Yao Chend54f9dd2017-10-17 17:37:48 +000045/**
Stefan Lafonae2df012017-11-14 09:17:21 -080046 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000047 * raw stats log events from the Android system, also known as "atoms."
48 *
49 * This field contains a single oneof with all of the available messages.
50 * The stats-log-api-gen tool runs as part of the Android build and
51 * generates the android.util.StatsLog class, which contains the constants
52 * and methods that Android uses to log.
53 *
Stefan Lafonae2df012017-11-14 09:17:21 -080054 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000055 * Instead, statsd on Android constructs these messages synthetically,
56 * in the format defined here and in stats_log.proto.
57 */
Stefan Lafonae2df012017-11-14 09:17:21 -080058message Atom {
59 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070060 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070061 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
62 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070063 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070064 BleScanResultReceived ble_scan_result_received = 4;
65 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080066 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070067 SyncStateChanged sync_state_changed = 7;
68 ScheduledJobStateChanged scheduled_job_state_changed = 8;
69 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070070 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080071 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
72 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
73 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070074 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
75 MemoryFactorStateChanged memory_factor_state_changed = 15;
76 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
77 CachedKillReported cached_kill_reported = 17;
78 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070079 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080080 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
81 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
82 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070083 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080084 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070085 CameraStateChanged camera_state_changed = 25;
86 FlashlightStateChanged flashlight_state_changed = 26;
87 UidProcessStateChanged uid_process_state_changed = 27;
88 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
89 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070090 BatteryLevelChanged battery_level_changed = 30;
91 ChargingStateChanged charging_state_changed = 31;
92 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070093 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -080094 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -070095 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
96 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070097 WifiLockStateChanged wifi_lock_state_changed = 37;
98 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
99 WifiScanStateChanged wifi_scan_state_changed = 39;
100 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700101 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700102 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700103 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900104 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700105 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800106 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -0800107 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800108 AppStartOccurred app_start_occurred = 48;
109 AppStartCanceled app_start_canceled = 49;
110 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800111 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800112 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800113 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800114 LmkStateChanged lmk_state_changed = 54;
115 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800116 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800117 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800118 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800119 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800120 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800121 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800122 KeyguardStateChanged keyguard_state_changed = 62;
123 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
124 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800125 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800126 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800127 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
128 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800129 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700130 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800131 SpeakerImpedanceReported speaker_impedance_reported = 71;
132 HardwareFailed hardware_failed = 72;
133 PhysicalDropDetected physical_drop_detected = 73;
134 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800135 MobileConnectionStateChanged mobile_connection_state_changed = 75;
136 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700137 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800138 AppCrashOccurred app_crash_occurred = 78;
139 ANROccurred anr_occurred = 79;
140 WTFOccurred wtf_occurred = 80;
141 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700142 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700143 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700144 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700145 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700146 ThermalThrottlingStateChanged thermal_throttling = 86;
Tej Singhd6d6d772018-09-05 17:41:25 -0700147 FingerprintAcquired fingerprint_acquired = 87;
148 FingerprintAuthenticated fingerprint_authenticated = 88;
149 FingerprintErrorOccurred fingerprint_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700150 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700151 BatteryHealthSnapshot battery_health_snapshot = 91;
152 SlowIo slow_io = 92;
153 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700154 PhoneServiceStateChanged phone_service_state_changed = 94;
155 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100156 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700157 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700158 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700159 // TODO: service state change is very noisy shortly after boot, as well
160 // as at other transitions - coming out of doze, device plugged in, etc.
161 // Consider removing this if it becomes a problem
162 ServiceStateChanged service_state_changed = 99;
163 ServiceLaunchReported service_launch_reported = 100;
Yangster-macb89807e2018-11-15 21:10:57 -0800164 PhenotypeFlagStateChanged phenotype_flag_state_changed = 101;
165 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000166 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800167 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
168 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
169 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
170 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
171 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
172 DocsUILaunchReported docs_ui_launch_reported = 109;
173 DocsUIRootVisitedReported docs_ui_root_visited = 110;
174 DocsUIStartupMsReported docs_ui_startup_ms = 111;
175 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800176 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
177 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000178 AppCompacted app_compacted = 115;
lifr030d23a2019-01-11 16:54:51 +0800179 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800180 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
181 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
182 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
183 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800184 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000185 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000186 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800187 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800188 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800189 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
190 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000191 AppDowngraded app_downgraded = 128;
192 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
193 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800194 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
195 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800196 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800197 NfcErrorOccurred nfc_error_occurred = 134;
198 NfcStateChanged nfc_state_changed = 135;
199 NfcBeamOccurred nfc_beam_occurred = 136;
200 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
201 NfcTagOccurred nfc_tag_occurred = 138;
202 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
203 SeStateChanged se_state_changed = 140;
204 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800205 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Yao Chend54f9dd2017-10-17 17:37:48 +0000206 }
David Chenc8a43242017-10-17 16:23:28 -0700207
David Chen6e3e6cb2018-01-03 16:14:06 -0800208 // Pulled events will start at field 10000.
Rafal Slawik3bea8952018-11-15 12:39:33 +0000209 // Next: 10043
David Chenc8a43242017-10-17 16:23:28 -0700210 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800211 WifiBytesTransfer wifi_bytes_transfer = 10000;
212 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
213 MobileBytesTransfer mobile_bytes_transfer = 10002;
214 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800215 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800216 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800217 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800218 CpuTimePerFreq cpu_time_per_freq = 10008;
219 CpuTimePerUid cpu_time_per_uid = 10009;
220 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800221 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800222 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800223 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800224 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800225 SystemElapsedRealtime system_elapsed_realtime = 10014;
226 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800227 CpuActiveTime cpu_active_time = 10016;
228 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000229 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800230 RemainingBatteryCapacity remaining_battery_capacity = 10019;
231 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800232 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100233 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100234 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100235 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000236 DiskStats disk_stats = 10025;
237 DirectoryUsage directory_usage = 10026;
238 AppSize app_size = 10027;
239 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700240 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700241 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700242 NumFingerprints num_fingerprints = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700243 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700244 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800245 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700246 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100247 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100248 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700249 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800250 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
251 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
252 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000253 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800254 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800255 BuildInformation build_information = 10044;
David Chenc8a43242017-10-17 16:23:28 -0700256 }
yroa1fe77c2018-02-26 14:22:54 -0800257
Bookatz76aafcf2018-09-17 16:17:10 -0700258 // DO NOT USE field numbers above 100,000 in AOSP.
259 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
260 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700261}
262
Yao Chend54f9dd2017-10-17 17:37:48 +0000263/**
Yangster-mac20877162017-12-22 17:19:39 -0800264 * This proto represents a node of an attribution chain.
265 * Note: All attribution chains are represented as a repeated field of type
266 * AttributionNode. It is understood that in such arrays, the order is that
267 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000268 */
Yangster-mac20877162017-12-22 17:19:39 -0800269message AttributionNode {
270 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800271 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800272
Yangster-mac20877162017-12-22 17:19:39 -0800273 // The (optional) string tag for an element in the attribution chain. If the
274 // element has no tag, it is encoded as an empty string.
275 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700276}
277
Yangster-mac48b3d622018-08-18 12:38:11 -0700278message KeyValuePair {
279 optional int32 key = 1;
280 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700281 int32 value_int = 2;
282 int64 value_long = 3;
283 string value_str = 4;
284 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700285 }
286}
287
288message KeyValuePairsAtom {
289 optional int32 uid = 1;
290 repeated KeyValuePair pairs = 2;
291}
292
Yao Chend54f9dd2017-10-17 17:37:48 +0000293/*
294 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800295 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000296 *
297 * RULES:
298 * - The field ids for each atom must start at 1, and count upwards by 1.
299 * Skipping field ids is not allowed.
300 * - These form an API, so renaming, renumbering or removing fields is
301 * not allowed between android releases. (This is not currently enforced,
302 * but there will be a tool to enforce this restriction).
303 * - The types must be built-in protocol buffer types, namely, no sub-messages
304 * are allowed (yet). The bytes type is also not allowed.
305 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800306 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000307 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800308 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000309 * - A field that is a uid should be a string field, tagged with the [xxx]
310 * annotation. The generated code on android will be represented by UIDs,
311 * and those UIDs will be translated in xxx to those strings.
312 *
313 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700314 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000315 * - If there is a UID, it goes first. Think in an object-oriented fashion.
316 * *****************************************************************************
317 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700318
Yao Chend54f9dd2017-10-17 17:37:48 +0000319/**
Yangster-mace16189a2018-08-26 12:20:16 -0700320 * Logs when the Thermal service HAL notifies the throttling start/stop events.
321 *
322 * Logged from:
323 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
324 */
325message ThermalThrottlingStateChanged {
326 optional android.os.TemperatureTypeEnum sensor_type = 1;
327
328 enum State {
329 UNKNOWN = 0;
330 START = 1;
331 STOP = 2;
332 }
333
334 optional State state = 2;
335
336 optional float temperature = 3;
337}
338
339/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000340 * Logs when the screen state changes.
341 *
342 * Logged from:
343 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
344 */
345message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800346 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700347 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700348}
Yao Chend54f9dd2017-10-17 17:37:48 +0000349
350/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700351 * Logs that the process state of the uid, as determined by ActivityManager
352 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000353 *
354 * Logged from:
355 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
356 */
Bookatzc1a050a2017-10-10 15:49:28 -0700357message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700358 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000359
Bookatzdb026a22018-01-10 19:01:56 -0800360 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700361 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000362}
363
364/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700365 * Logs process state change of a process, as per the activity manager.
366 *
367 * Logged from:
368 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
369 */
370message ProcessStateChanged {
371 optional int32 uid = 1;
372 optional string process_name = 2;
373 optional string package_name = 3;
374 // TODO: remove this when validation is done
375 optional int64 version = 5;
376 // The state, from frameworks/base/core/proto/android/app/enums.proto.
377 optional android.app.ProcessStateEnum state = 4;
378}
379
380/**
381 * Logs when ActivityManagerService sleep state is changed.
382 *
383 * Logged from:
384 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
385 */
386message ActivityManagerSleepStateChanged {
387 // TODO: import frameworks proto
388 enum State {
389 UNKNOWN = 0;
390 ASLEEP = 1;
391 AWAKE = 2;
392 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700393 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700394}
395
396/**
397 * Logs when system memory state changes.
398 *
399 * Logged from:
400 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
401 */
402message MemoryFactorStateChanged {
403 // TODO: import frameworks proto
404 enum State {
405 MEMORY_UNKNOWN = 0;
406 NORMAL = 1; // normal.
407 MODERATE = 2; // moderate memory pressure.
408 LOW = 3; // low memory.
409 CRITICAL = 4; // critical memory.
410
411 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700412 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700413}
414
415/**
416 * Logs when app is using too much cpu, according to ActivityManagerService.
417 *
418 * Logged from:
419 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
420 */
421message ExcessiveCpuUsageReported {
422 optional int32 uid = 1;
423 optional string process_name = 2;
424 optional string package_name = 3;
425 // package version. TODO: remove this when validation is done
426 optional int64 version = 4;
427}
428
429/**
430 * Logs when a cached process is killed, along with its pss.
431 *
432 * Logged from:
433 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
434 */
435message CachedKillReported {
436 optional int32 uid = 1;
437 optional string process_name = 2;
438 optional string package_name = 3;
439 // TODO: remove this when validation is done
440 optional int64 version = 5;
441 optional int64 pss = 4;
442}
443
444/**
445 * Logs when memory stats of a process is reported.
446 *
447 * Logged from:
448 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
449 */
450message ProcessMemoryStatReported {
451 optional int32 uid = 1;
452 optional string process_name = 2;
453 optional string package_name = 3;
454 //TODO: remove this when validation is done
455 optional int64 version = 9;
456 optional int64 pss = 4;
457 optional int64 uss = 5;
458 optional int64 rss = 6;
459 enum Type {
460 ADD_PSS_INTERNAL_SINGLE = 0;
461 ADD_PSS_INTERNAL_ALL_MEM = 1;
462 ADD_PSS_INTERNAL_ALL_POLL = 2;
463 ADD_PSS_EXTERNAL = 3;
464 ADD_PSS_EXTERNAL_SLOW = 4;
465 }
466 optional Type type = 7;
467 optional int64 duration = 8;
468}
469
470/**
Bookatzc1a050a2017-10-10 15:49:28 -0700471 * Logs that a process started, finished, crashed, or ANRed.
472 *
473 * Logged from:
474 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
475 */
476message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700477 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700478
David Chen0b5c90c2018-01-25 16:51:49 -0800479 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800480 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700481
Bookatzddccf0a2017-11-28 16:48:14 -0800482 // What lifecycle state the process changed to.
483 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800484 enum State {
485 FINISHED = 0;
486 STARTED = 1;
487 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800488 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800489 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700490}
491
Bookatzc1a050a2017-10-10 15:49:28 -0700492/**
493 * Logs when the ble scan state changes.
494 *
495 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700496 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700497 */
498message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800499 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700500
501 enum State {
502 OFF = 0;
503 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700504 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
505 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700506 }
507 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700508
Bookatze5ec0b42018-03-26 13:34:56 -0700509 // Does the scan have a filter.
510 optional bool is_filtered = 3;
511 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
512 optional bool is_first_match = 4;
513 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
514 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700515}
516
517/**
518 * Logs reporting of a ble scan finding results.
519 *
520 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700521 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700522 */
Bookatzae6738e2018-09-13 11:38:56 -0700523// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700524message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800525 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700526
527 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800528 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700529}
530
531/**
532 * Logs when a sensor state changes.
533 *
534 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700535 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700536 */
537message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800538 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700539
Bookatzc1a050a2017-10-10 15:49:28 -0700540 // The id (int) of the sensor.
541 optional int32 sensor_id = 2;
542
543 enum State {
544 OFF = 0;
545 ON = 1;
546 }
547 optional State state = 3;
548}
549
Bookatzc1a050a2017-10-10 15:49:28 -0700550/**
551 * Logs when GPS state changes.
552 *
553 * Logged from:
554 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
555 */
556message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800557 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700558
559 enum State {
560 OFF = 0;
561 ON = 1;
562 }
563 optional State state = 2;
564}
565
Bookatz48d362e2018-11-06 15:49:08 -0800566/**
567 * Logs when GPS signal quality.
568 *
569 * Logged from:
570 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
571 */
572message GpsSignalQualityChanged {
573 optional android.server.location.GpsSignalQualityEnum level = 1;
574}
575
Bookatzc1a050a2017-10-10 15:49:28 -0700576
577/**
578 * Logs when a sync manager sync state changes.
579 *
580 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700581 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700582 */
583message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800584 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700585
David Chen0b5c90c2018-01-25 16:51:49 -0800586 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800587 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700588
589 enum State {
590 OFF = 0;
591 ON = 1;
592 }
593 optional State state = 3;
594}
595
Yangster-mac96353002018-09-05 11:18:55 -0700596/*
597 * Deferred job stats.
598 *
599 * Logged from:
600 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
601*/
602message DeferredJobStatsReported {
603 repeated AttributionNode attribution_node = 1;
604
605 // Number of jobs deferred.
606 optional int32 num_jobs_deferred = 2;
607
608 // Time since the last job runs.
609 optional int64 time_since_last_job_millis = 3;
610}
611
Bookatzc1a050a2017-10-10 15:49:28 -0700612/**
613 * Logs when a job scheduler job state changes.
614 *
615 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700616 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700617 */
618message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800619 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700620
621 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800622 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700623
624 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800625 FINISHED = 0;
626 STARTED = 1;
627 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700628 }
629 optional State state = 3;
630
Tej Singh33a412b2018-03-16 18:43:59 -0700631 // The reason a job has stopped.
632 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700633 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700634 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700635}
636
637/**
638 * Logs when the audio state changes.
639 *
640 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700641 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700642 */
643message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800644 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700645
646 enum State {
647 OFF = 0;
648 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700649 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
650 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700651 }
652 optional State state = 2;
653}
654
655/**
656 * Logs when the video codec state changes.
657 *
658 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700659 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700660 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800661message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800662 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700663
664 enum State {
665 OFF = 0;
666 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700667 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
668 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700669 }
670 optional State state = 2;
671}
672
673/**
674 * Logs when the flashlight state changes.
675 *
676 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700677 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700678 */
679message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800680 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700681
682 enum State {
683 OFF = 0;
684 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700685 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
686 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700687 }
688 optional State state = 2;
689}
690
691/**
692 * Logs when the camera state changes.
693 *
694 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700695 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700696 */
697message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800698 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700699
700 enum State {
701 OFF = 0;
702 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700703 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
704 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700705 }
706 optional State state = 2;
707}
708
709/**
710 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000711 *
712 * Logged from:
713 * TODO
714 */
Bookatzd6746242017-10-24 18:39:35 -0700715message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800716 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000717
Bookatz1a1b0462018-01-12 11:47:03 -0800718 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
719 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700720 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700721
722 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
723 optional string tag = 3;
724
725 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800726 RELEASE = 0;
727 ACQUIRE = 1;
728 CHANGE_RELEASE = 2;
729 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700730 }
731 optional State state = 4;
732}
733
734/**
Bookatzc1a050a2017-10-10 15:49:28 -0700735 * Logs when a partial wakelock is considered 'long' (over 1 min).
736 *
737 * Logged from:
738 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
739 */
740message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800741 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700742
Yao Chend54f9dd2017-10-17 17:37:48 +0000743 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
744 optional string tag = 2;
745
Bookatzc1a050a2017-10-10 15:49:28 -0700746 // TODO: I have no idea what this is.
747 optional string history_tag = 3;
748
749 enum State {
750 OFF = 0;
751 ON = 1;
752 }
753 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000754}
755
Bookatzc1a050a2017-10-10 15:49:28 -0700756/**
Bookatza66083f2018-09-20 17:24:00 -0700757 * Logs when the device is interactive, according to the PowerManager Notifier.
758 *
759 * Logged from:
760 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
761 */
762message InteractiveStateChanged {
763 enum State {
764 OFF = 0;
765 ON = 1;
766 }
767 optional State state = 1;
768}
769
770/**
Bookatzc1a050a2017-10-10 15:49:28 -0700771 * Logs Battery Saver state change.
772 *
773 * Logged from:
774 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
775 */
776message BatterySaverModeStateChanged {
777 enum State {
778 OFF = 0;
779 ON = 1;
780 }
781 optional State state = 1;
782}
783
784/**
785 * Logs Doze mode state change.
786 *
787 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800788 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700789 */
790message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800791 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800792}
793
794
795/**
796 * Logs state change of Doze mode including maintenance windows.
797 *
798 * Logged from:
799 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
800 */
801message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800802 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700803}
804
805/**
806 * Logs screen brightness level.
807 *
808 * Logged from:
809 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
810 */
811message ScreenBrightnessChanged {
812 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
813 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700814}
815
816/**
817 * Logs battery level (percent full, from 0 to 100).
818 *
819 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700820 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700821 */
822message BatteryLevelChanged {
823 // Battery level. Should be in [0, 100].
824 optional int32 battery_level = 1;
825}
826
827/**
828 * Logs change in charging status of the device.
829 *
830 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700831 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700832 */
833message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800834 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
835 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700836}
837
838/**
839 * Logs whether the device is plugged in, and what power source it is using.
840 *
841 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700842 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700843 */
844message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800845 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
846 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700847}
848
Bookatz8c6571b2017-10-24 15:04:41 -0700849/**
850 * Logs when an app's wakeup alarm fires.
851 *
852 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700853 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700854 */
855message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800856 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800857
858 // Name of the wakeup alarm.
859 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700860
861 // Name of source package (for historical reasons, since BatteryStats tracked it).
862 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800863}
864
865/**
866 * Logs when an an app causes the mobile radio to change state.
867 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
868 *
869 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700870 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800871 */
872message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800873 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800874
Bookatz1a1b0462018-01-12 11:47:03 -0800875 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
876 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800877}
878
879/**
880 * Logs when an an app causes the wifi radio to change state.
881 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
882 *
883 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700884 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800885 */
886message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800887 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800888
Bookatz1a1b0462018-01-12 11:47:03 -0800889 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
890 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700891}
892
893/**
894 * Logs kernel wakeup reasons and aborts.
895 *
896 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700897 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700898 */
899message KernelWakeupReported {
900 // Name of the kernel wakeup reason (or abort).
901 optional string wakeup_reason_name = 1;
902
903 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800904 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700905}
906
907/**
Bookatzda1798c2018-12-13 14:16:00 -0800908 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800909 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800910 *
911 * Logged from:
912 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
913 */
914message WifiEnabledStateChanged {
915 enum State {
916 OFF = 0;
917 ON = 1;
918 }
919 optional State state = 1;
920}
921
922/**
923 * 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 -0800924 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
925 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800926 *
927 * Logged from:
928 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
929 */
930message WifiRunningStateChanged {
931 repeated AttributionNode attribution_node = 1;
932
933 enum State {
934 OFF = 0;
935 ON = 1;
936 }
937 optional State state = 2;
938}
939
940/**
Bookatze5885242017-10-24 20:10:31 -0700941 * Logs wifi locks held by an app.
942 *
943 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700944 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700945 */
946message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800947 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700948
949 enum State {
950 OFF = 0;
951 ON = 1;
952 }
953 optional State state = 2;
954}
955
956/**
957 * Logs wifi signal strength changes.
958 *
959 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800960 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -0700961 */
962message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800963 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
964 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700965}
966
967/**
968 * Logs wifi scans performed by an app.
969 *
970 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800971 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -0700972 */
973message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800974 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700975
976 enum State {
977 OFF = 0;
978 ON = 1;
979 }
980 optional State state = 2;
981}
982
983/**
Tej Singh4503e102018-01-04 14:35:01 -0800984 * Logs wifi multicast locks held by an app
985 *
986 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800987 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -0800988 */
989message WifiMulticastLockStateChanged {
990 repeated AttributionNode attribution_node = 1;
991
992 enum State {
993 OFF = 0;
994 ON = 1;
995 }
996 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -0800997
998 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -0800999}
1000
1001/**
Tej Singh1ea42892018-01-19 09:27:00 -08001002 * Logs shutdown reason and duration on next boot.
1003 *
1004 * Logged from:
1005 * frameworks/base/core/java/com/android/server/BootReceiver.java
1006 */
1007message ShutdownSequenceReported {
1008 // True if shutdown is for a reboot. Default: false if we do not know.
1009 optional bool reboot = 1;
1010
1011 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1012 optional string reason = 2;
1013
1014 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1015 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001016 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001017
1018 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001019 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001020}
1021
Tej Singh6483ea42018-01-25 17:45:49 -08001022
1023/**
1024 * Logs boot reason and duration.
1025 *
1026 * Logged from:
1027 * system/core/bootstat/bootstat.cpp
1028 */
1029message BootSequenceReported {
1030 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1031 // Default: "<EMPTY>" if not available.
1032 optional string bootloader_reason = 1;
1033
1034 // Reason for system boot. Eg. bootloader, reboot,userrequested
1035 // Default: "<EMPTY>" if not available.
1036 optional string system_reason = 2;
1037
1038 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001039 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001040
1041 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001042 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001043
1044 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001045 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001046
1047 // Time since last boot in ms. Default: 0 if not available.
1048 optional int64 time_since_last_boot = 6;
1049}
1050
Tej Singhc477d9c2018-02-05 18:31:39 -08001051
1052/**
1053 * Logs call state and disconnect cause (if applicable).
1054 *
1055 * Logged from:
1056 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1057 */
1058message CallStateChanged {
1059 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1060 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1061 optional android.telecom.CallStateEnum call_state = 1;
1062
1063 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1064 // This value is only applicable when the call_state is DISCONNECTED, and
1065 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1066 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1067 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1068
1069 // True if the call is self-managed, which are apps that use the
1070 // telecom infrastructure to make their own calls.
1071 optional bool self_managed = 3;
1072
1073 // True if call is external. External calls are calls on connected Wear
1074 // devices but show up in Telecom so the user can pull them onto the device.
1075 optional bool external_call = 4;
1076}
1077
Tej Singh1ea42892018-01-19 09:27:00 -08001078/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001079 * Logs keyguard state. The keyguard is the lock screen.
1080 *
1081 * Logged from:
1082 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1083 */
1084message KeyguardStateChanged {
1085 enum State {
1086 UNKNOWN = 0;
1087 // The keyguard is hidden when the phone is unlocked.
1088 HIDDEN = 1;
1089 // The keyguard is shown when the phone is locked (screen turns off).
1090 SHOWN= 2;
1091 // The keyguard is occluded when something is overlaying the keyguard.
1092 // Eg. Opening the camera while on the lock screen.
1093 OCCLUDED = 3;
1094 }
1095 optional State state = 1;
1096}
1097
1098/**
1099 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1100 * prompts the user to enter a password (pattern, pin, etc).
1101 *
1102 * Logged from:
1103 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1104 */
1105
1106message KeyguardBouncerStateChanged {
1107 enum State {
1108 UNKNOWN = 0;
1109 // Bouncer is hidden, either as a result of successfully entering the
1110 // password, screen timing out, or user going back to lock screen.
1111 HIDDEN = 1;
1112 // This is when the user is being prompted to enter the password.
1113 SHOWN = 2;
1114 }
1115 optional State state = 1;
1116}
1117
1118/**
1119 * Logs the result of entering a password into the keyguard bouncer.
1120 *
1121 * Logged from:
1122 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1123 */
1124message KeyguardBouncerPasswordEntered {
1125 enum BouncerResult {
1126 UNKNOWN = 0;
1127 // The password entered was incorrect.
1128 FAILURE = 1;
1129 // The password entered was correct.
1130 SUCCESS = 2;
1131 }
1132 optional BouncerResult result = 1;
1133}
1134
Tej Singha883b372018-02-15 11:30:01 -08001135/*
1136 * Logs changes to the configuration of the device. The configuration is defined
1137 * in frameworks/base/core/java/android/content/res/Configuration.java
1138 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1139 * Please go there to interpret the possible values each field can be.
1140 *
1141 * Logged from:
1142 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1143 */
1144message ResourceConfigurationChanged {
1145 // Bit mask of color capabilities of the screen.
1146 // Contains information about the color gamut and hdr mode of the screen.
1147 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001148 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001149
1150 // The target screen density being rendered to.
1151 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001152 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001153
1154 // Current user preference for the scaling factor for fonts,
1155 // relative to the base density scaling.
1156 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001157 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001158
1159 // Flag indicating whether the hard keyboard is hidden.
1160 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001161 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001162
1163 // The type of keyboard attached to the device.
1164 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1165 optional int32 keyboard = 5;
1166
1167 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1168 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001169 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001170
1171 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1172 // 0 if undefined.
1173 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1174 optional int32 mcc = 7;
1175
1176 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1177 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1178 // MNC_ZERO symbol defined in Configuration.java.
1179 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1180 optional int32 mnc = 8;
1181
1182 // The kind of navigation available on the device.
1183 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1184 optional int32 navigation = 9;
1185
1186 // Flag indicating whether the navigation is available.
1187 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001188 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001189
1190 // Overall orientation of the screen.
1191 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1192 optional int32 orientation = 11;
1193
1194 // The current height of the available screen space, in dp units.
1195 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001196 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001197
1198 // Bit mask of overall layout of the screen.
1199 // Contains information about screen size, whether the screen is wider/taller
1200 // than normal, whether the screen layout is right-tl-left or left-to-right,
1201 // and whether the screen has a rounded shape.
1202 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001203 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001204
1205 // Current width of the available screen space, in dp units.
1206 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001207 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001208
1209 // The smallest screen size an application will see in normal operation.
1210 // This is the smallest value of both screenWidthDp and screenHeightDp
1211 // in portrait and landscape.
1212 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001213 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001214
1215 // The type of touch screen attached to the device.
1216 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1217 optional int32 touchscreen = 16;
1218
1219 // Bit mask of the ui mode.
1220 // Contains information about the overall ui mode of the device.
1221 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1222 // Also contains information about whether the device is in night mode.
1223 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001224 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001225}
1226
Tej Singheee317b2018-03-07 19:28:05 -08001227
1228/**
1229 * Logs changes in the connection state of the mobile radio.
1230 *
1231 * Logged from:
1232 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1233 */
1234message MobileConnectionStateChanged {
1235 // States are from the state machine DataConnection.java.
1236 enum State {
1237 UNKNOWN = 0;
1238 // The connection is inactive, or disconnected.
1239 INACTIVE = 1;
1240 // The connection is being activated, or connecting.
1241 ACTIVATING = 2;
1242 // The connection is active, or connected.
1243 ACTIVE = 3;
1244 // The connection is disconnecting.
1245 DISCONNECTING = 4;
1246 // The connection is disconnecting after creating a connection.
1247 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1248 }
1249 optional State state = 1;
1250 // For multi-sim phones, this distinguishes between the sim cards.
1251 optional int32 sim_slot_index = 2;
1252 // Used to identify the connection. Starts at 0 and increments by 1 for
1253 // every new network created. Resets whenever the device reboots.
1254 optional int32 data_connection_id = 3;
1255 // A bitmask for the capabilities of this connection.
1256 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1257 // Default value (if we have no information): 0
1258 optional int64 capabilities = 4;
1259 // If this connection has internet.
1260 // This just checks if the DEFAULT bit of capabilities is set.
1261 optional bool has_internet = 5;
1262}
1263
1264/**
1265 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1266 *
1267 * Logged from:
1268 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1269 */
1270message MobileRadioTechnologyChanged {
1271 optional android.telephony.NetworkTypeEnum state = 1;
1272 // For multi-sim phones, this distinguishes between the sim cards.
1273 optional int32 sim_slot_index = 2;
1274}
1275
Andrew Chantb56388b2018-03-22 21:07:33 -07001276/**
1277 * Logs the VID and PID of any connected USB devices.
1278 *
1279 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1280 *
1281 * Logged by Vendor.
1282 */
1283message UsbDeviceAttached {
1284 optional int32 vid = 1;
1285 optional int32 pid = 2;
1286 optional bool has_audio = 3;
1287 optional bool has_hid = 4;
1288 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001289 enum State {
1290 STATE_DISCONNECTED = 0;
1291 STATE_CONNECTED = 1;
1292 }
1293 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001294 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001295}
1296
Tej Singheee317b2018-03-07 19:28:05 -08001297
Tej Singhdd7bd352018-02-09 19:33:15 -08001298/**
Tej Singh5d991e12018-03-09 19:48:11 -08001299 * Logs when Bluetooth is enabled and disabled.
1300 *
1301 * Logged from:
1302 * services/core/java/com/android/server/BluetoothManagerService.java
1303 */
1304message BluetoothEnabledStateChanged {
1305 repeated AttributionNode attribution_node = 1;
1306 // Whether or not bluetooth is enabled on the device.
1307 enum State {
1308 UNKNOWN = 0;
1309 ENABLED = 1;
1310 DISABLED = 2;
1311 }
1312 optional State state = 2;
1313 // The reason for being enabled/disabled.
1314 // Eg. Airplane mode, crash, application request.
1315 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1316 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001317 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001318}
1319
1320/**
Jack Hed9837c82019-01-09 01:19:13 -08001321 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001322 *
1323 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001324 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1325 *
1326 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001327 */
1328message BluetoothConnectionStateChanged {
1329 // The state of the connection.
1330 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1331 optional android.bluetooth.ConnectionStateEnum state = 1;
1332 // An identifier that can be used to match connect and disconnect events.
1333 // Currently is last two bytes of a hash of a device level ID and
1334 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001335 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1336 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001337 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1338 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001339 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001340 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001341 // An identifier that can be used to match events for this device.
1342 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1343 // Salt: Randomly generated 256 bit value
1344 // Hash algorithm: HMAC-SHA256
1345 // Size: 32 byte
1346 // Default: null or empty if the device identifier is not known
1347 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1348}
1349
1350/**
1351 * Logs when a Bluetooth device connects and disconnects over ACL
1352 *
1353 * Logged from:
1354 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1355 *
1356 * Next Tag: 3
1357 */
1358message BluetoothAclConnectionStateChanged {
1359 // An identifier that can be used to match events for this device.
1360 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1361 // Salt: Randomly generated 256 bit value
1362 // Hash algorithm: HMAC-SHA256
1363 // Size: 32 byte
1364 // Default: null or empty if the device identifier is not known
1365 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1366 // The state of the connection.
1367 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1368 optional android.bluetooth.ConnectionStateEnum state = 2;
1369}
1370
1371/**
1372 * Logs when a Bluetooth device connects and disconnects over SCO
1373 *
1374 * Logged from:
1375 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1376 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1377 *
1378 * Next Tag: 4
1379 */
1380message BluetoothScoConnectionStateChanged {
1381 // An identifier that can be used to match events for this device.
1382 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1383 // Salt: Randomly generated 256 bit value
1384 // Hash algorithm: HMAC-SHA256
1385 // Size: 32 byte
1386 // Default: null or empty if the device identifier is not known
1387 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1388 // The state of the connection.
1389 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1390 optional android.bluetooth.ConnectionStateEnum state = 2;
1391 // Codec used for this SCO connection
1392 // Default: UNKNOWN
1393 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001394}
1395
Jack Heab86dbd22018-12-18 15:43:27 -08001396// Logs when there is an event affecting Bluetooth device's link layer connection.
1397// - This event is triggered when there is a related HCI command or event
1398// - Users of this metrics can deduce Bluetooth device's connection state from these events
1399// - HCI commands are logged before the command is sent, after receiving command status, and after
1400// receiving command complete
1401// - HCI events are logged when they arrive
1402//
1403// Low level log from system/bt
1404//
1405// Bluetooth classic commands:
1406// - CMD_CREATE_CONNECTION
1407// - CMD_DISCONNECT
1408// - CMD_CREATE_CONNECTION_CANCEL
1409// - CMD_ACCEPT_CONNECTION_REQUEST
1410// - CMD_REJECT_CONNECTION_REQUEST
1411// - CMD_SETUP_ESCO_CONNECTION
1412// - CMD_ACCEPT_ESCO_CONNECTION
1413// - CMD_REJECT_ESCO_CONNECTION
1414// - CMD_ENH_SETUP_ESCO_CONNECTION
1415// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1416//
1417// Bluetooth low energy commands:
1418// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1419// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1420// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1421// - CMD_BLE_CLEAR_WHITE_LIST
1422// - CMD_BLE_ADD_WHITE_LIST
1423// - CMD_BLE_REMOVE_WHITE_LIST
1424//
1425// Bluetooth classic events:
1426// - EVT_CONNECTION_COMP
1427// - EVT_CONNECTION_REQUEST
1428// - EVT_DISCONNECTION_COMP
1429// - EVT_ESCO_CONNECTION_COMP
1430// - EVT_ESCO_CONNECTION_CHANGED
1431//
1432// Bluetooth low energy meta events:
1433// - BLE_EVT_CONN_COMPLETE_EVT
1434// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1435//
1436// Next tag: 10
1437message BluetoothLinkLayerConnectionEvent {
1438 // An identifier that can be used to match events for this device.
1439 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1440 // Salt: Randomly generated 256 bit value
1441 // Hash algorithm: HMAC-SHA256
1442 // Size: 32 byte
1443 // Default: null or empty if the device identifier is not known
1444 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1445 // Connection handle of this connection if available
1446 // Range: 0x0000 - 0x0EFF (12 bits)
1447 // Default: 0xFFFF if the handle is unknown
1448 optional int32 connection_handle = 2;
1449 // Direction of the link
1450 // Default: DIRECTION_UNKNOWN
1451 optional android.bluetooth.DirectionEnum direction = 3;
1452 // Type of this link
1453 // Default: LINK_TYPE_UNKNOWN
1454 optional android.bluetooth.LinkTypeEnum type = 4;
1455
1456 // Reason metadata for this link layer connection event, rules for interpretation:
1457 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1458 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1459 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1460 // set and valid, ignore hci_ble_event
1461
1462 // HCI command associated with this event
1463 // Default: CMD_UNKNOWN
1464 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1465 // HCI event associated with this event
1466 // Default: EVT_UNKNOWN
1467 optional android.bluetooth.hci.EventEnum hci_event = 6;
1468 // HCI BLE meta event associated with this event
1469 // Default: BLE_EVT_UNKNOWN
1470 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1471 // HCI command status code if this is triggerred by hci_cmd
1472 // Default: STATUS_UNKNOWN
1473 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1474 // HCI reason code associated with this event
1475 // Default: STATUS_UNKNOWN
1476 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1477}
1478
1479
Tej Singh5d991e12018-03-09 19:48:11 -08001480/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001481 * Logs when something is plugged into or removed from the USB-C connector.
1482 *
1483 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001484 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08001485 */
1486message UsbConnectorStateChanged {
1487 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001488 STATE_DISCONNECTED = 0;
1489 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08001490 }
1491 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001492 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08001493 // Last active session in ms.
1494 // 0 when the port is in connected state.
1495 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001496}
1497
1498/**
1499 * Logs the reported speaker impedance.
1500 *
1501 * Logged from:
1502 * Vendor audio implementation.
1503 */
1504message SpeakerImpedanceReported {
1505 optional int32 speaker_location = 1;
1506 optional int32 impedance = 2;
1507}
1508
1509/**
1510 * Logs the report of a failed hardware.
1511 *
1512 * Logged from:
1513 * Vendor HALs.
1514 *
1515 */
1516message HardwareFailed {
1517 enum HardwareType {
1518 HARDWARE_FAILED_UNKNOWN = 0;
1519 HARDWARE_FAILED_MICROPHONE = 1;
1520 HARDWARE_FAILED_CODEC = 2;
1521 HARDWARE_FAILED_SPEAKER = 3;
1522 HARDWARE_FAILED_FINGERPRINT = 4;
1523 }
1524 optional HardwareType hardware_type = 1;
1525
1526 /* hardware_location allows vendors to differentiate between multiple instances of
1527 * the same hardware_type. The specific locations are vendor defined integers,
1528 * referring to board-specific numbering schemes.
1529 */
1530 optional int32 hardware_location = 2;
1531
1532 /* failure_code is specific to the HardwareType of the failed hardware.
1533 * It should use the enum values defined below.
1534 */
1535 enum MicrophoneFailureCode {
1536 MICROPHONE_FAILURE_COMPLETE = 0;
1537 }
1538 enum CodecFailureCode {
1539 CODEC_FAILURE_COMPLETE = 0;
1540 }
1541 enum SpeakerFailureCode {
1542 SPEAKER_FAILURE_COMPLETE = 0;
1543 SPEAKER_FAILURE_HIGH_Z = 1;
1544 SPEAKER_FAILURE_SHORT = 2;
1545 }
1546 enum FingerprintFailureCode {
1547 FINGERPRINT_FAILURE_COMPLETE = 0;
1548 FINGERPRINT_SENSOR_BROKEN = 1;
1549 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1550 }
1551 optional int32 failure_code = 3;
1552}
1553
1554/**
1555 * Log an event when the device has been physically dropped.
1556 * Reported from the /vendor partition.
1557 */
1558message PhysicalDropDetected {
1559 // Confidence that the event was actually a drop, 0 -> 100
1560 optional int32 confidence_pctg = 1;
1561 // Peak acceleration of the drop, in 1/1000s of a g.
1562 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001563 // Duration of freefall in ms
1564 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001565}
1566
1567/**
1568 * Log bucketed battery charge cycles.
1569 *
1570 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08001571 * a given charge point. For example, if 10 cycle buckets are
1572 * initialized, bucket 1 is the lowest 1/10th of the battery,
1573 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08001574 *
1575 * Logged from:
1576 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1577 */
1578message ChargeCyclesReported {
1579 optional int32 cycle_bucket_1 = 1;
1580 optional int32 cycle_bucket_2 = 2;
1581 optional int32 cycle_bucket_3 = 3;
1582 optional int32 cycle_bucket_4 = 4;
1583 optional int32 cycle_bucket_5 = 5;
1584 optional int32 cycle_bucket_6 = 6;
1585 optional int32 cycle_bucket_7 = 7;
1586 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08001587 optional int32 cycle_bucket_9 = 9;
1588 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08001589}
1590
1591/**
Howard Roa46b6582018-09-18 16:45:02 -07001592 * Log battery health snapshot.
1593 *
1594 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1595 * are snapshotted periodically over 24hrs.
1596 */
1597message BatteryHealthSnapshot {
1598 enum BatterySnapshotType {
1599 UNKNOWN = 0;
1600 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1601 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1602 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1603 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1604 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1605 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1606 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1607 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1608 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1609 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1610 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1611 }
1612 optional BatterySnapshotType type = 1;
1613 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001614 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001615 // Voltage Battery Voltage, in microVolts.
1616 optional int32 voltage_micro_volt = 3;
1617 // Current Battery current, in microAmps.
1618 optional int32 current_micro_amps = 4;
1619 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1620 optional int32 open_circuit_micro_volt = 5;
1621 // Resistance Battery Resistance, in microOhms.
1622 optional int32 resistance_micro_ohm = 6;
1623 // Level Battery Level, as % of full.
1624 optional int32 level_percent = 7;
1625}
1626
1627/**
1628 * Log slow I/O operations on the primary storage.
1629 */
1630message SlowIo {
1631 // Classifications of IO Operations.
1632 enum IoOperation {
1633 UNKNOWN = 0;
1634 READ = 1;
1635 WRITE = 2;
1636 UNMAP = 3;
1637 SYNC = 4;
1638 }
1639 optional IoOperation operation = 1;
1640
1641 // The number of slow IO operations of this type over 24 hours.
1642 optional int32 count = 2;
1643}
1644
1645/**
1646 * Log battery caused shutdown with the last recorded voltage.
1647 */
1648message BatteryCausedShutdown {
1649 // The last recorded battery voltage prior to shutdown.
1650 optional int32 last_recorded_micro_volt = 1;
1651}
1652
1653/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001654 * Logs the duration of a davey (jank of >=700ms) when it occurs
1655 *
1656 * Logged from:
1657 * frameworks/base/libs/hwui/JankTracker.cpp
1658 */
1659message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001660 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001661 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001662
Tej Singhbb8554a2018-01-26 11:59:14 -08001663 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001664 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001665}
1666
1667/**
Bookatze5885242017-10-24 20:10:31 -07001668 * Logs phone signal strength changes.
1669 *
1670 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001671 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001672 */
1673message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001674 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1675 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001676}
1677
Yangster4ccebea2018-10-09 17:09:02 -07001678
1679/**
1680 * Logs when the phone state, sim state or signal strength changes
1681 *
1682 * Logged from:
1683 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1684 */
1685message PhoneServiceStateChanged {
1686 optional android.telephony.ServiceStateEnum state = 1;
1687 optional android.telephony.SimStateEnum sim_state = 2;
1688 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1689}
1690
1691/**
1692 * Logs when the phone becomes on or off.
1693 *
1694 * Logged from:
1695 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1696 */
1697message PhoneStateChanged {
1698 enum State {
1699 OFF = 0;
1700 ON = 1;
1701 }
1702 optional State state = 1;
1703}
1704
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001705message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07001706 optional android.stats.launcher.LauncherAction action = 1;
1707 optional android.stats.launcher.LauncherState src_state = 2;
1708 optional android.stats.launcher.LauncherState dst_state = 3;
1709 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001710 optional bool is_swipe_up_enabled = 5;
1711}
1712
David Chenc28b2bb2017-10-24 12:52:52 -07001713/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001714 * Logs when Settings UI has changed.
1715 *
1716 * Logged from:
1717 * packages/apps/Settings
1718 */
1719message SettingsUIChanged {
1720 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001721 * Where this SettingsUIChange event comes from. For example, if
1722 * it's a PAGE_VISIBLE event, where the page is opened from.
1723 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001724 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001725
1726 /**
1727 * What the UI action is.
1728 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001729 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001730
1731 /**
1732 * Where the action is happening
1733 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001734 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001735
1736 /**
1737 * What preference changed in this event.
1738 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001739 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07001740
1741 /**
1742 * The new value of the changed preference.
1743 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001744 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07001745}
1746
1747/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08001748 * Logs basic timing information about touch events.
1749 * Reported at most every 5 minutes while device is being interacted with.
1750 *
1751 * Logged from:
1752 * frameworks/native/services/inputflinger
1753 */
1754message TouchEventReported {
1755 /**
1756 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
1757 * and the standard deviation of latency between the kernel and framework
1758 * for touchscreen events. The units are microseconds.
1759 *
1760 * The number is measured as the difference between the time at which
1761 * the input event was received in the evdev driver,
1762 * and the time at which the input event was received in EventHub.
1763 */
1764 // Minimum value
1765 optional float latency_min_micros = 1;
1766 // Maximum value
1767 optional float latency_max_micros = 2;
1768 // Average value
1769 optional float latency_mean_micros = 3;
1770 // Standard deviation
1771 optional float latency_stdev_micros = 4;
1772}
1773
1774/**
David Chenc28b2bb2017-10-24 12:52:52 -07001775 * Logs that a setting was updated.
1776 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001777 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001778 * The tag and is_default allow resetting of settings to default values based on the specified
1779 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1780 */
1781message SettingChanged {
1782 // The name of the setting.
1783 optional string setting = 1;
1784
1785 // The change being imposed on this setting. May represent a number, eg "3".
1786 optional string value = 2;
1787
1788 // The new value of this setting. For most settings, this is same as value. For some settings,
1789 // value is +X or -X where X represents an element in a set. For example, if the previous value
1790 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1791 // The +/- feature is currently only used for location_providers_allowed.
1792 optional string new_value = 3;
1793
1794 // The previous value of this setting.
1795 optional string prev_value = 4;
1796
1797 // The tag used with the is_default for resetting sets of settings. This is generally null.
1798 optional string tag = 5;
1799
Bookatz90867622018-01-31 15:05:57 -08001800 // True if this setting with tag should be resettable.
1801 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001802
David Chenbd789912018-03-16 17:19:55 -07001803 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001804 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001805
1806 enum ChangeReason {
1807 UPDATED = 1; // Updated can be an insertion or an update.
1808 DELETED = 2;
1809 }
1810 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001811}
Chenjie Yub3dda412017-10-24 13:41:59 -07001812
Chenjie Yu05013b32017-11-21 10:21:41 -08001813/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001814 * Logs activity going to foreground or background
1815 *
1816 * Logged from:
1817 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1818 */
1819message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001820 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001821 optional string pkg_name = 2;
1822 optional string class_name = 3;
1823
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001824 enum State {
1825 BACKGROUND = 0;
1826 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001827 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001828 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001829}
David Chenc8a43242017-10-17 16:23:28 -07001830
1831/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00001832 * Logs when a volume entered low Storage state.
1833 * Logged from:
1834 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
1835 */
1836message LowStorageStateChanged {
1837 // Volume that ran out of storage.
1838 optional string volume_description = 1;
1839
1840 enum State {
1841 UNKNOWN = 0;
1842 OFF = 1;
1843 ON = 2;
1844 }
1845 optional State state = 2;
1846}
1847
1848/**
1849 * Logs when an app is downgraded.
1850 * Logged from:
1851 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
1852 */
1853message AppDowngraded {
1854 optional string package_name = 1;
1855 // Size of the package (all data) before being downgraded.
1856 optional int64 size_in_bytes_before = 2;
1857 // Size of the package (all data) after being downgraded.
1858 optional int64 size_in_bytes_after = 3;
1859
1860 optional bool aggressive = 4;
1861}
1862
1863/**
1864 * Logs when an app is optimized after being downgraded.
1865 * Logged from:
1866 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
1867 */
1868message AppOptimizedAfterDowngraded {
1869 optional string package_name = 1;
1870}
1871
1872/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001873 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001874 * Logged from:
1875 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1876 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001877message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001878 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001879
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001880 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001881
1882 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001883 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001884 optional string process_name = 3;
1885
1886 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001887 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001888
1889 optional string package_name = 5;
1890
1891 enum InstantApp {
1892 UNAVAILABLE = 0;
1893 FALSE = 1;
1894 TRUE = 2;
1895 }
1896 optional InstantApp is_instant_app = 6;
1897
1898 enum ForegroundState {
1899 UNKNOWN = 0;
1900 BACKGROUND = 1;
1901 FOREGROUND = 2;
1902 }
1903 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08001904
1905 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001906}
David Chen9e3808c2017-11-20 17:25:34 -08001907
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001908/**
1909 * Logs when a WTF (What a Terrible Failure) happened.
1910 * Logged from:
1911 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1912 */
1913message WTFOccurred {
1914 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001915
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001916 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001917
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001918 // The name of the process.
1919 // system_server if it is not by an app
1920 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001921
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001922 // The pid if available. -1 means not available.
1923 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08001924
1925 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001926}
1927
1928/**
1929 * Logs when system server reports low memory.
1930 * Logged from:
1931 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1932 */
1933message LowMemReported {
1934}
1935
1936/**
1937 * Logs when an app ANR (App Not Responding) occurs.
1938 * Logged from:
1939 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1940 */
1941message ANROccurred {
1942 optional int32 uid = 1 [(is_uid) = true];
1943
1944 optional string process_name = 2;
1945
1946 optional string short_component_name = 3;
1947
1948 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001949
1950 enum InstantApp {
1951 UNAVAILABLE = 0;
1952 FALSE = 1;
1953 TRUE = 2;
1954 }
1955 optional InstantApp is_instant_app = 5;
1956
1957 enum ForegroundState {
1958 UNKNOWN = 0;
1959 BACKGROUND = 1;
1960 FOREGROUND = 2;
1961 }
1962 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08001963
1964 optional android.server.ErrorSource error_source = 7;
1965
1966 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08001967}
1968
Bookatza7020bd2018-08-28 16:29:35 -07001969/**
1970 * Logs when the vibrator state changes.
1971 * Logged from:
1972 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1973 */
1974message VibratorStateChanged {
1975 repeated AttributionNode attribution_node = 1;
1976
1977 enum State {
1978 OFF = 0;
1979 ON = 1;
1980 }
1981 optional State state = 2;
1982
1983 // Duration (in milliseconds) requested to keep the vibrator on.
1984 // Only applicable for State == ON.
1985 optional int64 duration_millis = 3;
1986}
1987
David Chen0a368b22017-12-06 16:28:16 -08001988/*
1989 * Allows other apps to push events into statsd.
1990 * Logged from:
1991 * frameworks/base/core/java/android/util/StatsLog.java
1992 */
David Chen0b5c90c2018-01-25 16:51:49 -08001993message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001994 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001995 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001996
1997 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1998 optional int32 label = 2;
1999
2000 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2001 // predicates for the metrics).
2002 enum State {
2003 UNKNOWN = 0;
2004 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2005 STOP = 2;
2006 START = 3;
2007 }
2008 optional State state = 3;
2009}
2010
David Chen9e3808c2017-11-20 17:25:34 -08002011/**
Bookatz7948c872018-09-04 12:58:33 -07002012 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2013 * For example, this could be due to the user manually changing the time.
2014 *
2015 * Logged from:
2016 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2017 */
2018message WallClockTimeShifted {
2019 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2020 optional int64 wall_clock_timestamp_millis = 1;
2021}
2022
2023/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002024 * Logs when statsd detects an anomaly.
2025 *
2026 * Logged from:
2027 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2028 */
2029message AnomalyDetected {
2030 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002031 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002032
Yangster-mac94e197c2018-01-02 16:03:03 -08002033 // Id of the config whose anomaly detection alert fired.
2034 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002035
Yangster-mac94e197c2018-01-02 16:03:03 -08002036 // Id of the alert (i.e. name of the anomaly that was detected).
2037 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002038}
2039
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002040message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002041 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002042 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002043
2044 // The app package name.
2045 optional string pkg_name = 2;
2046
2047 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002048 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002049 WARM = 1;
2050 HOT = 2;
2051 COLD = 3;
2052 }
2053 // The transition type.
2054 optional TransitionType type = 3;
2055
2056 // The activity name.
2057 optional string activity_name = 4;
2058
2059 // The name of the calling app. Empty if not set.
2060 optional string calling_pkg_name = 5;
2061
2062 // Whether the app is an instant app.
2063 optional bool is_instant_app = 6;
2064
2065 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002066 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002067
Bookatz80d11a02018-01-16 10:46:35 -08002068 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002069
David Chen0b5c90c2018-01-25 16:51:49 -08002070 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002071 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002072 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002073 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002074 optional int32 bind_application_delay_millis = 11;
2075 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002076
2077 // Empty if not set.
2078 optional string launch_token = 13;
2079
Calin Juravle759fbda2018-02-20 19:52:30 +00002080 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002081 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002082
2083 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002084 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002085}
2086
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002087message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002088 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002089 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002090
2091 // The app package name.
2092 optional string pkg_name = 2;
2093
2094 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002095 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002096 WARM = 1;
2097 HOT = 2;
2098 COLD = 3;
2099 }
2100 // The transition type.
2101 optional TransitionType type = 3;
2102
2103 // The activity name.
2104 optional string activity_name = 4;
2105}
2106
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002107message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002108 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002109 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002110
2111 // The app package name.
2112 optional string pkg_name = 2;
2113
2114 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002115 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002116 WITH_BUNDLE = 1;
2117 WITHOUT_BUNDLE = 2;
2118 }
2119 // The transition type.
2120 optional TransitionType type = 3;
2121
2122 // The activity name.
2123 optional string activity_name = 4;
2124
2125 optional bool transition_process_running = 5;
2126
2127 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002128 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002129}
2130
Bookatz8fcd09a2017-12-18 13:01:10 -08002131/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002132 * Logs a picture-in-picture action
2133 * Logged from:
2134 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2135 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2136 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2137 */
2138message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002139 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002140 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002141
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002142 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002143
Chenjie Yu52cacc62017-12-08 18:11:45 -08002144 enum State {
2145 ENTERED = 1;
2146 EXPANDED_TO_FULL_SCREEN = 2;
2147 MINIMIZED = 3;
2148 DISMISSED = 4;
2149 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002150 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002151}
2152
2153/**
Chenjie Yue8904192017-12-08 19:12:57 -08002154 * Logs overlay action
2155 * Logged from:
2156 * services/core/java/com/android/server/wm/Session.java
2157 */
2158message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002159 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002160
2161 optional string package_name = 2;
2162
2163 optional bool using_alert_window = 3;
2164
2165 enum State {
2166 ENTERED = 1;
2167 EXITED = 2;
2168 }
2169 optional State state = 4;
2170}
2171
Chenjie Yuccfe6452018-01-30 11:33:21 -08002172/*
2173 * Logs foreground service starts and stops.
2174 * Note that this is not when a service starts or stops, but when it is
2175 * considered foreground.
2176 * Logged from
2177 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2178 */
2179message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002180 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002181 // package_name + "/" + class_name
2182 optional string short_name = 2;
2183
2184 enum State {
2185 ENTER = 1;
2186 EXIT = 2;
2187 }
2188 optional State state = 3;
2189}
2190
Chenjie Yue8904192017-12-08 19:12:57 -08002191/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002192 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2193 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2194 * attributed back to the parent (host) uid. One example is Chrome.
2195 *
2196 * Logged from:
2197 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2198 */
2199message IsolatedUidChanged {
2200 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002201 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002202 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002203 optional int32 parent_uid = 1;
2204
2205 optional int32 isolated_uid = 2;
2206
2207 // We expect an isolated uid to be removed before if it's used for another parent uid.
2208 enum Event {
2209 REMOVED = 0;
2210 CREATED = 1;
2211 }
2212 optional Event event = 3;
2213}
2214
2215/*
2216 * Logs the reception of an incoming network packet causing the main system to wake up for
2217 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2218 * and processed by WakeupController.cpp.
2219 */
2220message PacketWakeupOccurred {
2221 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2222 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002223 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002224 // The interface name on which the packet was received.
2225 optional string iface = 2;
2226 // The ethertype value of the packet.
2227 optional int32 ethertype = 3;
2228 // String representation of the destination MAC address of the packet.
2229 optional string destination_hardware_address = 4;
2230 // String representation of the source address of the packet if this was an IP packet.
2231 optional string source_ip = 5;
2232 // String representation of the destination address of the packet if this was an IP packet.
2233 optional string destination_ip = 6;
2234 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2235 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2236 // families.
2237 optional int32 ip_next_header = 7;
2238 // The source port if this was a TCP or UDP packet.
2239 optional int32 source_port = 8;
2240 // The destination port if this was a TCP or UDP packet.
2241 optional int32 destination_port = 9;
2242}
2243
2244/*
2245 * Logs the memory stats for an app on startup.
2246 * Logged from:
2247 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2248 */
2249message AppStartMemoryStateCaptured {
2250 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002251 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002252
2253 // The process name.
2254 optional string process_name = 2;
2255
2256 // The activity name.
2257 optional string activity_name = 3;
2258
2259 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002260 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002261
2262 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002263 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002264
2265 // RSS
2266 optional int64 rss_in_bytes = 6;
2267
2268 // CACHE
2269 optional int64 cache_in_bytes = 7;
2270
2271 // SWAP
2272 optional int64 swap_in_bytes = 8;
2273}
2274
2275/*
2276 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2277 * for LMK event.
2278 * Logged from:
2279 * system/core/lmkd/lmkd.c
2280 */
2281message LmkStateChanged {
2282 enum State {
2283 UNKNOWN = 0;
2284 START = 1;
2285 STOP = 2;
2286 }
2287 optional State state = 1;
2288}
2289
2290/*
2291 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2292 * Logged from:
2293 * system/core/lmkd/lmkd.c
2294 */
2295message LmkKillOccurred {
2296 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002297 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002298
2299 // The process name.
2300 optional string process_name = 2;
2301
2302 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002303 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002304
2305 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002306 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002307
2308 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002309 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002310
2311 // RSS
2312 optional int64 rss_in_bytes = 6;
2313
2314 // CACHE
2315 optional int64 cache_in_bytes = 7;
2316
2317 // SWAP
2318 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002319
2320 // The elapsed real time of start of the process.
2321 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002322}
2323
Rajeev Kumar51b54602018-03-01 12:18:26 -08002324/*
2325 * Logs when the ActivityManagerService detects that an app died.
2326 *
2327 * Logged from:
2328 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2329 */
2330message AppDied {
2331 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002332 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002333}
2334
Howard Ro21a039c2018-08-06 14:55:47 -07002335/**
2336 * An atom for generic metrics logging. Available from Android Q.
2337 */
2338message GenericAtom {
2339 // The uid of the application that sent this custom atom.
2340 optional int32 uid = 1 [(is_uid) = true];
2341
2342 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002343 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002344}
2345
Tej Singhd6d6d772018-09-05 17:41:25 -07002346/**
2347 * Logs when a fingerprint acquire event occurs.
2348 *
2349 * Logged from:
2350 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2351 */
2352message FingerprintAcquired {
2353 // The associated user. Eg: 0 for owners, 10+ for others.
2354 // Defined in android/os/UserHandle.java
2355 optional int32 user = 1;
2356 // If this acquire is for a crypto fingerprint.
2357 // e.g. Secure purchases, unlock password storage.
2358 optional bool is_crypto = 2;
2359}
2360
2361/**
2362 * Logs when a fingerprint authentication event occurs.
2363 *
2364 * Logged from:
2365 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2366 */
2367message FingerprintAuthenticated {
2368 // The associated user. Eg: 0 for owners, 10+ for others.
2369 // Defined in android/os/UserHandle.java
2370 optional int32 user = 1;
2371 // If this authentication is for a crypto fingerprint.
2372 // e.g. Secure purchases, unlock password storage.
2373 optional bool is_crypto = 2;
2374 // Whether or not this authentication was successful.
2375 optional bool is_authenticated = 3;
2376}
2377
2378/**
2379 * Logs when a fingerprint error occurs.
2380 *
2381 * Logged from:
2382 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2383 */
2384message FingerprintErrorOccurred {
2385 // The associated user. Eg: 0 for owners, 10+ for others.
2386 // Defined in android/os/UserHandle.java
2387 optional int32 user = 1;
2388 // If this error is for a crypto fingerprint.
2389 // e.g. Secure purchases, unlock password storage.
2390 optional bool is_crypto = 2;
2391
2392 enum Error {
2393 UNKNOWN = 0;
2394 LOCKOUT = 1;
2395 PERMANENT_LOCKOUT = 2;
2396 }
2397 // The type of error.
2398 optional Error error = 3;
2399}
Howard Ro688ae182018-09-25 00:09:36 -07002400
2401message Notification {
2402
2403 // Type of notification event.
2404 enum Type {
2405 TYPE_UNKNOWN = 0;
2406 // Notification became visible to the user.
2407 TYPE_OPEN = 1;
2408 // Notification became hidden.
2409 TYPE_CLOSE = 2;
2410 // Notification switched to detail mode.
2411 TYPE_DETAIL = 3;
2412 // Notification was clicked.
2413 TYPE_ACTION = 4;
2414 // Notification was dismissed.
2415 TYPE_DISMISS = 5;
2416 // Notification switched to summary mode. The enum value of 14 is to
2417 // match that of metrics_constants.
2418 TYPE_COLLAPSE = 14;
2419 }
2420 optional Type type = 1;
2421
2422 // Package name associated with the notification.
2423 optional string package_name = 2;
2424
2425 // Tag associated with notification.
2426 optional string tag = 3;
2427
2428 // Application-supplied ID associated with the notification.
2429 optional int32 id = 4;
2430
2431 // Index of notification in the notification panel.
2432 optional int32 shade_index = 5;
2433
2434 // The number of notifications in the notification panel.
2435 optional int32 shade_count = 6;
2436
2437 // Importance for the notification.
2438 optional int32 importance = 7;
2439
2440 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002441 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002442
2443 // Importance for the notification channel.
2444 optional int32 channel_importance = 9;
2445
Howard Ro183c2bd2018-10-18 13:52:10 -07002446 // Application-supplied ID associated with the notifications group.
2447 optional string group_id = 10;
2448
Howard Ro688ae182018-09-25 00:09:36 -07002449 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002450 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002451
Howard Ro183c2bd2018-10-18 13:52:10 -07002452 // Reason for dismissal of a notification. This field is only meaningful for
2453 // TYPE_DISMISS events.
2454 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002455
Howard Ro183c2bd2018-10-18 13:52:10 -07002456 // The first post time of notification, stable across updates.
2457 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002458
Howard Ro183c2bd2018-10-18 13:52:10 -07002459 // The most recent interruption time, or the creation time if no updates.
2460 // Differs from update_millis because updates are filtered based on whether
2461 // they actually interrupted the user.
2462 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002463
Howard Ro183c2bd2018-10-18 13:52:10 -07002464 // The most recent update time, or the creation time if no updates.
2465 optional int64 update_millis = 15;
2466
2467 // The most recent visibility event.
2468 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002469}
2470
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002471/*
Yangster-macb89807e2018-11-15 21:10:57 -08002472 * Logs when a flag flip state changes.
2473 * Logged in P/h.
2474 */
2475message PhenotypeFlagStateChanged {
2476 // Mendel configuration name.
2477 optional string mendel_config_name = 1;
2478 // State
2479 enum State {
2480 STATE_UNKNOWN = 0;
2481 COMMITTED = 1;
2482 }
2483 optional State state = 2;
2484}
2485
2486/*
2487 * Logs when a binary push state changes.
2488 * Logged in Play store
2489 */
2490message BinaryPushStateChanged {
2491 // Binary package name.
2492 optional string binary_name = 1;
2493 // Version code.
2494 optional int64 version = 2;
2495 // State
2496 enum State {
2497 STATE_UNKNOWN = 0;
2498 DOWNLOAD_START = 1;
2499 DOWNLOAD_DONE = 2;
2500 INSTALL_START = 3;
2501 INSTALL_DONE = 4;
2502 REBOOT_START = 5;
2503 REBOOT_DONE = 6;
2504 }
2505 optional State state = 3;
2506}
2507
Maggie Whitefc1aa592018-11-28 21:55:23 -08002508/** Represents USB port overheat event. */
2509message UsbPortOverheatEvent {
2510 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
2511 optional int32 plug_temperature_deci_c = 1;
2512
2513 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
2514 optional int32 max_temperature_deci_c = 2;
2515
2516 /* Time between USB plug event and overheat threshold trip, in seconds. */
2517 optional int32 time_to_overheat_secs = 3;
2518
2519 /* Time between overheat threshold trip and hysteresis, in seconds. */
2520 optional int32 time_to_hysteresis_secs = 4;
2521
2522 /* Time between hysteresis and active mitigation ending, in seconds. */
2523 optional int32 time_to_inactive_secs = 5;
2524};
2525
Yangster-macb89807e2018-11-15 21:10:57 -08002526/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002527 * Logs when a connection becomes available and lost.
2528 * Logged in StatsCompanionService.java
2529 */
2530message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002531 // Id of the network.
2532 optional int32 net_id = 1;
2533
2534 enum State {
2535 UNKNOWN = 0;
2536 CONNECTED = 1;
2537 DISCONNECTED = 2;
2538 }
2539 // Connected state of a network.
2540 optional State state = 2;
2541}
2542
2543/**
2544 * Logs when a service starts and stops.
2545 * Logged from:
2546 * services/core/java/com/android/server/am/ActiveServices.java
2547 */
2548message ServiceStateChanged {
2549
2550 optional int32 uid = 1 [(is_uid) = true];
2551
2552 optional string package_name = 2;
2553
2554 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002555
2556 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002557 START = 1;
2558 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002559 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07002560
2561 optional State state = 4;
2562}
2563
2564/**
2565 * Logs when a service is launched.
2566 * Logged from:
2567 * services/core/java/com/android/server/am/ActiveServices.java
2568 */
2569message ServiceLaunchReported {
2570
2571 optional int32 uid = 1 [(is_uid) = true];
2572
2573 optional string package_name = 2;
2574
2575 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002576}
Howard Ro688ae182018-09-25 00:09:36 -07002577
Chenjie Yubbcbc602018-02-05 16:51:52 -08002578//////////////////////////////////////////////////////////////////////
2579// Pulled atoms below this line //
2580//////////////////////////////////////////////////////////////////////
2581
2582/**
David Chenc8a43242017-10-17 16:23:28 -07002583 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2584 *
2585 * Pulled from:
2586 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2587 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002588message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002589 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002590
2591 optional int64 rx_bytes = 2;
2592
2593 optional int64 rx_packets = 3;
2594
2595 optional int64 tx_bytes = 4;
2596
2597 optional int64 tx_packets = 5;
2598}
2599
2600/**
2601 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2602 *
2603 * Pulled from:
2604 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2605 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002606message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002607 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002608
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002609 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2610 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002611
2612 optional int64 rx_bytes = 3;
2613
2614 optional int64 rx_packets = 4;
2615
2616 optional int64 tx_bytes = 5;
2617
2618 optional int64 tx_packets = 6;
2619}
2620
2621/**
2622 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2623 *
2624 * Pulled from:
2625 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2626 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002627message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002628 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002629
2630 optional int64 rx_bytes = 2;
2631
2632 optional int64 rx_packets = 3;
2633
2634 optional int64 tx_bytes = 4;
2635
2636 optional int64 tx_packets = 5;
2637}
2638
2639/**
2640 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2641 *
2642 * Pulled from:
2643 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2644 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002645message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002646 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002647
Yao Chenc40a19d2018-03-15 16:48:25 -07002648 // 1 denotes foreground and 0 denotes background. This is called Set in
2649 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002650 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002651
2652 optional int64 rx_bytes = 3;
2653
2654 optional int64 rx_packets = 4;
2655
2656 optional int64 tx_bytes = 5;
2657
2658 optional int64 tx_packets = 6;
2659}
2660
2661/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002662 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2663 *
2664 * Pulled from:
2665 * StatsCompanionService
2666 */
2667message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002668 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002669
2670 optional int64 rx_bytes = 2;
2671
2672 optional int64 tx_bytes = 3;
2673}
2674
2675/**
David Chenc8a43242017-10-17 16:23:28 -07002676 * Pulls the kernel wakelock durations. This atom is adapted from
2677 * android/internal/os/KernelWakelockStats.java
2678 *
2679 * Pulled from:
2680 * StatsCompanionService using KernelWakelockReader.
2681 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002682message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002683 optional string name = 1;
2684
2685 optional int32 count = 2;
2686
2687 optional int32 version = 3;
2688
Yangster-maca8a30442018-10-13 23:46:34 -07002689 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002690}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002691
Chenjie Yu05013b32017-11-21 10:21:41 -08002692/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002693 * Pulls low power state information. If power.stats HAL is not available, this
2694 * includes platform and subsystem sleep state information,
2695 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
2696 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002697 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002698 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002699 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
2700 * as defined in:
2701 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002702 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002703message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002704 // Subsystem name
2705 optional string subsystem_name = 1;
2706 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2707 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002708 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
2709 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002710 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002711 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002712 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002713 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002714 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002715}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002716
Chenjie Yu05013b32017-11-21 10:21:41 -08002717/**
Bookatz92da2832018-11-01 18:10:03 -07002718 * Pulls on-device power measurement information.
2719 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
2720 * Pulled from:
2721 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
2722 */
2723message OnDevicePowerMeasurement {
2724 // Name of the subsystem (to which the rail belongs).
2725 optional string subsystem_name = 1;
2726
2727 // Rail name. The rail lies within the subsystem.
2728 optional string rail_name = 2;
2729
2730 // Time (in ms since boot) at which the rail energy value was measured.
2731 // This may differ slightly from the time that statsd logs this information.
2732 optional uint64 measurement_timestamp_millis = 3;
2733
2734 // Accumulated energy used via the rail since device boot in uWs.
2735 optional uint64 energy_microwatt_secs = 4;
2736}
2737
2738/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002739 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002740 * Pulls the time the cpu spend on the frequency index. Frequency index
2741 * starts from highest to lowest. The value should be monotonically
2742 * increasing since boot. However, if there is a cpu
2743 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002744 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002745message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002746 optional uint32 cluster = 1;
2747 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002748 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002749}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002750
Chenjie Yu05013b32017-11-21 10:21:41 -08002751/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002752 * Pulls Cpu Time Per Uid.
2753 * Note that isolated process uid time should be attributed to host uids.
2754 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002755message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002756 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002757 optional uint64 user_time_micros = 2;
2758 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002759}
2760
2761/**
2762 * Pulls Cpu Time Per Uid per frequency.
2763 * Note that isolated process uid time should be attributed to host uids.
2764 * For each uid, we order the time by descending frequencies.
2765 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002766message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002767 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002768 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002769 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002770}
Hugo Benichi884970e2017-11-14 22:42:46 +09002771
Chenjie Yu05013b32017-11-21 10:21:41 -08002772/**
2773 * Pulls Wifi Controller Activity Energy Info
2774 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002775message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002776 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002777 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002778 // stack reported state
2779 // TODO: replace this with proto enum
2780 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002781 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002782 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002783 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002784 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002785 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002786 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002787 // product of current(mA), voltage(V) and time(ms)
2788 optional uint64 controller_energy_used = 6;
2789}
2790
2791/**
2792 * Pulls Modem Activity Energy Info
2793 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002794message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002795 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002796 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002797 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002798 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002799 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002800 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002801 /**
2802 * Tx power index
2803 * index 0 = tx_power < 0dBm
2804 * index 1 = 0dBm < tx_power < 5dBm
2805 * index 2 = 5dBm < tx_power < 15dBm
2806 * index 3 = 15dBm < tx_power < 20dBm
2807 * index 4 = tx_power > 20dBm
2808 */
2809 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002810 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002811 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002812 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002813 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002814 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002815 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002816 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002817 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002818 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002819 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002820 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002821 // product of current(mA), voltage(V) and time(ms)
2822 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002823}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002824
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002825/**
2826 * Pulls Bluetooth Activity Energy Info
2827 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2828 */
2829message BluetoothActivityInfo {
2830 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002831 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002832 // bluetooth stack state
2833 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002834 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002835 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002836 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002837 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002838 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002839 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002840 // product of current(mA), voltage(V) and time(ms)
2841 optional uint64 energy_used = 6;
2842}
2843
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002844/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002845 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002846 *
2847 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002848 */
2849message ProcessMemoryState {
2850 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002851 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002852
2853 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002854 // Usually package name, "system" for system server.
2855 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002856 optional string process_name = 2;
2857
Rafal Slawikda51b932018-12-13 16:31:33 +00002858 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07002859 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002860
2861 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002862 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002863
2864 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002865 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002866
Rajeev Kumar90235992018-01-29 11:06:48 -08002867 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002868 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
2869 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08002870 optional int64 rss_in_bytes = 6;
2871
2872 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00002873 // Value is read from memory.stat, field total_cache if per-app memory
2874 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002875 optional int64 cache_in_bytes = 7;
2876
2877 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00002878 // Value is read from memory.stat, field total_swap if per-app memory
2879 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002880 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002881
Rafal Slawikd03ae422018-11-20 11:27:45 +00002882 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002883 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00002884
2885 // Elapsed real time when the process started.
2886 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
2887 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002888}
2889
2890/*
Rafal Slawik08621582018-10-15 14:53:07 +01002891 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00002892 *
2893 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01002894 */
2895message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01002896 // The uid if available. -1 means not available.
2897 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01002898
Rafal Slawikbf67d072018-10-23 11:07:54 +01002899 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002900 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002901 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01002902
Rafal Slawikbf67d072018-10-23 11:07:54 +01002903 // # of page-faults
2904 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002905
Rafal Slawikbf67d072018-10-23 11:07:54 +01002906 // # of major page-faults
2907 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002908
Rafal Slawikbf67d072018-10-23 11:07:54 +01002909 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002910 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002911 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01002912
Rafal Slawikd03ae422018-11-20 11:27:45 +00002913 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002914 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01002915
2916 // Elapsed real time when the process started.
2917 // Value is read from /proc/PID/stat, field 22.
2918 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01002919}
2920
2921/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00002922 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002923 *
2924 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
2925 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00002926 *
2927 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002928 */
2929message ProcessMemoryHighWaterMark {
2930 // The uid if available. -1 means not available.
2931 optional int32 uid = 1 [(is_uid) = true];
2932
Rafal Slawikda51b932018-12-13 16:31:33 +00002933 // The process name.
2934 // Usually package name or process cmdline.
2935 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002936 optional string process_name = 2;
2937
2938 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
2939 // /proc/PID/status.
2940 optional int64 rss_high_water_mark_in_bytes = 3;
2941}
2942
2943/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002944 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002945 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002946message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002947 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002948}
2949
2950/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002951 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002952 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002953message SystemUptime {
2954 // Milliseconds since the system was booted.
2955 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2956 // for external input).
2957 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002958 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002959}
2960
2961/*
2962 * Reads from /proc/uid_concurrent_active_time which has the format:
2963 * active: X (X is # cores)
2964 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2965 * [uid1]: [time-0] [time-1] [time-2] ... ...
2966 * ...
2967 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2968 * The file contains a monotonically increasing count of time for a single boot.
2969 */
2970message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002971 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002972 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002973}
2974
2975/**
2976 * Reads from /proc/uid_concurrent_policy_time which has the format:
2977 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2978 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2979 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2980 * ...
2981 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2982 * The file contains a monotonically increasing count of time for a single boot.
2983 */
2984message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002985 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002986 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002987 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002988}
2989
2990/*
2991 * Pulls free disk space, for data, system partition and temporary directory.
2992 */
2993message DiskSpace {
2994 // available bytes in data partition
2995 optional uint64 data_available_bytes = 1;
2996 // available bytes in system partition
2997 optional uint64 system_available_bytes = 2;
2998 // available bytes in download cache or temp directories
2999 optional uint64 temp_available_bytes = 3;
3000}
Tej Singhbf972d92018-01-10 20:51:13 -08003001
3002/**
3003 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003004 * Pulled from:
3005 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003006 */
3007message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003008 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003009}
3010
3011/**
3012 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003013 * Pulled from:
3014 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003015 */
3016message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003017 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003018}
3019
3020/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003021 * Pulls battery voltage.
3022 * Pulled from:
3023 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3024 */
3025message BatteryVoltage {
3026 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003027 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003028}
3029
3030/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003031 * Pulls battery level (percent full, from 0 to 100).
3032 *
3033 * Pulled from:
3034 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3035 */
3036message BatteryLevel {
3037 // Battery level. Should be in [0, 100].
3038 optional int32 battery_level = 1;
3039}
3040
3041/**
Tej Singhd89137e2018-03-26 14:51:40 -07003042 * Pulls the temperature of various parts of the device.
3043 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003044 *
3045 * Pulled from:
3046 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3047 */
3048message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003049 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003050 optional android.os.TemperatureTypeEnum sensor_location = 1;
3051
3052 // The name of the temperature source. Eg. CPU0
3053 optional string sensor_name = 2;
3054
Tej Singhd89137e2018-03-26 14:51:40 -07003055 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003056 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003057 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003058}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003059
3060/**
3061 * Pulls the statistics of calls to Binder.
3062 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003063 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3064 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003065 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003066 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003067 */
3068message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003069 // UID of the process responsible for the binder transaction. It will be set if the process
3070 // executing the binder transaction attribute the transaction to another uid using
3071 // Binder.setThreadWorkSource().
3072 //
3073 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003074 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003075 // UID of the process executing the binder transaction.
3076 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003077 // Fully qualified class name of the API call.
3078 //
3079 // This is a system server class name.
3080 //
3081 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3082 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3083 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3084 // commonly used APIs.
3085 optional string service_class_name = 2;
3086 // Method name of the API call. It can also be a transaction code if we cannot
3087 // resolve it to a name. See Binder#getTransactionName.
3088 //
3089 // This is a system server method name.
3090 optional string service_method_name = 3;
3091 // Total number of API calls.
3092 optional int64 call_count = 4;
3093 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3094 optional bool screen_interactive = 13;
3095 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3096 // call_count will be equal to recorded_call_count.
3097 //
3098 // If recorded_call_count is different than call_count, it means data collection has been
3099 // sampled. All the fields below will be sampled in this case.
3100 optional int64 recorded_call_count = 12;
3101 // Number of exceptions thrown by the API.
3102 optional int64 recorded_exception_count = 5;
3103 // Total latency of all API calls.
3104 // Average can be computed using total_latency_micros / recorded_call_count.
3105 optional int64 recorded_total_latency_micros = 6;
3106 // Maximum latency of one API call.
3107 optional int64 recorded_max_latency_micros = 7;
3108 // Total CPU usage of all API calls.
3109 // Average can be computed using total_cpu_micros / recorded_call_count.
3110 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3111 optional int64 recorded_total_cpu_micros = 8;
3112 // Maximum CPU usage of one API call.
3113 optional int64 recorded_max_cpu_micros = 9;
3114 // Maximum parcel reply size of one API call.
3115 optional int64 recorded_max_reply_size_bytes = 10;
3116 // Maximum parcel request size of one API call.
3117 optional int64 recorded_max_request_size_bytes = 11;
3118}
3119
3120/**
3121 * Pulls the statistics of exceptions during calls to Binder.
3122 *
3123 * Binder stats are cumulative from boot unless somebody reset the data using
3124 * > adb shell dumpsys binder_calls_stats --reset
3125 */
3126message BinderCallsExceptions {
3127 // Exception class name, e.g. java.lang.IllegalArgumentException.
3128 //
3129 // This is an exception class name thrown by the system server.
3130 optional string exception_class_name = 1;
3131 // Total number of exceptions.
3132 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003133}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003134
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003135/**
3136 * Pulls the statistics of message dispatching on HandlerThreads.
3137 *
3138 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3139 * config on the device.
3140 *
3141 * Next tag: 11
3142 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003143message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003144 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003145 optional int32 uid = 1 [(is_uid) = true];
3146
3147 // Fully qualified class name of the handler target class.
3148 //
3149 // This field does not contain PII. This is a system server class name.
3150 optional string handler_class_name = 2;
3151
3152 // The name of the thread that runs the Looper.
3153 //
3154 // This field does not contain PII. This is a system server thread name.
3155 optional string looper_thread_name = 3;
3156
3157 // The name of the dispatched message.
3158 //
3159 // This field does not contain PII. This is a system server constant or class
3160 // name.
3161 optional string message_name = 4;
3162
3163 // Total number of successfully dispatched messages.
3164 optional int64 message_count = 5;
3165
3166 // Total number of messages that failed dispatching.
3167 optional int64 exception_count = 6;
3168
3169 // Total number of processed messages we have data recorded for. If we
3170 // collected data for all the messages, message_count will be equal to
3171 // recorded_message_count.
3172 //
3173 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003174 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003175 optional int64 recorded_message_count = 7;
3176
3177 // Total latency of all processed messages.
3178 // Average can be computed using recorded_total_latency_micros /
3179 // recorded_message_count.
3180 optional int64 recorded_total_latency_micros = 8;
3181
3182 // Total CPU usage of all processed message.
3183 // Average can be computed using recorded_total_cpu_micros /
3184 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003185 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003186 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003187
3188 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3189 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003190
3191 // Max recorded CPU usage of all processed messages.
3192 optional int64 recorded_max_cpu_micros = 11;
3193
3194 // Max recorded latency of all processed messages.
3195 optional int64 recorded_max_latency_micros = 12;
3196
3197 // Total number of messages we tracked the dispatching delay for. If we
3198 // collected data for all the messages, message_count will be equal to
3199 // recorded_delay_message_count.
3200 //
3201 // If recorded_delay_message_count is different than message_count, it means data
3202 // collection has been sampled or/and not all messages specified the target dispatch time.
3203 // The fields below will be sampled in this case.
3204 optional int64 recorded_delay_message_count = 13;
3205
3206 // Total dispatching delay of all processed messages.
3207 // Calculated as a difference between the target dispatching time (Message.when)
3208 // and the actual dispatching time.
3209 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3210 optional int64 recorded_total_delay_millis = 14;
3211
3212 // Max dispatching delay of all processed messages.
3213 // Calculated as a difference between the target dispatching time (Message.when)
3214 // and the actual dispatching time.
3215 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003216}
Tej Singh86dc9db2018-09-06 00:39:57 +00003217
3218/**
3219 * Pulls disk information, such as write speed and latency.
3220 */
3221message DiskStats {
3222 // Time taken to open, write 512B to, and close a file.
3223 // -1 if error performing the check.
3224 optional int64 data_write_latency_millis = 1;
3225
3226 optional bool file_based_encryption = 2;
3227
3228 // Recent disk write speed in kB/s.
3229 // -1 if error querying storageed.
3230 // 0 if data is unavailable.
3231 optional int32 recent_disk_write_speed = 3;
3232}
3233
3234
3235/**
3236 * Free and total bytes of the Data, Cache, and System partition.
3237 */
3238message DirectoryUsage {
3239 enum Directory {
3240 UNKNOWN = 0;
3241 DATA = 1;
3242 CACHE = 2;
3243 SYSTEM = 3;
3244 }
3245 optional Directory directory = 1;
3246 optional int64 free_bytes = 2;
3247 optional int64 total_bytes = 3;
3248}
3249
3250
3251/**
3252 * Size of an application: apk size, data size, and cache size.
3253 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3254 * Information is only reported for apps with the primary user (user 0).
3255 * Sizes are aggregated by package name.
3256 */
3257message AppSize {
3258 // Including uids will involve modifying diskstats logic.
3259 optional string package_name = 1;
3260 // App size in bytes. -1 if unavailable.
3261 optional int64 app_size_bytes = 2;
3262 // App data size in bytes. -1 if unavailable.
3263 optional int64 app_data_size_bytes = 3;
3264 // App cache size in bytes. -1 if unavailable.
3265 optional int64 app_cache_size_bytes = 4;
3266 // Time that the cache file was produced.
3267 // Uses System.currentTimeMillis(), which is wall clock time.
3268 optional int64 cache_time_millis = 5;
3269}
3270
3271
3272/**
3273 * Size of a particular category. Eg: photos, videos.
3274 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3275 */
3276message CategorySize {
3277 enum Category {
3278 UNKNOWN = 0;
3279 APP_SIZE = 1;
3280 APP_DATA_SIZE = 2;
3281 APP_CACHE_SIZE = 3;
3282 PHOTOS = 4;
3283 VIDEOS = 5;
3284 AUDIO = 6;
3285 DOWNLOADS = 7;
3286 SYSTEM = 8;
3287 OTHER = 9;
3288 }
3289 optional Category category = 1;
3290 // Category size in bytes.
3291 optional int64 size_bytes = 2;
3292 // Time that the cache file was produced.
3293 // Uses System.currentTimeMillis(), which is wall clock time.
3294 optional int64 cache_time_millis = 3;
3295}
Tej Singhd6d6d772018-09-05 17:41:25 -07003296
3297/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003298 * Pulls per uid I/O stats. The stats are cumulative since boot.
3299 *
3300 * Read/write bytes are I/O events from a storage device
3301 * Read/write chars are data requested by read/write syscalls, and can be
3302 * satisfied by caching.
3303 *
3304 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3305 */
3306message DiskIo {
3307 optional int32 uid = 1 [(is_uid) = true];
3308 optional int64 fg_chars_read = 2;
3309 optional int64 fg_chars_write = 3;
3310 optional int64 fg_bytes_read = 4;
3311 optional int64 fg_bytes_write = 5;
3312 optional int64 bg_chars_read = 6;
3313 optional int64 bg_chars_write = 7;
3314 optional int64 bg_bytes_read = 8;
3315 optional int64 bg_bytes_write = 9;
3316 optional int64 fg_fsync = 10;
3317 optional int64 bg_fsync= 11;
3318}
3319
3320
3321/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003322 * Pulls the number of fingerprints for each user.
3323 *
3324 * Pulled from StatsCompanionService, which queries FingerprintManager.
3325 */
3326message NumFingerprints {
3327 // The associated user. Eg: 0 for owners, 10+ for others.
3328 // Defined in android/os/UserHandle.java
3329 optional int32 user = 1;
3330 // Number of fingerprints registered to that user.
3331 optional int32 num_fingerprints = 2;
3332}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003333
Yangsteraf9aee72018-10-12 09:26:16 -07003334message AggStats {
3335 optional int64 min = 1;
3336
3337 optional int64 average = 2;
3338
3339 optional int64 max = 3;
3340}
3341
3342message ProcessStatsStateProto {
3343 optional android.service.procstats.ScreenState screen_state = 1;
3344
3345 optional android.service.procstats.MemoryState memory_state = 2;
3346
3347 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3348 // and not frameworks/base/core/java/android/app/ActivityManager.java
3349 optional android.service.procstats.ProcessState process_state = 3;
3350
3351 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003352 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003353
3354 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003355 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003356
3357 // # of samples taken
3358 optional int32 sample_size = 5;
3359
3360 // PSS is memory reserved for this process
3361 optional AggStats pss = 6;
3362
3363 // USS is memory shared between processes, divided evenly for accounting
3364 optional AggStats uss = 7;
3365
3366 // RSS is memory resident for this process
3367 optional AggStats rss = 8;
3368}
3369
3370// Next Tag: 7
3371message ProcessStatsProto {
3372 // Name of process.
3373 optional string process = 1;
3374
3375 // Uid of the process.
3376 optional int32 uid = 2;
3377
3378 // Information about how often kills occurred
3379 message Kill {
3380 // Count of excessive CPU kills
3381 optional int32 cpu = 1;
3382
3383 // Count of kills when cached
3384 optional int32 cached = 2;
3385
3386 // PSS stats during cached kill
3387 optional AggStats cached_pss = 3;
3388 }
3389 optional Kill kill = 3;
3390
3391 // Time and memory spent in various states.
3392 repeated ProcessStatsStateProto states = 5;
3393
3394 // Total time process has been running... screen_state, memory_state, and process_state
3395 // will not be set.
3396 optional ProcessStatsStateProto total_running_state = 6;
3397}
3398
3399message PackageServiceOperationStatsProto {
3400 // Operate enum: Started, Foreground, Bound, Executing
3401 optional android.service.procstats.ServiceOperationState operation = 1;
3402
3403 // Number of times the service was in this operation.
3404 optional int32 count = 2;
3405
3406 // Information about a state the service can be in.
3407 message StateStats {
3408 // Screen state enum.
3409 optional android.service.procstats.ScreenState screen_state = 1;
3410 // Memory state enum.
3411 optional android.service.procstats.MemoryState memory_state = 2;
3412
3413 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07003414 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003415 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003416 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003417 }
3418 repeated StateStats state_stats = 3;
3419}
3420
3421message PackageServiceStatsProto {
3422 // Name of service component.
3423 optional string service_name = 1;
3424
3425 // The operation stats.
3426 // The package_name, package_uid, package_version, service_name will not be set to save space.
3427 repeated PackageServiceOperationStatsProto operation_stats = 2;
3428}
3429
3430message PackageAssociationSourceProcessStatsProto {
3431 // Uid of the process.
3432 optional int32 process_uid = 1;
3433 // Process name.
3434 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08003435 // Package name.
3436 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07003437 // Total count of the times this association appeared.
3438 optional int32 total_count = 3;
3439
3440 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07003441 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003442
3443 // Total count of the times this association became actively impacting its target process.
3444 optional int32 active_count = 5;
3445
3446 // Information on one source in this association.
3447 message StateStats {
3448 // Process state enum.
3449 optional android.service.procstats.ProcessState process_state = 1;
3450 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003451 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003452 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003453 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003454 }
3455 repeated StateStats active_state_stats = 6;
3456}
3457
3458message PackageAssociationProcessStatsProto {
3459 // Name of the target component.
3460 optional string component_name = 1;
3461 // Information on one source in this association.
3462 repeated PackageAssociationSourceProcessStatsProto sources = 2;
3463}
3464
3465
3466message ProcessStatsPackageProto {
3467 // Name of package.
3468 optional string package = 1;
3469
3470 // Uid of the package.
3471 optional int32 uid = 2;
3472
3473 // Version of the package.
3474 optional int64 version = 3;
3475
3476 // Stats for each process running with the package loaded in to it.
3477 repeated ProcessStatsProto process_stats = 4;
3478
3479 // Stats for each of the package's services.
3480 repeated PackageServiceStatsProto service_stats = 5;
3481
3482 // Stats for each association with the package.
3483 repeated PackageAssociationProcessStatsProto association_stats = 6;
3484}
3485
3486message ProcessStatsSectionProto {
3487 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003488 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07003489
3490 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003491 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003492
3493 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003494 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003495
3496 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003497 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003498
3499 // System runtime library. e.g. "libdvm.so", "libart.so".
3500 optional string runtime = 5;
3501
3502 // whether kernel reports swapped pss.
3503 optional bool has_swapped_pss = 6;
3504
3505 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
3506 enum Status {
3507 STATUS_UNKNOWN = 0;
3508 STATUS_COMPLETE = 1;
3509 STATUS_PARTIAL = 2;
3510 STATUS_SHUTDOWN = 3;
3511 STATUS_SYSPROPS = 4;
3512 }
3513 repeated Status status = 7;
3514
Chenjie Yub2ecc792019-01-17 10:27:26 -08003515 // Number of pages available of various types and sizes, representation fragmentation.
3516 repeated ProcessStatsAvailablePagesProto available_pages = 10;
3517
Yangsteraf9aee72018-10-12 09:26:16 -07003518 // Stats for each process.
3519 repeated ProcessStatsProto process_stats = 8;
3520
3521 // Stats for each package.
3522 repeated ProcessStatsPackageProto package_stats = 9;
3523}
3524
Chenjie Yub2ecc792019-01-17 10:27:26 -08003525message ProcessStatsAvailablePagesProto {
3526 // Node these pages are in (as per /proc/pagetypeinfo)
3527 optional int32 node = 1;
3528
3529 // Zone these pages are in (as per /proc/pagetypeinfo)
3530 optional string zone = 2;
3531
3532 // Label for the type of these pages (as per /proc/pagetypeinfo)
3533 optional string label = 3;
3534
3535 // Distribution of number of pages available by order size. First entry in array is
3536 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
3537 repeated int32 pages_per_order = 4;
3538}
3539
Chenjie Yu12e5e672018-09-14 15:54:59 -07003540/**
3541 * Pulled from ProcessStatsService.java
3542 */
3543message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07003544 optional ProcessStatsSectionProto proc_stats_section = 1;
3545}
3546
Chenjie Yuf910b7802019-01-11 16:08:20 -08003547/**
3548 * Pulled from ProcessStatsService.java
3549 */
3550message ProcStatsPkgProc {
3551 optional ProcessStatsSectionProto proc_stats_section = 1;
3552}
3553
Yangsteraf9aee72018-10-12 09:26:16 -07003554message PowerProfileProto {
3555 optional double cpu_suspend = 1;
3556
3557 optional double cpu_idle = 2;
3558
3559 optional double cpu_active = 3;
3560
3561 message CpuCluster {
3562 optional int32 id = 1;
3563 optional double cluster_power = 2;
3564 optional int32 cores = 3;
3565 repeated int64 speed = 4;
3566 repeated double core_power = 5;
3567 }
3568
3569 repeated CpuCluster cpu_cluster = 40;
3570
3571 optional double wifi_scan = 4;
3572
3573 optional double wifi_on = 5;
3574
3575 optional double wifi_active = 6;
3576
3577 optional double wifi_controller_idle = 7;
3578
3579 optional double wifi_controller_rx = 8;
3580
3581 optional double wifi_controller_tx = 9;
3582
3583 repeated double wifi_controller_tx_levels = 10;
3584
3585 optional double wifi_controller_operating_voltage = 11;
3586
3587 optional double bluetooth_controller_idle = 12;
3588
3589 optional double bluetooth_controller_rx = 13;
3590
3591 optional double bluetooth_controller_tx = 14;
3592
3593 optional double bluetooth_controller_operating_voltage = 15;
3594
3595 optional double modem_controller_sleep = 16;
3596
3597 optional double modem_controller_idle = 17;
3598
3599 optional double modem_controller_rx = 18;
3600
3601 repeated double modem_controller_tx = 19;
3602
3603 optional double modem_controller_operating_voltage = 20;
3604
3605 optional double gps_on = 21;
3606
3607 repeated double gps_signal_quality_based = 22;
3608
3609 optional double gps_operating_voltage = 23;
3610
3611 optional double bluetooth_on = 24;
3612
3613 optional double bluetooth_active = 25;
3614
3615 optional double bluetooth_at_cmd = 26;
3616
3617 optional double ambient_display = 27;
3618
3619 optional double screen_on = 28;
3620
3621 optional double radio_on = 29;
3622
3623 optional double radio_scanning = 30;
3624
3625 optional double radio_active = 31;
3626
3627 optional double screen_full = 32;
3628
3629 optional double audio = 33;
3630
3631 optional double video = 34;
3632
3633 optional double flashlight = 35;
3634
3635 optional double memory = 36;
3636
3637 optional double camera = 37;
3638
3639 optional double wifi_batched_scan = 38;
3640
3641 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003642}
Chenjie Yuab530202018-09-26 12:39:20 -07003643
3644/**
3645 * power_profile.xml and other constants for power model calculations.
3646 * Pulled from PowerProfile.java
3647 */
3648message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003649 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003650}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003651
3652/**
arangelovd5db50e2018-10-12 20:24:39 +01003653 * Logs when a user restriction was added or removed.
3654 *
3655 * Logged from:
3656 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3657 */
3658message UserRestrictionChanged {
3659 // The raw string of the user restriction as defined in UserManager.
3660 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3661 optional string restriction = 1;
3662 // Whether the restriction is enabled or disabled.
3663 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07003664}
Yangster-mac308ea0c2018-10-22 13:10:25 -07003665
3666/**
3667 * Pulls process user time and system time. Puller takes a snapshot of all pids
3668 * in the system and returns cpu stats for those that are working at the time.
3669 * Dead pids will be dropped. Kernel processes are excluded.
3670 * Min cool-down is 5 sec.
3671 */
3672message ProcessCpuTime {
3673 optional int32 uid = 1 [(is_uid) = true];
3674
3675 optional string process_name = 2;
3676 // Process cpu time in user space, cumulative from boot/process start
3677 optional int64 user_time_millis = 3;
3678 // Process cpu time in system space, cumulative from boot/process start
3679 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01003680}
Misha Wagner5a51e002018-10-03 15:04:09 +01003681
3682/**
3683 * Pulls the CPU usage for each thread.
3684 *
3685 * Read from /proc/$PID/task/$TID/time_in_state files.
3686 *
3687 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
3688 * time_in_state files not being present on some phones, have not been addressed. These should be
3689 * considered before a public release.
3690 */
3691message CpuTimePerThreadFreq {
3692 // UID that owns the process.
3693 optional int32 uid = 1 [(is_uid) = true];
3694 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003695 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01003696 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003697 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01003698 // Name of the process taken from `/proc/$PID/cmdline`.
3699 optional string process_name = 4;
3700 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
3701 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00003702
3703 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
3704 // are given in KHz, and time is given in milliseconds since the thread started. All eight
3705 // frequencies are given here as the alternative is sending eight separate atoms. This method
3706 // significantly reduces the amount of data created
3707 optional int32 frequency1_khz = 6;
3708 optional int32 time1_millis = 7;
3709 optional int32 frequency2_khz = 8;
3710 optional int32 time2_millis = 9;
3711 optional int32 frequency3_khz = 10;
3712 optional int32 time3_millis = 11;
3713 optional int32 frequency4_khz = 12;
3714 optional int32 time4_millis = 13;
3715 optional int32 frequency5_khz = 14;
3716 optional int32 time5_millis = 15;
3717 optional int32 frequency6_khz = 16;
3718 optional int32 time6_millis = 17;
3719 optional int32 frequency7_khz = 18;
3720 optional int32 time7_millis = 19;
3721 optional int32 frequency8_khz = 20;
3722 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01003723}
Bookatz75ee6042018-11-09 12:27:37 -08003724
3725/**
Bookatz366a4432018-11-20 09:42:33 -08003726 * Pulls information about the device's build.
3727 */
3728message BuildInformation {
3729 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
3730 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
3731 optional string fingerprint = 1;
3732
3733 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
3734 optional string brand = 2;
3735
3736 // Build.PRODUCT. The name of the overall product.
3737 optional string product = 3;
3738
3739 // Build.DEVICE. The name of the industrial design.
3740 optional string device = 4;
3741
3742 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
3743 optional string version_release = 5;
3744
3745 // Build.ID. E.g. a label like "M4-rc20".
3746 optional string id = 6;
3747
3748 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
3749 // represent this build.
3750 optional string version_incremental = 7;
3751
3752 // Build.TYPE. The type of build, like "user" or "eng".
3753 optional string type = 8;
3754
3755 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
3756 optional string tags = 9;
3757}
3758
3759/**
Bookatz75ee6042018-11-09 12:27:37 -08003760 * Pulls on-device BatteryStats power use calculations for the overall device.
3761 */
3762message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08003763 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3764 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3765 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
3766 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08003767}
3768
3769/**
3770 * Pulls on-device BatteryStats power use calculations broken down by uid.
3771 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
3772 * that is attributed to non-uid items. They must all be included to get the total power use.
3773 */
3774message DeviceCalculatedPowerBlameUid {
3775 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
3776 optional int32 uid = 1 [(is_uid) = true];
3777
Bookatz3dbc13a2018-12-21 12:16:51 -08003778 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3779 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3780 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08003781}
3782
3783/**
3784 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
3785 * drain type.
3786 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
3787 * is attributed uids. They must all be included to get the total power use.
3788 */
3789message DeviceCalculatedPowerBlameOther {
3790 // The type of item whose power use is being reported.
3791 enum DrainType {
3792 AMBIENT_DISPLAY = 0;
3793 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
3794 BLUETOOTH = 2;
3795 CAMERA = 3;
3796 // Cell-standby
3797 CELL = 4;
3798 FLASHLIGHT = 5;
3799 IDLE = 6;
3800 MEMORY = 7;
3801 // Amount that total computed drain exceeded the drain estimated using the
3802 // battery level changes and capacity.
3803 OVERCOUNTED = 8;
3804 PHONE = 9;
3805 SCREEN = 10;
3806 // Amount that total computed drain was below the drain estimated using the
3807 // battery level changes and capacity.
3808 UNACCOUNTED = 11;
3809 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
3810 WIFI = 13;
3811 }
3812 optional DrainType drain_type = 1;
3813
Bookatz3dbc13a2018-12-21 12:16:51 -08003814 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3815 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3816 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00003817}
arangelov4e994062018-11-13 16:12:38 +00003818
3819/**
3820 * Logs device policy features.
3821 *
3822 * Logged from:
3823 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3824 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
3825 */
3826message DevicePolicyEvent {
3827 // The event id - unique for each event.
3828 optional android.stats.devicepolicy.EventId event_id = 1;
3829 // The admin package name.
3830 optional string admin_package_name = 2;
3831 // A generic integer parameter.
3832 optional int32 integer_value = 3;
3833 // A generic boolean parameter.
3834 optional bool boolean_value = 4;
3835 // A parameter specifying a time period in milliseconds.
3836 optional uint64 time_period_millis = 5;
3837 // A parameter specifying a list of package names, bundle extras or string parameters.
3838 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
3839}
shawnlinea5b66b2018-11-13 15:05:29 +08003840
3841/**
3842 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
3843 *
3844 * Logged from:
3845 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3846 */
3847message DocsUILaunchReported {
3848 optional android.stats.docsui.LaunchAction launch_action = 1;
3849 optional bool has_initial_uri = 2;
3850 optional android.stats.docsui.MimeType mime_type = 3;
3851 optional android.stats.docsui.Root initial_root = 4;
3852}
3853
3854/**
3855 * Logs root/app visited event in file managers/picker. Call this when the user
3856 * taps on root/app in hamburger menu.
3857 *
3858 * Logged from:
3859 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3860 */
3861message DocsUIRootVisitedReported {
3862 optional android.stats.docsui.ContextScope scope = 1;
3863 optional android.stats.docsui.Root root = 2;
3864}
3865
3866/**
3867 * Logs file operation stats. Call this when a file operation has completed.
3868 *
3869 * Logged from:
3870 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3871 */
3872message DocsUIFileOperationReported {
3873 optional android.stats.docsui.Provider provider = 1;
3874 optional android.stats.docsui.FileOperation file_op = 2;
3875}
3876
3877/**
3878 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
3879 * mode.
3880 *
3881 * Logged from:
3882 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3883 */
3884message DocsUIFileOperationCopyMoveModeReported {
3885 optional android.stats.docsui.FileOperation file_op = 1;
3886 optional android.stats.docsui.CopyMoveOpMode mode = 2;
3887}
3888
3889
3890/**
3891 * Logs file sub operation stats. Call this when a file operation has failed.
3892 *
3893 * Logged from:
3894 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3895 */
3896message DocsUIFileOperationFailureReported {
3897 optional android.stats.docsui.Authority authority = 1;
3898 optional android.stats.docsui.SubFileOperation sub_op = 2;
3899}
3900
3901/**
3902* Logs the cancellation of a file operation. Call this when a job is canceled
3903*
3904* Logged from:
3905* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3906*/
3907message DocsUIFileOperationCanceledReported {
3908 optional android.stats.docsui.FileOperation file_op = 1;
3909}
3910
3911/**
3912 * Logs startup time in milliseconds.
3913 *
3914 * Logged from:
3915 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3916 */
3917message DocsUIStartupMsReported {
3918 optional int32 startup_millis = 1;
3919}
3920
3921/**
3922 * Logs the action that was started by user.
3923 *
3924 * Logged from:
3925 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3926 */
3927message DocsUIUserActionReported {
3928 optional android.stats.docsui.UserAction action = 1;
3929}
3930
3931/**
3932 * Logs the invalid type when invalid scoped access is requested.
3933 *
3934 * Logged from:
3935 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
3936 */
3937message DocsUIInvalidScopedAccessRequestReported {
3938 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00003939}
Ben Murdochbab399f2018-12-06 11:01:38 +00003940
3941/**
shawnlina75e82d2019-01-07 10:31:12 +08003942 * Logs the package name that launches docsui picker mode.
3943 *
3944 * Logged from:
3945 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3946 */
3947message DocsUIPickerLaunchedFromReported {
3948 optional string package_name = 1;
3949}
3950
3951/**
3952 * Logs the search type.
3953 *
3954 * Logged from:
3955 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3956 */
3957message DocsUISearchTypeReported {
3958 optional android.stats.docsui.SearchType search_type = 1;
3959}
3960
3961/**
3962 * Logs the search mode.
3963 *
3964 * Logged from:
3965 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3966 */
3967message DocsUISearchModeReported {
3968 optional android.stats.docsui.SearchMode search_mode = 1;
3969}
3970
3971/**
3972 * Logs the pick result information.
3973 *
3974 * Logged from:
3975 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3976 */
3977message DocsUIPickResultReported {
3978 optional int32 total_action_count = 1;
3979 optional int64 duration_millis = 2;
3980 optional int32 file_count= 3;
3981 optional bool is_searching = 4;
3982 optional android.stats.docsui.Root picked_from = 5;
3983 optional android.stats.docsui.MimeType mime_type = 6;
3984 optional int32 repeatedly_pick_times = 7;
3985}
3986
3987/**
Ben Murdochbab399f2018-12-06 11:01:38 +00003988 * Logs when an app's memory is compacted.
3989 *
3990 * Logged from:
3991 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3992 */
3993message AppCompacted {
3994 // The pid of the process being compacted.
3995 optional int32 pid = 1;
3996
3997 // The name of the process being compacted.
3998 optional string process_name = 2;
3999
4000 // The type of compaction.
4001 enum Action {
4002 UNKNOWN = 0;
4003 SOME = 1;
4004 FULL = 2;
4005 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004006 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004007
4008 // Total RSS in kilobytes consumed by the process prior to compaction.
4009 optional int64 before_rss_total_kilobytes = 4;
4010
4011 // File RSS in kilobytes consumed by the process prior to compaction.
4012 optional int64 before_rss_file_kilobytes = 5;
4013
4014 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4015 optional int64 before_rss_anon_kilobytes = 6;
4016
4017 // Swap in kilobytes consumed by the process prior to compaction.
4018 optional int64 before_swap_kilobytes = 7;
4019
4020 // Total RSS in kilobytes consumed by the process after compaction.
4021 optional int64 after_rss_total_kilobytes = 8;
4022
4023 // File RSS in kilobytes consumed by the process after compaction.
4024 optional int64 after_rss_file_kilobytes = 9;
4025
4026 // Anonymous RSS in kilobytes consumed by the process after compaction.
4027 optional int64 after_rss_anon_kilobytes = 10;
4028
4029 // Swap in kilobytes consumed by the process after compaction.
4030 optional int64 after_swap_kilobytes = 11;
4031
4032 // The time taken to perform compaction in milliseconds.
4033 optional int64 time_to_compact_millis = 12;
4034
4035 // The last compaction action performed for this app.
4036 optional Action last_action = 13;
4037
Ben Murdoch01720b82018-12-19 18:03:44 +00004038 // The last time that compaction was attempted on this process in milliseconds
4039 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4040 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004041
Ben Murdoch01720b82018-12-19 18:03:44 +00004042 // The oom_score_adj at the time of compaction.
4043 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004044
4045 // The process state at the time of compaction.
4046 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4047}
lifr157fc552018-12-12 16:38:04 +08004048
4049/**
4050 * Logs the latency period(in microseconds) and the return code of
4051 * the DNS(Domain Name System) lookups.
4052 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4053 * to get info(address or hostname) from DNS server(or DNS cache).
4054 * Logged from:
4055 * /system/netd/server/DnsProxyListener.cpp
4056 */
4057message NetworkDnsEventReported {
4058 // The types of the DNS lookups, as defined in
4059 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4060 enum EventType {
4061 EVENT_UNKNOWN = 0;
4062 EVENT_GETADDRINFO = 1;
4063 EVENT_GETHOSTBYNAME = 2;
4064 EVENT_GETHOSTBYADDR = 3;
4065 EVENT_RES_NSEND = 4;
4066 }
4067 optional EventType event_type = 1;
4068
4069 // The return value of the DNS resolver for each DNS lookups.
4070 //bionic/libc/include/netdb.h
4071 //system/netd/resolv/include/netd_resolv/resolv.h
4072 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004073 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004074 EAI_ADDRFAMILY = 1;
4075 EAI_AGAIN = 2;
4076 EAI_BADFLAGS = 3;
4077 EAI_FAIL = 4;
4078 EAI_FAMILY = 5;
4079 EAI_MEMORY = 6;
4080 EAI_NODATA = 7;
4081 EAI_NONAME = 8;
4082 EAI_SERVICE = 9;
4083 EAI_SOCKTYPE = 10;
4084 EAI_SYSTEM = 11;
4085 EAI_BADHINTS = 12;
4086 EAI_PROTOCOL = 13;
4087 EAI_OVERFLOW = 14;
4088 RESOLV_TIMEOUT = 255;
4089 EAI_MAX = 256;
4090 }
4091 optional ReturnCode return_code = 2;
4092
4093 // The latency period(in microseconds) it took for this DNS lookup to complete.
4094 optional int32 latency_micros = 3;
4095}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004096
4097/**
4098 * Logs when a data stall event occurs.
4099 *
4100 * Log from:
4101 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4102 */
4103message DataStallEvent {
4104 // Data stall evaluation type.
4105 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4106 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4107 optional int32 evaluation_type = 1;
4108 // See definition in data_stall_event.proto.
4109 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4110 // See definition in data_stall_event.proto.
4111 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4112 // See definition in data_stall_event.proto.
4113 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4114 // See definition in data_stall_event.proto.
4115 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4116 // See definition in data_stall_event.proto.
4117 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4118}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004119
4120/*
4121 * Logs when RescueParty resets some set of experiment flags.
4122 *
4123 * Logged from:
4124 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4125 */
4126message RescuePartyResetReported {
4127 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4128 optional int32 rescue_level = 1;
4129}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004130
4131/**
4132 * Logs when signed config is received from an APK, and if that config was applied successfully.
4133 * Logged from:
4134 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4135 */
4136message SignedConfigReported {
4137 enum Type {
4138 UNKNOWN_TYPE = 0;
4139 GLOBAL_SETTINGS = 1;
4140 }
4141 optional Type type = 1;
4142
4143 // The final status of the signed config received.
4144 enum Status {
4145 UNKNOWN_STATUS = 0;
4146 APPLIED = 1;
4147 BASE64_FAILURE_CONFIG = 2;
4148 BASE64_FAILURE_SIGNATURE = 3;
4149 SECURITY_EXCEPTION = 4;
4150 INVALID_CONFIG = 5;
4151 OLD_CONFIG = 6;
4152 SIGNATURE_CHECK_FAILED = 7;
4153 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004154 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004155 }
4156 optional Status status = 2;
4157
4158 // The version of the signed config processed.
4159 optional int32 version = 3;
4160
4161 // The package name that the config was extracted from.
4162 optional string from_package = 4;
4163
4164 enum Key {
4165 NO_KEY = 0;
4166 DEBUG = 1;
4167 PRODUCTION = 2;
4168 }
4169 // Which key was used to verify the config.
4170 optional Key verified_with = 5;
4171}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004172
4173/*
4174 * Logs GNSS Network-Initiated (NI) location events.
4175 *
4176 * Logged from:
4177 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4178 */
4179message GnssNiEventReported {
4180 // The type of GnssNiEvent.
4181 enum EventType {
4182 UNKNOWN = 0;
4183 NI_REQUEST = 1;
4184 NI_RESPONSE = 2;
4185 }
4186 optional EventType event_type = 1;
4187
4188 // An ID generated by HAL to associate NI notifications and UI responses.
4189 optional int32 notification_id = 2;
4190
4191 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004192 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004193
4194 // NI requires notification.
4195 optional bool need_notify = 4;
4196
4197 // NI requires verification.
4198 optional bool need_verify = 5;
4199
4200 // NI requires privacy override, no notification/minimal trace.
4201 optional bool privacy_override = 6;
4202
4203 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4204 // seconds.
4205 optional int32 timeout = 7;
4206
4207 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004208 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004209
4210 // String representing the requester of the network inititated location request.
4211 optional string requestor_id = 9;
4212
4213 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4214 // network initiated location request.
4215 optional string text = 10;
4216
4217 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004218 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004219
4220 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004221 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004222
4223 // True if SUPL ES is enabled.
4224 optional bool is_supl_es_enabled = 13;
4225
4226 // True if GNSS location is enabled.
4227 optional bool is_location_enabled = 14;
4228
4229 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004230 optional android.server.location.GnssUserResponseType user_response = 15;
4231}
4232
4233/**
4234 * Logs GNSS non-framework (NFW) location notification.
4235 *
4236 * Logged from:
4237 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4238 */
4239message GnssNfwNotificationReported {
4240 // Package name of the Android proxy application representing the non-framework entity that
4241 // requested location. Set to empty string if unknown.
4242 optional string proxy_app_package_name = 1;
4243
4244 // Protocol stack that initiated the non-framework location request.
4245 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4246
4247 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4248 // set to empty string. This field is opaque to the framework and used for logging purposes.
4249 optional string other_protocol_stack_name = 3;
4250
4251 // Source initiating/receiving the location information.
4252 optional android.server.location.NfwRequestor requestor = 4;
4253
4254 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4255 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4256 // and used for logging purposes.
4257 optional string requestor_id = 5;
4258
4259 // Indicates whether location information was provided for this request.
4260 optional android.server.location.NfwResponseType response_type = 6;
4261
4262 // True if the device is in user initiated emergency session.
4263 optional bool in_emergency_mode = 7;
4264
4265 // True if cached location is provided.
4266 optional bool is_cached_location = 8;
4267
4268 // True if proxy app permission mismatch between framework and GNSS HAL.
4269 optional bool is_permission_mismatched = 9;
4270}
4271
4272/**
4273 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4274 *
4275 * Logged from:
4276 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4277 */
4278message GnssConfigurationReported {
4279 // SUPL host name.
4280 optional string supl_host = 1;
4281
4282 // SUPL port number.
4283 optional int32 supl_port = 2;
4284
4285 // C2K host name.
4286 optional string c2k_host = 3;
4287
4288 // C2K port number.
4289 optional int32 c2k_port = 4;
4290
4291 // The SUPL version requested by Carrier.
4292 optional int32 supl_ver = 5;
4293
4294 // The SUPL mode.
4295 optional android.server.location.SuplMode supl_mode = 6;
4296
4297 // True if NI emergency SUPL restrictions is enabled.
4298 optional bool supl_es = 7;
4299
4300 // LTE Positioning Profile settings
4301 optional android.server.location.LppProfile lpp_profile = 8;
4302
4303 // Positioning protocol on A-Glonass system.
4304 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
4305
4306 // True if emergency PDN is used. Otherwise, regular PDN is used.
4307 optional bool use_emergency_pdn_for_emergency_supl= 10;
4308
4309 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
4310 optional android.server.location.GpsLock gps_lock = 11;
4311
4312 // Number of seconds to extend the emergency session duration post emergency call.
4313 optional int32 es_extension_sec = 12;
4314
4315 // The full list of package names of proxy Android applications representing the non-framework
4316 // location access entities (on/off the device) for which the framework user has granted
4317 // non-framework location access permission. The package names are concatenated in one string
4318 // with spaces as separators.
4319 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004320}
Jack Yu95b64f32018-12-13 18:26:11 +08004321
4322/**
4323 * Logs when a NFC device's error occurred.
4324 * Logged from:
4325 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4326 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
4327 */
4328message NfcErrorOccurred {
4329 enum Type {
4330 UNKNOWN = 0;
4331 CMD_TIMEOUT = 1;
4332 ERROR_NOTIFICATION = 2;
4333 AID_OVERFLOW = 3;
4334 }
4335 optional Type type = 1;
4336 // If it's nci cmd timeout, log the timeout command.
4337 optional uint32 nci_cmd = 2;
4338
4339 optional uint32 error_ntf_status_code = 3;
4340}
4341
4342/**
4343 * Logs when a NFC device's state changed event
4344 * Logged from:
4345 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
4346 */
4347message NfcStateChanged {
4348 enum State {
4349 UNKNOWN = 0;
4350 OFF = 1;
4351 ON = 2;
4352 ON_LOCKED = 3; // Secure Nfc enabled.
4353 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
4354 }
4355 optional State state = 1;
4356}
4357
4358/**
4359 * Logs when a NFC Beam Transaction occurred.
4360 * Logged from:
4361 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
4362 */
4363message NfcBeamOccurred {
4364 enum Operation {
4365 UNKNOWN = 0;
4366 SEND = 1;
4367 RECEIVE = 2;
4368 }
4369 optional Operation operation = 1;
4370}
4371
4372/**
4373 * Logs when a NFC Card Emulation Transaction occurred.
4374 * Logged from:
4375 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
4376 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
4377 */
4378message NfcCardemulationOccurred {
4379 enum Category {
4380 UNKNOWN = 0;
4381 HCE_PAYMENT = 1;
4382 HCE_OTHER = 2;
4383 OFFHOST = 3;
4384 }
4385 // Transaction belongs to HCE payment or HCE other category, or offhost.
4386 optional Category category = 1;
4387 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
4388 optional string se_name = 2;
4389}
4390
4391/**
4392 * Logs when a NFC Tag event occurred.
4393 * Logged from:
4394 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
4395 */
4396message NfcTagOccurred {
4397 enum Type {
4398 UNKNOWN = 0;
4399 URL = 1;
4400 BT_PAIRING = 2;
4401 PROVISION = 3;
4402 WIFI_CONNECT = 4;
4403 APP_LAUNCH = 5;
4404 OTHERS = 6;
4405 }
4406 optional Type type = 1;
4407}
4408
4409/**
4410 * Logs when Hce transaction triggered
4411 * Logged from:
4412 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4413 */
4414message NfcHceTransactionOccurred {
4415 // The latency period(in microseconds) it took for the first HCE data
4416 // exchange.
4417 optional uint32 latency_micros = 1;
4418}
4419
4420/**
4421 * Logs when SecureElement state event changed
4422 * Logged from:
4423 * packages/apps/SecureElement/src/com/android/se/Terminal.java
4424 */
4425message SeStateChanged {
4426 enum State {
4427 UNKNOWN = 0;
4428 INITIALIZED = 1;
4429 DISCONNECTED = 2;
4430 CONNECTED = 3;
4431 HALCRASH = 4;
4432 }
4433 optional State state = 1;
4434
4435 optional string state_change_reason = 2;
4436 // SIMx or eSEx.
4437 optional string terminal = 3;
4438}
4439
4440/**
4441 * Logs when Omapi API used
4442 * Logged from:
4443 * packages/apps/SecureElement/src/com/android/se/Terminal.java
4444 */
4445message SeOmapiReported {
4446 enum Operation {
4447 UNKNOWN = 0;
4448 OPEN_CHANNEL = 1;
4449 }
4450 optional Operation operation = 1;
4451 // SIMx or eSEx.
4452 optional string terminal = 2;
4453
4454 optional string packageName = 3;
4455}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004456
4457/**
4458 * Logs the dispatch latencey of a broadcast during processing of BOOT_COMPLETED.
4459 * The dispatch latencey is the dispatchClockTime - enqueueClockTime.
4460 * Logged from:
4461 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
4462 */
4463message BroadcastDispatchLatencyReported {
4464 optional int64 dispatch_latency_millis = 1;
4465}