blob: f06914f52a8025ad5467a7a3c15bfbc398d275ae [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;
94 // 34 is available
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;
Yao Chend54f9dd2017-10-17 17:37:48 +0000197 }
David Chenc8a43242017-10-17 16:23:28 -0700198
David Chen6e3e6cb2018-01-03 16:14:06 -0800199 // Pulled events will start at field 10000.
Rafal Slawik3bea8952018-11-15 12:39:33 +0000200 // Next: 10043
David Chenc8a43242017-10-17 16:23:28 -0700201 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800202 WifiBytesTransfer wifi_bytes_transfer = 10000;
203 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
204 MobileBytesTransfer mobile_bytes_transfer = 10002;
205 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800206 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800207 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800208 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800209 CpuTimePerFreq cpu_time_per_freq = 10008;
210 CpuTimePerUid cpu_time_per_uid = 10009;
211 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800212 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800213 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800214 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800215 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800216 SystemElapsedRealtime system_elapsed_realtime = 10014;
217 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800218 CpuActiveTime cpu_active_time = 10016;
219 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000220 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800221 RemainingBatteryCapacity remaining_battery_capacity = 10019;
222 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800223 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100224 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100225 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100226 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000227 DiskStats disk_stats = 10025;
228 DirectoryUsage directory_usage = 10026;
229 AppSize app_size = 10027;
230 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700231 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700232 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700233 NumFingerprints num_fingerprints = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700234 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700235 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800236 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700237 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100238 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100239 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700240 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800241 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
242 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
243 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000244 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800245 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800246 BuildInformation build_information = 10044;
David Chenc8a43242017-10-17 16:23:28 -0700247 }
yroa1fe77c2018-02-26 14:22:54 -0800248
Bookatz76aafcf2018-09-17 16:17:10 -0700249 // DO NOT USE field numbers above 100,000 in AOSP.
250 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
251 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700252}
253
Yao Chend54f9dd2017-10-17 17:37:48 +0000254/**
Yangster-mac20877162017-12-22 17:19:39 -0800255 * This proto represents a node of an attribution chain.
256 * Note: All attribution chains are represented as a repeated field of type
257 * AttributionNode. It is understood that in such arrays, the order is that
258 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000259 */
Yangster-mac20877162017-12-22 17:19:39 -0800260message AttributionNode {
261 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800262 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800263
Yangster-mac20877162017-12-22 17:19:39 -0800264 // The (optional) string tag for an element in the attribution chain. If the
265 // element has no tag, it is encoded as an empty string.
266 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700267}
268
Yangster-mac48b3d622018-08-18 12:38:11 -0700269message KeyValuePair {
270 optional int32 key = 1;
271 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700272 int32 value_int = 2;
273 int64 value_long = 3;
274 string value_str = 4;
275 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700276 }
277}
278
279message KeyValuePairsAtom {
280 optional int32 uid = 1;
281 repeated KeyValuePair pairs = 2;
282}
283
Yao Chend54f9dd2017-10-17 17:37:48 +0000284/*
285 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800286 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000287 *
288 * RULES:
289 * - The field ids for each atom must start at 1, and count upwards by 1.
290 * Skipping field ids is not allowed.
291 * - These form an API, so renaming, renumbering or removing fields is
292 * not allowed between android releases. (This is not currently enforced,
293 * but there will be a tool to enforce this restriction).
294 * - The types must be built-in protocol buffer types, namely, no sub-messages
295 * are allowed (yet). The bytes type is also not allowed.
296 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800297 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000298 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800299 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000300 * - A field that is a uid should be a string field, tagged with the [xxx]
301 * annotation. The generated code on android will be represented by UIDs,
302 * and those UIDs will be translated in xxx to those strings.
303 *
304 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700305 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000306 * - If there is a UID, it goes first. Think in an object-oriented fashion.
307 * *****************************************************************************
308 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700309
Yao Chend54f9dd2017-10-17 17:37:48 +0000310/**
Yangster-mace16189a2018-08-26 12:20:16 -0700311 * Logs when the Thermal service HAL notifies the throttling start/stop events.
312 *
313 * Logged from:
314 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
315 */
316message ThermalThrottlingStateChanged {
317 optional android.os.TemperatureTypeEnum sensor_type = 1;
318
319 enum State {
320 UNKNOWN = 0;
321 START = 1;
322 STOP = 2;
323 }
324
325 optional State state = 2;
326
327 optional float temperature = 3;
328}
329
330/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000331 * Logs when the screen state changes.
332 *
333 * Logged from:
334 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
335 */
336message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800337 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700338 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700339}
Yao Chend54f9dd2017-10-17 17:37:48 +0000340
341/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700342 * Logs that the process state of the uid, as determined by ActivityManager
343 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000344 *
345 * Logged from:
346 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
347 */
Bookatzc1a050a2017-10-10 15:49:28 -0700348message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700349 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000350
Bookatzdb026a22018-01-10 19:01:56 -0800351 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700352 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000353}
354
355/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700356 * Logs process state change of a process, as per the activity manager.
357 *
358 * Logged from:
359 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
360 */
361message ProcessStateChanged {
362 optional int32 uid = 1;
363 optional string process_name = 2;
364 optional string package_name = 3;
365 // TODO: remove this when validation is done
366 optional int64 version = 5;
367 // The state, from frameworks/base/core/proto/android/app/enums.proto.
368 optional android.app.ProcessStateEnum state = 4;
369}
370
371/**
372 * Logs when ActivityManagerService sleep state is changed.
373 *
374 * Logged from:
375 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
376 */
377message ActivityManagerSleepStateChanged {
378 // TODO: import frameworks proto
379 enum State {
380 UNKNOWN = 0;
381 ASLEEP = 1;
382 AWAKE = 2;
383 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700384 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700385}
386
387/**
388 * Logs when system memory state changes.
389 *
390 * Logged from:
391 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
392 */
393message MemoryFactorStateChanged {
394 // TODO: import frameworks proto
395 enum State {
396 MEMORY_UNKNOWN = 0;
397 NORMAL = 1; // normal.
398 MODERATE = 2; // moderate memory pressure.
399 LOW = 3; // low memory.
400 CRITICAL = 4; // critical memory.
401
402 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700403 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700404}
405
406/**
407 * Logs when app is using too much cpu, according to ActivityManagerService.
408 *
409 * Logged from:
410 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
411 */
412message ExcessiveCpuUsageReported {
413 optional int32 uid = 1;
414 optional string process_name = 2;
415 optional string package_name = 3;
416 // package version. TODO: remove this when validation is done
417 optional int64 version = 4;
418}
419
420/**
421 * Logs when a cached process is killed, along with its pss.
422 *
423 * Logged from:
424 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
425 */
426message CachedKillReported {
427 optional int32 uid = 1;
428 optional string process_name = 2;
429 optional string package_name = 3;
430 // TODO: remove this when validation is done
431 optional int64 version = 5;
432 optional int64 pss = 4;
433}
434
435/**
436 * Logs when memory stats of a process is reported.
437 *
438 * Logged from:
439 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
440 */
441message ProcessMemoryStatReported {
442 optional int32 uid = 1;
443 optional string process_name = 2;
444 optional string package_name = 3;
445 //TODO: remove this when validation is done
446 optional int64 version = 9;
447 optional int64 pss = 4;
448 optional int64 uss = 5;
449 optional int64 rss = 6;
450 enum Type {
451 ADD_PSS_INTERNAL_SINGLE = 0;
452 ADD_PSS_INTERNAL_ALL_MEM = 1;
453 ADD_PSS_INTERNAL_ALL_POLL = 2;
454 ADD_PSS_EXTERNAL = 3;
455 ADD_PSS_EXTERNAL_SLOW = 4;
456 }
457 optional Type type = 7;
458 optional int64 duration = 8;
459}
460
461/**
Bookatzc1a050a2017-10-10 15:49:28 -0700462 * Logs that a process started, finished, crashed, or ANRed.
463 *
464 * Logged from:
465 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
466 */
467message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700468 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700469
David Chen0b5c90c2018-01-25 16:51:49 -0800470 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800471 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700472
Bookatzddccf0a2017-11-28 16:48:14 -0800473 // What lifecycle state the process changed to.
474 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800475 enum State {
476 FINISHED = 0;
477 STARTED = 1;
478 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800479 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800480 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700481}
482
Bookatzc1a050a2017-10-10 15:49:28 -0700483/**
484 * Logs when the ble scan state changes.
485 *
486 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700487 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700488 */
489message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800490 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700491
492 enum State {
493 OFF = 0;
494 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700495 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
496 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700497 }
498 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700499
Bookatze5ec0b42018-03-26 13:34:56 -0700500 // Does the scan have a filter.
501 optional bool is_filtered = 3;
502 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
503 optional bool is_first_match = 4;
504 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
505 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700506}
507
508/**
509 * Logs reporting of a ble scan finding results.
510 *
511 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700512 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700513 */
Bookatzae6738e2018-09-13 11:38:56 -0700514// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700515message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800516 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700517
518 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800519 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700520}
521
522/**
523 * Logs when a sensor state changes.
524 *
525 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700526 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700527 */
528message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800529 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700530
Bookatzc1a050a2017-10-10 15:49:28 -0700531 // The id (int) of the sensor.
532 optional int32 sensor_id = 2;
533
534 enum State {
535 OFF = 0;
536 ON = 1;
537 }
538 optional State state = 3;
539}
540
Bookatzc1a050a2017-10-10 15:49:28 -0700541/**
542 * Logs when GPS state changes.
543 *
544 * Logged from:
545 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
546 */
547message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800548 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700549
550 enum State {
551 OFF = 0;
552 ON = 1;
553 }
554 optional State state = 2;
555}
556
Bookatz48d362e2018-11-06 15:49:08 -0800557/**
558 * Logs when GPS signal quality.
559 *
560 * Logged from:
561 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
562 */
563message GpsSignalQualityChanged {
564 optional android.server.location.GpsSignalQualityEnum level = 1;
565}
566
Bookatzc1a050a2017-10-10 15:49:28 -0700567
568/**
569 * Logs when a sync manager sync state changes.
570 *
571 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700572 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700573 */
574message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800575 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700576
David Chen0b5c90c2018-01-25 16:51:49 -0800577 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800578 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700579
580 enum State {
581 OFF = 0;
582 ON = 1;
583 }
584 optional State state = 3;
585}
586
Yangster-mac96353002018-09-05 11:18:55 -0700587/*
588 * Deferred job stats.
589 *
590 * Logged from:
591 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
592*/
593message DeferredJobStatsReported {
594 repeated AttributionNode attribution_node = 1;
595
596 // Number of jobs deferred.
597 optional int32 num_jobs_deferred = 2;
598
599 // Time since the last job runs.
600 optional int64 time_since_last_job_millis = 3;
601}
602
Bookatzc1a050a2017-10-10 15:49:28 -0700603/**
604 * Logs when a job scheduler job state changes.
605 *
606 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700607 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700608 */
609message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800610 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700611
612 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800613 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700614
615 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800616 FINISHED = 0;
617 STARTED = 1;
618 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700619 }
620 optional State state = 3;
621
Tej Singh33a412b2018-03-16 18:43:59 -0700622 // The reason a job has stopped.
623 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700624 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700625 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700626}
627
628/**
629 * Logs when the audio state changes.
630 *
631 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700632 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700633 */
634message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800635 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700636
637 enum State {
638 OFF = 0;
639 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700640 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
641 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700642 }
643 optional State state = 2;
644}
645
646/**
647 * Logs when the video codec state changes.
648 *
649 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700650 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700651 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800652message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800653 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700654
655 enum State {
656 OFF = 0;
657 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700658 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
659 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700660 }
661 optional State state = 2;
662}
663
664/**
665 * Logs when the flashlight state changes.
666 *
667 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700668 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700669 */
670message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800671 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700672
673 enum State {
674 OFF = 0;
675 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700676 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
677 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700678 }
679 optional State state = 2;
680}
681
682/**
683 * Logs when the camera state changes.
684 *
685 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700686 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700687 */
688message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800689 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700690
691 enum State {
692 OFF = 0;
693 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700694 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
695 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700696 }
697 optional State state = 2;
698}
699
700/**
701 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000702 *
703 * Logged from:
704 * TODO
705 */
Bookatzd6746242017-10-24 18:39:35 -0700706message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800707 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000708
Bookatz1a1b0462018-01-12 11:47:03 -0800709 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
710 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700711 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700712
713 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
714 optional string tag = 3;
715
716 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800717 RELEASE = 0;
718 ACQUIRE = 1;
719 CHANGE_RELEASE = 2;
720 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700721 }
722 optional State state = 4;
723}
724
725/**
Bookatzc1a050a2017-10-10 15:49:28 -0700726 * Logs when a partial wakelock is considered 'long' (over 1 min).
727 *
728 * Logged from:
729 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
730 */
731message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800732 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700733
Yao Chend54f9dd2017-10-17 17:37:48 +0000734 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
735 optional string tag = 2;
736
Bookatzc1a050a2017-10-10 15:49:28 -0700737 // TODO: I have no idea what this is.
738 optional string history_tag = 3;
739
740 enum State {
741 OFF = 0;
742 ON = 1;
743 }
744 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000745}
746
Bookatzc1a050a2017-10-10 15:49:28 -0700747/**
Bookatza66083f2018-09-20 17:24:00 -0700748 * Logs when the device is interactive, according to the PowerManager Notifier.
749 *
750 * Logged from:
751 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
752 */
753message InteractiveStateChanged {
754 enum State {
755 OFF = 0;
756 ON = 1;
757 }
758 optional State state = 1;
759}
760
761/**
Bookatzc1a050a2017-10-10 15:49:28 -0700762 * Logs Battery Saver state change.
763 *
764 * Logged from:
765 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
766 */
767message BatterySaverModeStateChanged {
768 enum State {
769 OFF = 0;
770 ON = 1;
771 }
772 optional State state = 1;
773}
774
775/**
776 * Logs Doze mode state change.
777 *
778 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800779 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700780 */
781message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800782 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800783}
784
785
786/**
787 * Logs state change of Doze mode including maintenance windows.
788 *
789 * Logged from:
790 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
791 */
792message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800793 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700794}
795
796/**
797 * Logs screen brightness level.
798 *
799 * Logged from:
800 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
801 */
802message ScreenBrightnessChanged {
803 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
804 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700805}
806
807/**
808 * Logs battery level (percent full, from 0 to 100).
809 *
810 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700811 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700812 */
813message BatteryLevelChanged {
814 // Battery level. Should be in [0, 100].
815 optional int32 battery_level = 1;
816}
817
818/**
819 * Logs change in charging status of the device.
820 *
821 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700822 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700823 */
824message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800825 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
826 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700827}
828
829/**
830 * Logs whether the device is plugged in, and what power source it is using.
831 *
832 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700833 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700834 */
835message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800836 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
837 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700838}
839
Bookatz8c6571b2017-10-24 15:04:41 -0700840/**
841 * Logs when an app's wakeup alarm fires.
842 *
843 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700844 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700845 */
846message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800847 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800848
849 // Name of the wakeup alarm.
850 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700851
852 // Name of source package (for historical reasons, since BatteryStats tracked it).
853 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800854}
855
856/**
857 * Logs when an an app causes the mobile radio to change state.
858 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
859 *
860 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700861 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800862 */
863message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800864 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800865
Bookatz1a1b0462018-01-12 11:47:03 -0800866 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
867 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800868}
869
870/**
871 * Logs when an an app causes the wifi radio to change state.
872 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
873 *
874 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700875 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800876 */
877message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800878 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800879
Bookatz1a1b0462018-01-12 11:47:03 -0800880 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
881 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700882}
883
884/**
885 * Logs kernel wakeup reasons and aborts.
886 *
887 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700888 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700889 */
890message KernelWakeupReported {
891 // Name of the kernel wakeup reason (or abort).
892 optional string wakeup_reason_name = 1;
893
894 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800895 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700896}
897
898/**
Bookatzda1798c2018-12-13 14:16:00 -0800899 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800900 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800901 *
902 * Logged from:
903 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
904 */
905message WifiEnabledStateChanged {
906 enum State {
907 OFF = 0;
908 ON = 1;
909 }
910 optional State state = 1;
911}
912
913/**
914 * 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 -0800915 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
916 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800917 *
918 * Logged from:
919 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
920 */
921message WifiRunningStateChanged {
922 repeated AttributionNode attribution_node = 1;
923
924 enum State {
925 OFF = 0;
926 ON = 1;
927 }
928 optional State state = 2;
929}
930
931/**
Bookatze5885242017-10-24 20:10:31 -0700932 * Logs wifi locks held by an app.
933 *
934 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700935 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700936 */
937message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800938 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700939
940 enum State {
941 OFF = 0;
942 ON = 1;
943 }
944 optional State state = 2;
945}
946
947/**
948 * Logs wifi signal strength changes.
949 *
950 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800951 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -0700952 */
953message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800954 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
955 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700956}
957
958/**
959 * Logs wifi scans performed by an app.
960 *
961 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800962 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -0700963 */
964message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800965 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700966
967 enum State {
968 OFF = 0;
969 ON = 1;
970 }
971 optional State state = 2;
972}
973
974/**
Tej Singh4503e102018-01-04 14:35:01 -0800975 * Logs wifi multicast locks held by an app
976 *
977 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800978 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -0800979 */
980message WifiMulticastLockStateChanged {
981 repeated AttributionNode attribution_node = 1;
982
983 enum State {
984 OFF = 0;
985 ON = 1;
986 }
987 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -0800988
989 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -0800990}
991
992/**
Tej Singh1ea42892018-01-19 09:27:00 -0800993 * Logs shutdown reason and duration on next boot.
994 *
995 * Logged from:
996 * frameworks/base/core/java/com/android/server/BootReceiver.java
997 */
998message ShutdownSequenceReported {
999 // True if shutdown is for a reboot. Default: false if we do not know.
1000 optional bool reboot = 1;
1001
1002 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1003 optional string reason = 2;
1004
1005 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1006 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001007 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001008
1009 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001010 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001011}
1012
Tej Singh6483ea42018-01-25 17:45:49 -08001013
1014/**
1015 * Logs boot reason and duration.
1016 *
1017 * Logged from:
1018 * system/core/bootstat/bootstat.cpp
1019 */
1020message BootSequenceReported {
1021 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1022 // Default: "<EMPTY>" if not available.
1023 optional string bootloader_reason = 1;
1024
1025 // Reason for system boot. Eg. bootloader, reboot,userrequested
1026 // Default: "<EMPTY>" if not available.
1027 optional string system_reason = 2;
1028
1029 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001030 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001031
1032 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001033 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001034
1035 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001036 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001037
1038 // Time since last boot in ms. Default: 0 if not available.
1039 optional int64 time_since_last_boot = 6;
1040}
1041
Tej Singhc477d9c2018-02-05 18:31:39 -08001042
1043/**
1044 * Logs call state and disconnect cause (if applicable).
1045 *
1046 * Logged from:
1047 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1048 */
1049message CallStateChanged {
1050 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1051 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1052 optional android.telecom.CallStateEnum call_state = 1;
1053
1054 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1055 // This value is only applicable when the call_state is DISCONNECTED, and
1056 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1057 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1058 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1059
1060 // True if the call is self-managed, which are apps that use the
1061 // telecom infrastructure to make their own calls.
1062 optional bool self_managed = 3;
1063
1064 // True if call is external. External calls are calls on connected Wear
1065 // devices but show up in Telecom so the user can pull them onto the device.
1066 optional bool external_call = 4;
1067}
1068
Tej Singh1ea42892018-01-19 09:27:00 -08001069/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001070 * Logs keyguard state. The keyguard is the lock screen.
1071 *
1072 * Logged from:
1073 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1074 */
1075message KeyguardStateChanged {
1076 enum State {
1077 UNKNOWN = 0;
1078 // The keyguard is hidden when the phone is unlocked.
1079 HIDDEN = 1;
1080 // The keyguard is shown when the phone is locked (screen turns off).
1081 SHOWN= 2;
1082 // The keyguard is occluded when something is overlaying the keyguard.
1083 // Eg. Opening the camera while on the lock screen.
1084 OCCLUDED = 3;
1085 }
1086 optional State state = 1;
1087}
1088
1089/**
1090 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1091 * prompts the user to enter a password (pattern, pin, etc).
1092 *
1093 * Logged from:
1094 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1095 */
1096
1097message KeyguardBouncerStateChanged {
1098 enum State {
1099 UNKNOWN = 0;
1100 // Bouncer is hidden, either as a result of successfully entering the
1101 // password, screen timing out, or user going back to lock screen.
1102 HIDDEN = 1;
1103 // This is when the user is being prompted to enter the password.
1104 SHOWN = 2;
1105 }
1106 optional State state = 1;
1107}
1108
1109/**
1110 * Logs the result of entering a password into the keyguard bouncer.
1111 *
1112 * Logged from:
1113 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1114 */
1115message KeyguardBouncerPasswordEntered {
1116 enum BouncerResult {
1117 UNKNOWN = 0;
1118 // The password entered was incorrect.
1119 FAILURE = 1;
1120 // The password entered was correct.
1121 SUCCESS = 2;
1122 }
1123 optional BouncerResult result = 1;
1124}
1125
Tej Singha883b372018-02-15 11:30:01 -08001126/*
1127 * Logs changes to the configuration of the device. The configuration is defined
1128 * in frameworks/base/core/java/android/content/res/Configuration.java
1129 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1130 * Please go there to interpret the possible values each field can be.
1131 *
1132 * Logged from:
1133 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1134 */
1135message ResourceConfigurationChanged {
1136 // Bit mask of color capabilities of the screen.
1137 // Contains information about the color gamut and hdr mode of the screen.
1138 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001139 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001140
1141 // The target screen density being rendered to.
1142 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001143 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001144
1145 // Current user preference for the scaling factor for fonts,
1146 // relative to the base density scaling.
1147 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001148 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001149
1150 // Flag indicating whether the hard keyboard is hidden.
1151 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001152 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001153
1154 // The type of keyboard attached to the device.
1155 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1156 optional int32 keyboard = 5;
1157
1158 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1159 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001160 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001161
1162 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1163 // 0 if undefined.
1164 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1165 optional int32 mcc = 7;
1166
1167 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1168 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1169 // MNC_ZERO symbol defined in Configuration.java.
1170 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1171 optional int32 mnc = 8;
1172
1173 // The kind of navigation available on the device.
1174 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1175 optional int32 navigation = 9;
1176
1177 // Flag indicating whether the navigation is available.
1178 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001179 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001180
1181 // Overall orientation of the screen.
1182 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1183 optional int32 orientation = 11;
1184
1185 // The current height of the available screen space, in dp units.
1186 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001187 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001188
1189 // Bit mask of overall layout of the screen.
1190 // Contains information about screen size, whether the screen is wider/taller
1191 // than normal, whether the screen layout is right-tl-left or left-to-right,
1192 // and whether the screen has a rounded shape.
1193 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001194 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001195
1196 // Current width of the available screen space, in dp units.
1197 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001198 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001199
1200 // The smallest screen size an application will see in normal operation.
1201 // This is the smallest value of both screenWidthDp and screenHeightDp
1202 // in portrait and landscape.
1203 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001204 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001205
1206 // The type of touch screen attached to the device.
1207 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1208 optional int32 touchscreen = 16;
1209
1210 // Bit mask of the ui mode.
1211 // Contains information about the overall ui mode of the device.
1212 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1213 // Also contains information about whether the device is in night mode.
1214 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001215 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001216}
1217
Tej Singheee317b2018-03-07 19:28:05 -08001218
1219/**
1220 * Logs changes in the connection state of the mobile radio.
1221 *
1222 * Logged from:
1223 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1224 */
1225message MobileConnectionStateChanged {
1226 // States are from the state machine DataConnection.java.
1227 enum State {
1228 UNKNOWN = 0;
1229 // The connection is inactive, or disconnected.
1230 INACTIVE = 1;
1231 // The connection is being activated, or connecting.
1232 ACTIVATING = 2;
1233 // The connection is active, or connected.
1234 ACTIVE = 3;
1235 // The connection is disconnecting.
1236 DISCONNECTING = 4;
1237 // The connection is disconnecting after creating a connection.
1238 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1239 }
1240 optional State state = 1;
1241 // For multi-sim phones, this distinguishes between the sim cards.
1242 optional int32 sim_slot_index = 2;
1243 // Used to identify the connection. Starts at 0 and increments by 1 for
1244 // every new network created. Resets whenever the device reboots.
1245 optional int32 data_connection_id = 3;
1246 // A bitmask for the capabilities of this connection.
1247 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1248 // Default value (if we have no information): 0
1249 optional int64 capabilities = 4;
1250 // If this connection has internet.
1251 // This just checks if the DEFAULT bit of capabilities is set.
1252 optional bool has_internet = 5;
1253}
1254
1255/**
1256 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1257 *
1258 * Logged from:
1259 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1260 */
1261message MobileRadioTechnologyChanged {
1262 optional android.telephony.NetworkTypeEnum state = 1;
1263 // For multi-sim phones, this distinguishes between the sim cards.
1264 optional int32 sim_slot_index = 2;
1265}
1266
Andrew Chantb56388b2018-03-22 21:07:33 -07001267/**
1268 * Logs the VID and PID of any connected USB devices.
1269 *
1270 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1271 *
1272 * Logged by Vendor.
1273 */
1274message UsbDeviceAttached {
1275 optional int32 vid = 1;
1276 optional int32 pid = 2;
1277 optional bool has_audio = 3;
1278 optional bool has_hid = 4;
1279 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001280 enum State {
1281 STATE_DISCONNECTED = 0;
1282 STATE_CONNECTED = 1;
1283 }
1284 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001285 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001286}
1287
Tej Singheee317b2018-03-07 19:28:05 -08001288
Tej Singhdd7bd352018-02-09 19:33:15 -08001289/**
Tej Singh5d991e12018-03-09 19:48:11 -08001290 * Logs when Bluetooth is enabled and disabled.
1291 *
1292 * Logged from:
1293 * services/core/java/com/android/server/BluetoothManagerService.java
1294 */
1295message BluetoothEnabledStateChanged {
1296 repeated AttributionNode attribution_node = 1;
1297 // Whether or not bluetooth is enabled on the device.
1298 enum State {
1299 UNKNOWN = 0;
1300 ENABLED = 1;
1301 DISABLED = 2;
1302 }
1303 optional State state = 2;
1304 // The reason for being enabled/disabled.
1305 // Eg. Airplane mode, crash, application request.
1306 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1307 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001308 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001309}
1310
1311/**
Jack Hed9837c82019-01-09 01:19:13 -08001312 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001313 *
1314 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001315 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1316 *
1317 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001318 */
1319message BluetoothConnectionStateChanged {
1320 // The state of the connection.
1321 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1322 optional android.bluetooth.ConnectionStateEnum state = 1;
1323 // An identifier that can be used to match connect and disconnect events.
1324 // Currently is last two bytes of a hash of a device level ID and
1325 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001326 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1327 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001328 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1329 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001330 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001331 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001332 // An identifier that can be used to match events for this device.
1333 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1334 // Salt: Randomly generated 256 bit value
1335 // Hash algorithm: HMAC-SHA256
1336 // Size: 32 byte
1337 // Default: null or empty if the device identifier is not known
1338 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1339}
1340
1341/**
1342 * Logs when a Bluetooth device connects and disconnects over ACL
1343 *
1344 * Logged from:
1345 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1346 *
1347 * Next Tag: 3
1348 */
1349message BluetoothAclConnectionStateChanged {
1350 // An identifier that can be used to match events for this device.
1351 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1352 // Salt: Randomly generated 256 bit value
1353 // Hash algorithm: HMAC-SHA256
1354 // Size: 32 byte
1355 // Default: null or empty if the device identifier is not known
1356 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1357 // The state of the connection.
1358 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1359 optional android.bluetooth.ConnectionStateEnum state = 2;
1360}
1361
1362/**
1363 * Logs when a Bluetooth device connects and disconnects over SCO
1364 *
1365 * Logged from:
1366 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1367 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1368 *
1369 * Next Tag: 4
1370 */
1371message BluetoothScoConnectionStateChanged {
1372 // An identifier that can be used to match events for this device.
1373 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1374 // Salt: Randomly generated 256 bit value
1375 // Hash algorithm: HMAC-SHA256
1376 // Size: 32 byte
1377 // Default: null or empty if the device identifier is not known
1378 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1379 // The state of the connection.
1380 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1381 optional android.bluetooth.ConnectionStateEnum state = 2;
1382 // Codec used for this SCO connection
1383 // Default: UNKNOWN
1384 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001385}
1386
Jack Heab86dbd22018-12-18 15:43:27 -08001387// Logs when there is an event affecting Bluetooth device's link layer connection.
1388// - This event is triggered when there is a related HCI command or event
1389// - Users of this metrics can deduce Bluetooth device's connection state from these events
1390// - HCI commands are logged before the command is sent, after receiving command status, and after
1391// receiving command complete
1392// - HCI events are logged when they arrive
1393//
1394// Low level log from system/bt
1395//
1396// Bluetooth classic commands:
1397// - CMD_CREATE_CONNECTION
1398// - CMD_DISCONNECT
1399// - CMD_CREATE_CONNECTION_CANCEL
1400// - CMD_ACCEPT_CONNECTION_REQUEST
1401// - CMD_REJECT_CONNECTION_REQUEST
1402// - CMD_SETUP_ESCO_CONNECTION
1403// - CMD_ACCEPT_ESCO_CONNECTION
1404// - CMD_REJECT_ESCO_CONNECTION
1405// - CMD_ENH_SETUP_ESCO_CONNECTION
1406// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1407//
1408// Bluetooth low energy commands:
1409// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1410// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1411// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1412// - CMD_BLE_CLEAR_WHITE_LIST
1413// - CMD_BLE_ADD_WHITE_LIST
1414// - CMD_BLE_REMOVE_WHITE_LIST
1415//
1416// Bluetooth classic events:
1417// - EVT_CONNECTION_COMP
1418// - EVT_CONNECTION_REQUEST
1419// - EVT_DISCONNECTION_COMP
1420// - EVT_ESCO_CONNECTION_COMP
1421// - EVT_ESCO_CONNECTION_CHANGED
1422//
1423// Bluetooth low energy meta events:
1424// - BLE_EVT_CONN_COMPLETE_EVT
1425// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1426//
1427// Next tag: 10
1428message BluetoothLinkLayerConnectionEvent {
1429 // An identifier that can be used to match events for this device.
1430 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1431 // Salt: Randomly generated 256 bit value
1432 // Hash algorithm: HMAC-SHA256
1433 // Size: 32 byte
1434 // Default: null or empty if the device identifier is not known
1435 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1436 // Connection handle of this connection if available
1437 // Range: 0x0000 - 0x0EFF (12 bits)
1438 // Default: 0xFFFF if the handle is unknown
1439 optional int32 connection_handle = 2;
1440 // Direction of the link
1441 // Default: DIRECTION_UNKNOWN
1442 optional android.bluetooth.DirectionEnum direction = 3;
1443 // Type of this link
1444 // Default: LINK_TYPE_UNKNOWN
1445 optional android.bluetooth.LinkTypeEnum type = 4;
1446
1447 // Reason metadata for this link layer connection event, rules for interpretation:
1448 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1449 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1450 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1451 // set and valid, ignore hci_ble_event
1452
1453 // HCI command associated with this event
1454 // Default: CMD_UNKNOWN
1455 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1456 // HCI event associated with this event
1457 // Default: EVT_UNKNOWN
1458 optional android.bluetooth.hci.EventEnum hci_event = 6;
1459 // HCI BLE meta event associated with this event
1460 // Default: BLE_EVT_UNKNOWN
1461 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1462 // HCI command status code if this is triggerred by hci_cmd
1463 // Default: STATUS_UNKNOWN
1464 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1465 // HCI reason code associated with this event
1466 // Default: STATUS_UNKNOWN
1467 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1468}
1469
1470
Tej Singh5d991e12018-03-09 19:48:11 -08001471/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001472 * Logs when something is plugged into or removed from the USB-C connector.
1473 *
1474 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001475 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08001476 */
1477message UsbConnectorStateChanged {
1478 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001479 STATE_DISCONNECTED = 0;
1480 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08001481 }
1482 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001483 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08001484 // Last active session in ms.
1485 // 0 when the port is in connected state.
1486 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001487}
1488
1489/**
1490 * Logs the reported speaker impedance.
1491 *
1492 * Logged from:
1493 * Vendor audio implementation.
1494 */
1495message SpeakerImpedanceReported {
1496 optional int32 speaker_location = 1;
1497 optional int32 impedance = 2;
1498}
1499
1500/**
1501 * Logs the report of a failed hardware.
1502 *
1503 * Logged from:
1504 * Vendor HALs.
1505 *
1506 */
1507message HardwareFailed {
1508 enum HardwareType {
1509 HARDWARE_FAILED_UNKNOWN = 0;
1510 HARDWARE_FAILED_MICROPHONE = 1;
1511 HARDWARE_FAILED_CODEC = 2;
1512 HARDWARE_FAILED_SPEAKER = 3;
1513 HARDWARE_FAILED_FINGERPRINT = 4;
1514 }
1515 optional HardwareType hardware_type = 1;
1516
1517 /* hardware_location allows vendors to differentiate between multiple instances of
1518 * the same hardware_type. The specific locations are vendor defined integers,
1519 * referring to board-specific numbering schemes.
1520 */
1521 optional int32 hardware_location = 2;
1522
1523 /* failure_code is specific to the HardwareType of the failed hardware.
1524 * It should use the enum values defined below.
1525 */
1526 enum MicrophoneFailureCode {
1527 MICROPHONE_FAILURE_COMPLETE = 0;
1528 }
1529 enum CodecFailureCode {
1530 CODEC_FAILURE_COMPLETE = 0;
1531 }
1532 enum SpeakerFailureCode {
1533 SPEAKER_FAILURE_COMPLETE = 0;
1534 SPEAKER_FAILURE_HIGH_Z = 1;
1535 SPEAKER_FAILURE_SHORT = 2;
1536 }
1537 enum FingerprintFailureCode {
1538 FINGERPRINT_FAILURE_COMPLETE = 0;
1539 FINGERPRINT_SENSOR_BROKEN = 1;
1540 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1541 }
1542 optional int32 failure_code = 3;
1543}
1544
1545/**
1546 * Log an event when the device has been physically dropped.
1547 * Reported from the /vendor partition.
1548 */
1549message PhysicalDropDetected {
1550 // Confidence that the event was actually a drop, 0 -> 100
1551 optional int32 confidence_pctg = 1;
1552 // Peak acceleration of the drop, in 1/1000s of a g.
1553 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001554 // Duration of freefall in ms
1555 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001556}
1557
1558/**
1559 * Log bucketed battery charge cycles.
1560 *
1561 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08001562 * a given charge point. For example, if 10 cycle buckets are
1563 * initialized, bucket 1 is the lowest 1/10th of the battery,
1564 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08001565 *
1566 * Logged from:
1567 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1568 */
1569message ChargeCyclesReported {
1570 optional int32 cycle_bucket_1 = 1;
1571 optional int32 cycle_bucket_2 = 2;
1572 optional int32 cycle_bucket_3 = 3;
1573 optional int32 cycle_bucket_4 = 4;
1574 optional int32 cycle_bucket_5 = 5;
1575 optional int32 cycle_bucket_6 = 6;
1576 optional int32 cycle_bucket_7 = 7;
1577 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08001578 optional int32 cycle_bucket_9 = 9;
1579 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08001580}
1581
1582/**
Howard Roa46b6582018-09-18 16:45:02 -07001583 * Log battery health snapshot.
1584 *
1585 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1586 * are snapshotted periodically over 24hrs.
1587 */
1588message BatteryHealthSnapshot {
1589 enum BatterySnapshotType {
1590 UNKNOWN = 0;
1591 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1592 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1593 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1594 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1595 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1596 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1597 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1598 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1599 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1600 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1601 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1602 }
1603 optional BatterySnapshotType type = 1;
1604 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001605 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001606 // Voltage Battery Voltage, in microVolts.
1607 optional int32 voltage_micro_volt = 3;
1608 // Current Battery current, in microAmps.
1609 optional int32 current_micro_amps = 4;
1610 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1611 optional int32 open_circuit_micro_volt = 5;
1612 // Resistance Battery Resistance, in microOhms.
1613 optional int32 resistance_micro_ohm = 6;
1614 // Level Battery Level, as % of full.
1615 optional int32 level_percent = 7;
1616}
1617
1618/**
1619 * Log slow I/O operations on the primary storage.
1620 */
1621message SlowIo {
1622 // Classifications of IO Operations.
1623 enum IoOperation {
1624 UNKNOWN = 0;
1625 READ = 1;
1626 WRITE = 2;
1627 UNMAP = 3;
1628 SYNC = 4;
1629 }
1630 optional IoOperation operation = 1;
1631
1632 // The number of slow IO operations of this type over 24 hours.
1633 optional int32 count = 2;
1634}
1635
1636/**
1637 * Log battery caused shutdown with the last recorded voltage.
1638 */
1639message BatteryCausedShutdown {
1640 // The last recorded battery voltage prior to shutdown.
1641 optional int32 last_recorded_micro_volt = 1;
1642}
1643
1644/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001645 * Logs the duration of a davey (jank of >=700ms) when it occurs
1646 *
1647 * Logged from:
1648 * frameworks/base/libs/hwui/JankTracker.cpp
1649 */
1650message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001651 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001652 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001653
Tej Singhbb8554a2018-01-26 11:59:14 -08001654 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001655 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001656}
1657
1658/**
Bookatze5885242017-10-24 20:10:31 -07001659 * Logs phone signal strength changes.
1660 *
1661 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001662 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001663 */
1664message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001665 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1666 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001667}
1668
Yangster4ccebea2018-10-09 17:09:02 -07001669
1670/**
1671 * Logs when the phone state, sim state or signal strength changes
1672 *
1673 * Logged from:
1674 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1675 */
1676message PhoneServiceStateChanged {
1677 optional android.telephony.ServiceStateEnum state = 1;
1678 optional android.telephony.SimStateEnum sim_state = 2;
1679 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1680}
1681
1682/**
1683 * Logs when the phone becomes on or off.
1684 *
1685 * Logged from:
1686 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1687 */
1688message PhoneStateChanged {
1689 enum State {
1690 OFF = 0;
1691 ON = 1;
1692 }
1693 optional State state = 1;
1694}
1695
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001696message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07001697 optional android.stats.launcher.LauncherAction action = 1;
1698 optional android.stats.launcher.LauncherState src_state = 2;
1699 optional android.stats.launcher.LauncherState dst_state = 3;
1700 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001701 optional bool is_swipe_up_enabled = 5;
1702}
1703
David Chenc28b2bb2017-10-24 12:52:52 -07001704/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001705 * Logs when Settings UI has changed.
1706 *
1707 * Logged from:
1708 * packages/apps/Settings
1709 */
1710message SettingsUIChanged {
1711 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001712 * Where this SettingsUIChange event comes from. For example, if
1713 * it's a PAGE_VISIBLE event, where the page is opened from.
1714 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001715 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001716
1717 /**
1718 * What the UI action is.
1719 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001720 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001721
1722 /**
1723 * Where the action is happening
1724 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001725 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001726
1727 /**
1728 * What preference changed in this event.
1729 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001730 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07001731
1732 /**
1733 * The new value of the changed preference.
1734 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001735 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07001736}
1737
1738/**
David Chenc28b2bb2017-10-24 12:52:52 -07001739 * Logs that a setting was updated.
1740 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001741 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001742 * The tag and is_default allow resetting of settings to default values based on the specified
1743 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1744 */
1745message SettingChanged {
1746 // The name of the setting.
1747 optional string setting = 1;
1748
1749 // The change being imposed on this setting. May represent a number, eg "3".
1750 optional string value = 2;
1751
1752 // The new value of this setting. For most settings, this is same as value. For some settings,
1753 // value is +X or -X where X represents an element in a set. For example, if the previous value
1754 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1755 // The +/- feature is currently only used for location_providers_allowed.
1756 optional string new_value = 3;
1757
1758 // The previous value of this setting.
1759 optional string prev_value = 4;
1760
1761 // The tag used with the is_default for resetting sets of settings. This is generally null.
1762 optional string tag = 5;
1763
Bookatz90867622018-01-31 15:05:57 -08001764 // True if this setting with tag should be resettable.
1765 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001766
David Chenbd789912018-03-16 17:19:55 -07001767 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001768 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001769
1770 enum ChangeReason {
1771 UPDATED = 1; // Updated can be an insertion or an update.
1772 DELETED = 2;
1773 }
1774 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001775}
Chenjie Yub3dda412017-10-24 13:41:59 -07001776
Chenjie Yu05013b32017-11-21 10:21:41 -08001777/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001778 * Logs activity going to foreground or background
1779 *
1780 * Logged from:
1781 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1782 */
1783message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001784 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001785 optional string pkg_name = 2;
1786 optional string class_name = 3;
1787
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001788 enum State {
1789 BACKGROUND = 0;
1790 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001791 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001792 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001793}
David Chenc8a43242017-10-17 16:23:28 -07001794
1795/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00001796 * Logs when a volume entered low Storage state.
1797 * Logged from:
1798 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
1799 */
1800message LowStorageStateChanged {
1801 // Volume that ran out of storage.
1802 optional string volume_description = 1;
1803
1804 enum State {
1805 UNKNOWN = 0;
1806 OFF = 1;
1807 ON = 2;
1808 }
1809 optional State state = 2;
1810}
1811
1812/**
1813 * Logs when an app is downgraded.
1814 * Logged from:
1815 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
1816 */
1817message AppDowngraded {
1818 optional string package_name = 1;
1819 // Size of the package (all data) before being downgraded.
1820 optional int64 size_in_bytes_before = 2;
1821 // Size of the package (all data) after being downgraded.
1822 optional int64 size_in_bytes_after = 3;
1823
1824 optional bool aggressive = 4;
1825}
1826
1827/**
1828 * Logs when an app is optimized after being downgraded.
1829 * Logged from:
1830 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
1831 */
1832message AppOptimizedAfterDowngraded {
1833 optional string package_name = 1;
1834}
1835
1836/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001837 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001838 * Logged from:
1839 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1840 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001841message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001842 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001843
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001844 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001845
1846 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001847 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001848 optional string process_name = 3;
1849
1850 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001851 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001852
1853 optional string package_name = 5;
1854
1855 enum InstantApp {
1856 UNAVAILABLE = 0;
1857 FALSE = 1;
1858 TRUE = 2;
1859 }
1860 optional InstantApp is_instant_app = 6;
1861
1862 enum ForegroundState {
1863 UNKNOWN = 0;
1864 BACKGROUND = 1;
1865 FOREGROUND = 2;
1866 }
1867 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08001868
1869 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001870}
David Chen9e3808c2017-11-20 17:25:34 -08001871
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001872/**
1873 * Logs when a WTF (What a Terrible Failure) happened.
1874 * Logged from:
1875 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1876 */
1877message WTFOccurred {
1878 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 tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001881
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001882 // The name of the process.
1883 // system_server if it is not by an app
1884 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001885
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001886 // The pid if available. -1 means not available.
1887 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08001888
1889 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001890}
1891
1892/**
1893 * Logs when system server reports low memory.
1894 * Logged from:
1895 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1896 */
1897message LowMemReported {
1898}
1899
1900/**
1901 * Logs when an app ANR (App Not Responding) occurs.
1902 * Logged from:
1903 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1904 */
1905message ANROccurred {
1906 optional int32 uid = 1 [(is_uid) = true];
1907
1908 optional string process_name = 2;
1909
1910 optional string short_component_name = 3;
1911
1912 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001913
1914 enum InstantApp {
1915 UNAVAILABLE = 0;
1916 FALSE = 1;
1917 TRUE = 2;
1918 }
1919 optional InstantApp is_instant_app = 5;
1920
1921 enum ForegroundState {
1922 UNKNOWN = 0;
1923 BACKGROUND = 1;
1924 FOREGROUND = 2;
1925 }
1926 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08001927
1928 optional android.server.ErrorSource error_source = 7;
1929
1930 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08001931}
1932
Bookatza7020bd2018-08-28 16:29:35 -07001933/**
1934 * Logs when the vibrator state changes.
1935 * Logged from:
1936 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1937 */
1938message VibratorStateChanged {
1939 repeated AttributionNode attribution_node = 1;
1940
1941 enum State {
1942 OFF = 0;
1943 ON = 1;
1944 }
1945 optional State state = 2;
1946
1947 // Duration (in milliseconds) requested to keep the vibrator on.
1948 // Only applicable for State == ON.
1949 optional int64 duration_millis = 3;
1950}
1951
David Chen0a368b22017-12-06 16:28:16 -08001952/*
1953 * Allows other apps to push events into statsd.
1954 * Logged from:
1955 * frameworks/base/core/java/android/util/StatsLog.java
1956 */
David Chen0b5c90c2018-01-25 16:51:49 -08001957message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001958 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001959 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001960
1961 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1962 optional int32 label = 2;
1963
1964 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1965 // predicates for the metrics).
1966 enum State {
1967 UNKNOWN = 0;
1968 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1969 STOP = 2;
1970 START = 3;
1971 }
1972 optional State state = 3;
1973}
1974
David Chen9e3808c2017-11-20 17:25:34 -08001975/**
Bookatz7948c872018-09-04 12:58:33 -07001976 * Logs the wall-clock time when a significant wall-clock time shift occurs.
1977 * For example, this could be due to the user manually changing the time.
1978 *
1979 * Logged from:
1980 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
1981 */
1982message WallClockTimeShifted {
1983 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
1984 optional int64 wall_clock_timestamp_millis = 1;
1985}
1986
1987/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001988 * Logs when statsd detects an anomaly.
1989 *
1990 * Logged from:
1991 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1992 */
1993message AnomalyDetected {
1994 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001995 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001996
Yangster-mac94e197c2018-01-02 16:03:03 -08001997 // Id of the config whose anomaly detection alert fired.
1998 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001999
Yangster-mac94e197c2018-01-02 16:03:03 -08002000 // Id of the alert (i.e. name of the anomaly that was detected).
2001 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002002}
2003
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002004message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002005 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002006 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002007
2008 // The app package name.
2009 optional string pkg_name = 2;
2010
2011 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002012 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002013 WARM = 1;
2014 HOT = 2;
2015 COLD = 3;
2016 }
2017 // The transition type.
2018 optional TransitionType type = 3;
2019
2020 // The activity name.
2021 optional string activity_name = 4;
2022
2023 // The name of the calling app. Empty if not set.
2024 optional string calling_pkg_name = 5;
2025
2026 // Whether the app is an instant app.
2027 optional bool is_instant_app = 6;
2028
2029 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002030 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002031
Bookatz80d11a02018-01-16 10:46:35 -08002032 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002033
David Chen0b5c90c2018-01-25 16:51:49 -08002034 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002035 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002036 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002037 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002038 optional int32 bind_application_delay_millis = 11;
2039 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002040
2041 // Empty if not set.
2042 optional string launch_token = 13;
2043
Calin Juravle759fbda2018-02-20 19:52:30 +00002044 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002045 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002046
2047 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002048 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002049}
2050
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002051message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002052 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002053 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002054
2055 // The app package name.
2056 optional string pkg_name = 2;
2057
2058 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002059 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002060 WARM = 1;
2061 HOT = 2;
2062 COLD = 3;
2063 }
2064 // The transition type.
2065 optional TransitionType type = 3;
2066
2067 // The activity name.
2068 optional string activity_name = 4;
2069}
2070
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002071message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002072 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002073 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002074
2075 // The app package name.
2076 optional string pkg_name = 2;
2077
2078 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002079 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002080 WITH_BUNDLE = 1;
2081 WITHOUT_BUNDLE = 2;
2082 }
2083 // The transition type.
2084 optional TransitionType type = 3;
2085
2086 // The activity name.
2087 optional string activity_name = 4;
2088
2089 optional bool transition_process_running = 5;
2090
2091 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002092 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002093}
2094
Bookatz8fcd09a2017-12-18 13:01:10 -08002095/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002096 * Logs a picture-in-picture action
2097 * Logged from:
2098 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2099 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2100 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2101 */
2102message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002103 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002104 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002105
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002106 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002107
Chenjie Yu52cacc62017-12-08 18:11:45 -08002108 enum State {
2109 ENTERED = 1;
2110 EXPANDED_TO_FULL_SCREEN = 2;
2111 MINIMIZED = 3;
2112 DISMISSED = 4;
2113 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002114 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002115}
2116
2117/**
Chenjie Yue8904192017-12-08 19:12:57 -08002118 * Logs overlay action
2119 * Logged from:
2120 * services/core/java/com/android/server/wm/Session.java
2121 */
2122message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002123 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002124
2125 optional string package_name = 2;
2126
2127 optional bool using_alert_window = 3;
2128
2129 enum State {
2130 ENTERED = 1;
2131 EXITED = 2;
2132 }
2133 optional State state = 4;
2134}
2135
Chenjie Yuccfe6452018-01-30 11:33:21 -08002136/*
2137 * Logs foreground service starts and stops.
2138 * Note that this is not when a service starts or stops, but when it is
2139 * considered foreground.
2140 * Logged from
2141 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2142 */
2143message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002144 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002145 // package_name + "/" + class_name
2146 optional string short_name = 2;
2147
2148 enum State {
2149 ENTER = 1;
2150 EXIT = 2;
2151 }
2152 optional State state = 3;
2153}
2154
Chenjie Yue8904192017-12-08 19:12:57 -08002155/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002156 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2157 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2158 * attributed back to the parent (host) uid. One example is Chrome.
2159 *
2160 * Logged from:
2161 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2162 */
2163message IsolatedUidChanged {
2164 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002165 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002166 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002167 optional int32 parent_uid = 1;
2168
2169 optional int32 isolated_uid = 2;
2170
2171 // We expect an isolated uid to be removed before if it's used for another parent uid.
2172 enum Event {
2173 REMOVED = 0;
2174 CREATED = 1;
2175 }
2176 optional Event event = 3;
2177}
2178
2179/*
2180 * Logs the reception of an incoming network packet causing the main system to wake up for
2181 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2182 * and processed by WakeupController.cpp.
2183 */
2184message PacketWakeupOccurred {
2185 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2186 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002187 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002188 // The interface name on which the packet was received.
2189 optional string iface = 2;
2190 // The ethertype value of the packet.
2191 optional int32 ethertype = 3;
2192 // String representation of the destination MAC address of the packet.
2193 optional string destination_hardware_address = 4;
2194 // String representation of the source address of the packet if this was an IP packet.
2195 optional string source_ip = 5;
2196 // String representation of the destination address of the packet if this was an IP packet.
2197 optional string destination_ip = 6;
2198 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2199 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2200 // families.
2201 optional int32 ip_next_header = 7;
2202 // The source port if this was a TCP or UDP packet.
2203 optional int32 source_port = 8;
2204 // The destination port if this was a TCP or UDP packet.
2205 optional int32 destination_port = 9;
2206}
2207
2208/*
2209 * Logs the memory stats for an app on startup.
2210 * Logged from:
2211 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2212 */
2213message AppStartMemoryStateCaptured {
2214 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002215 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002216
2217 // The process name.
2218 optional string process_name = 2;
2219
2220 // The activity name.
2221 optional string activity_name = 3;
2222
2223 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002224 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002225
2226 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002227 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002228
2229 // RSS
2230 optional int64 rss_in_bytes = 6;
2231
2232 // CACHE
2233 optional int64 cache_in_bytes = 7;
2234
2235 // SWAP
2236 optional int64 swap_in_bytes = 8;
2237}
2238
2239/*
2240 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2241 * for LMK event.
2242 * Logged from:
2243 * system/core/lmkd/lmkd.c
2244 */
2245message LmkStateChanged {
2246 enum State {
2247 UNKNOWN = 0;
2248 START = 1;
2249 STOP = 2;
2250 }
2251 optional State state = 1;
2252}
2253
2254/*
2255 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2256 * Logged from:
2257 * system/core/lmkd/lmkd.c
2258 */
2259message LmkKillOccurred {
2260 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002261 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002262
2263 // The process name.
2264 optional string process_name = 2;
2265
2266 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002267 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002268
2269 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002270 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002271
2272 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002273 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002274
2275 // RSS
2276 optional int64 rss_in_bytes = 6;
2277
2278 // CACHE
2279 optional int64 cache_in_bytes = 7;
2280
2281 // SWAP
2282 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002283
2284 // The elapsed real time of start of the process.
2285 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002286}
2287
Rajeev Kumar51b54602018-03-01 12:18:26 -08002288/*
2289 * Logs when the ActivityManagerService detects that an app died.
2290 *
2291 * Logged from:
2292 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2293 */
2294message AppDied {
2295 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002296 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002297}
2298
Howard Ro21a039c2018-08-06 14:55:47 -07002299/**
2300 * An atom for generic metrics logging. Available from Android Q.
2301 */
2302message GenericAtom {
2303 // The uid of the application that sent this custom atom.
2304 optional int32 uid = 1 [(is_uid) = true];
2305
2306 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002307 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002308}
2309
Tej Singhd6d6d772018-09-05 17:41:25 -07002310/**
2311 * Logs when a fingerprint acquire event occurs.
2312 *
2313 * Logged from:
2314 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2315 */
2316message FingerprintAcquired {
2317 // The associated user. Eg: 0 for owners, 10+ for others.
2318 // Defined in android/os/UserHandle.java
2319 optional int32 user = 1;
2320 // If this acquire is for a crypto fingerprint.
2321 // e.g. Secure purchases, unlock password storage.
2322 optional bool is_crypto = 2;
2323}
2324
2325/**
2326 * Logs when a fingerprint authentication event occurs.
2327 *
2328 * Logged from:
2329 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2330 */
2331message FingerprintAuthenticated {
2332 // The associated user. Eg: 0 for owners, 10+ for others.
2333 // Defined in android/os/UserHandle.java
2334 optional int32 user = 1;
2335 // If this authentication is for a crypto fingerprint.
2336 // e.g. Secure purchases, unlock password storage.
2337 optional bool is_crypto = 2;
2338 // Whether or not this authentication was successful.
2339 optional bool is_authenticated = 3;
2340}
2341
2342/**
2343 * Logs when a fingerprint error occurs.
2344 *
2345 * Logged from:
2346 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2347 */
2348message FingerprintErrorOccurred {
2349 // The associated user. Eg: 0 for owners, 10+ for others.
2350 // Defined in android/os/UserHandle.java
2351 optional int32 user = 1;
2352 // If this error is for a crypto fingerprint.
2353 // e.g. Secure purchases, unlock password storage.
2354 optional bool is_crypto = 2;
2355
2356 enum Error {
2357 UNKNOWN = 0;
2358 LOCKOUT = 1;
2359 PERMANENT_LOCKOUT = 2;
2360 }
2361 // The type of error.
2362 optional Error error = 3;
2363}
Howard Ro688ae182018-09-25 00:09:36 -07002364
2365message Notification {
2366
2367 // Type of notification event.
2368 enum Type {
2369 TYPE_UNKNOWN = 0;
2370 // Notification became visible to the user.
2371 TYPE_OPEN = 1;
2372 // Notification became hidden.
2373 TYPE_CLOSE = 2;
2374 // Notification switched to detail mode.
2375 TYPE_DETAIL = 3;
2376 // Notification was clicked.
2377 TYPE_ACTION = 4;
2378 // Notification was dismissed.
2379 TYPE_DISMISS = 5;
2380 // Notification switched to summary mode. The enum value of 14 is to
2381 // match that of metrics_constants.
2382 TYPE_COLLAPSE = 14;
2383 }
2384 optional Type type = 1;
2385
2386 // Package name associated with the notification.
2387 optional string package_name = 2;
2388
2389 // Tag associated with notification.
2390 optional string tag = 3;
2391
2392 // Application-supplied ID associated with the notification.
2393 optional int32 id = 4;
2394
2395 // Index of notification in the notification panel.
2396 optional int32 shade_index = 5;
2397
2398 // The number of notifications in the notification panel.
2399 optional int32 shade_count = 6;
2400
2401 // Importance for the notification.
2402 optional int32 importance = 7;
2403
2404 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002405 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002406
2407 // Importance for the notification channel.
2408 optional int32 channel_importance = 9;
2409
Howard Ro183c2bd2018-10-18 13:52:10 -07002410 // Application-supplied ID associated with the notifications group.
2411 optional string group_id = 10;
2412
Howard Ro688ae182018-09-25 00:09:36 -07002413 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002414 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002415
Howard Ro183c2bd2018-10-18 13:52:10 -07002416 // Reason for dismissal of a notification. This field is only meaningful for
2417 // TYPE_DISMISS events.
2418 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002419
Howard Ro183c2bd2018-10-18 13:52:10 -07002420 // The first post time of notification, stable across updates.
2421 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002422
Howard Ro183c2bd2018-10-18 13:52:10 -07002423 // The most recent interruption time, or the creation time if no updates.
2424 // Differs from update_millis because updates are filtered based on whether
2425 // they actually interrupted the user.
2426 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002427
Howard Ro183c2bd2018-10-18 13:52:10 -07002428 // The most recent update time, or the creation time if no updates.
2429 optional int64 update_millis = 15;
2430
2431 // The most recent visibility event.
2432 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002433}
2434
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002435/*
Yangster-macb89807e2018-11-15 21:10:57 -08002436 * Logs when a flag flip state changes.
2437 * Logged in P/h.
2438 */
2439message PhenotypeFlagStateChanged {
2440 // Mendel configuration name.
2441 optional string mendel_config_name = 1;
2442 // State
2443 enum State {
2444 STATE_UNKNOWN = 0;
2445 COMMITTED = 1;
2446 }
2447 optional State state = 2;
2448}
2449
2450/*
2451 * Logs when a binary push state changes.
2452 * Logged in Play store
2453 */
2454message BinaryPushStateChanged {
2455 // Binary package name.
2456 optional string binary_name = 1;
2457 // Version code.
2458 optional int64 version = 2;
2459 // State
2460 enum State {
2461 STATE_UNKNOWN = 0;
2462 DOWNLOAD_START = 1;
2463 DOWNLOAD_DONE = 2;
2464 INSTALL_START = 3;
2465 INSTALL_DONE = 4;
2466 REBOOT_START = 5;
2467 REBOOT_DONE = 6;
2468 }
2469 optional State state = 3;
2470}
2471
Maggie Whitefc1aa592018-11-28 21:55:23 -08002472/** Represents USB port overheat event. */
2473message UsbPortOverheatEvent {
2474 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
2475 optional int32 plug_temperature_deci_c = 1;
2476
2477 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
2478 optional int32 max_temperature_deci_c = 2;
2479
2480 /* Time between USB plug event and overheat threshold trip, in seconds. */
2481 optional int32 time_to_overheat_secs = 3;
2482
2483 /* Time between overheat threshold trip and hysteresis, in seconds. */
2484 optional int32 time_to_hysteresis_secs = 4;
2485
2486 /* Time between hysteresis and active mitigation ending, in seconds. */
2487 optional int32 time_to_inactive_secs = 5;
2488};
2489
Yangster-macb89807e2018-11-15 21:10:57 -08002490/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002491 * Logs when a connection becomes available and lost.
2492 * Logged in StatsCompanionService.java
2493 */
2494message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002495 // Id of the network.
2496 optional int32 net_id = 1;
2497
2498 enum State {
2499 UNKNOWN = 0;
2500 CONNECTED = 1;
2501 DISCONNECTED = 2;
2502 }
2503 // Connected state of a network.
2504 optional State state = 2;
2505}
2506
2507/**
2508 * Logs when a service starts and stops.
2509 * Logged from:
2510 * services/core/java/com/android/server/am/ActiveServices.java
2511 */
2512message ServiceStateChanged {
2513
2514 optional int32 uid = 1 [(is_uid) = true];
2515
2516 optional string package_name = 2;
2517
2518 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002519
2520 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002521 START = 1;
2522 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002523 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07002524
2525 optional State state = 4;
2526}
2527
2528/**
2529 * Logs when a service is launched.
2530 * Logged from:
2531 * services/core/java/com/android/server/am/ActiveServices.java
2532 */
2533message ServiceLaunchReported {
2534
2535 optional int32 uid = 1 [(is_uid) = true];
2536
2537 optional string package_name = 2;
2538
2539 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002540}
Howard Ro688ae182018-09-25 00:09:36 -07002541
Chenjie Yubbcbc602018-02-05 16:51:52 -08002542//////////////////////////////////////////////////////////////////////
2543// Pulled atoms below this line //
2544//////////////////////////////////////////////////////////////////////
2545
2546/**
David Chenc8a43242017-10-17 16:23:28 -07002547 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2548 *
2549 * Pulled from:
2550 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2551 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002552message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002553 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002554
2555 optional int64 rx_bytes = 2;
2556
2557 optional int64 rx_packets = 3;
2558
2559 optional int64 tx_bytes = 4;
2560
2561 optional int64 tx_packets = 5;
2562}
2563
2564/**
2565 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2566 *
2567 * Pulled from:
2568 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2569 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002570message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002571 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002572
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002573 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2574 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002575
2576 optional int64 rx_bytes = 3;
2577
2578 optional int64 rx_packets = 4;
2579
2580 optional int64 tx_bytes = 5;
2581
2582 optional int64 tx_packets = 6;
2583}
2584
2585/**
2586 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2587 *
2588 * Pulled from:
2589 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2590 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002591message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002592 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002593
2594 optional int64 rx_bytes = 2;
2595
2596 optional int64 rx_packets = 3;
2597
2598 optional int64 tx_bytes = 4;
2599
2600 optional int64 tx_packets = 5;
2601}
2602
2603/**
2604 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2605 *
2606 * Pulled from:
2607 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2608 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002609message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002610 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002611
Yao Chenc40a19d2018-03-15 16:48:25 -07002612 // 1 denotes foreground and 0 denotes background. This is called Set in
2613 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002614 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002615
2616 optional int64 rx_bytes = 3;
2617
2618 optional int64 rx_packets = 4;
2619
2620 optional int64 tx_bytes = 5;
2621
2622 optional int64 tx_packets = 6;
2623}
2624
2625/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002626 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2627 *
2628 * Pulled from:
2629 * StatsCompanionService
2630 */
2631message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002632 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002633
2634 optional int64 rx_bytes = 2;
2635
2636 optional int64 tx_bytes = 3;
2637}
2638
2639/**
David Chenc8a43242017-10-17 16:23:28 -07002640 * Pulls the kernel wakelock durations. This atom is adapted from
2641 * android/internal/os/KernelWakelockStats.java
2642 *
2643 * Pulled from:
2644 * StatsCompanionService using KernelWakelockReader.
2645 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002646message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002647 optional string name = 1;
2648
2649 optional int32 count = 2;
2650
2651 optional int32 version = 3;
2652
Yangster-maca8a30442018-10-13 23:46:34 -07002653 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002654}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002655
Chenjie Yu05013b32017-11-21 10:21:41 -08002656/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002657 * Pulls low power state information. If power.stats HAL is not available, this
2658 * includes platform and subsystem sleep state information,
2659 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
2660 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002661 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002662 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002663 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
2664 * as defined in:
2665 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002666 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002667message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002668 // Subsystem name
2669 optional string subsystem_name = 1;
2670 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2671 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002672 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
2673 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002674 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002675 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002676 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002677 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002678 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002679}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002680
Chenjie Yu05013b32017-11-21 10:21:41 -08002681/**
Bookatz92da2832018-11-01 18:10:03 -07002682 * Pulls on-device power measurement information.
2683 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
2684 * Pulled from:
2685 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
2686 */
2687message OnDevicePowerMeasurement {
2688 // Name of the subsystem (to which the rail belongs).
2689 optional string subsystem_name = 1;
2690
2691 // Rail name. The rail lies within the subsystem.
2692 optional string rail_name = 2;
2693
2694 // Time (in ms since boot) at which the rail energy value was measured.
2695 // This may differ slightly from the time that statsd logs this information.
2696 optional uint64 measurement_timestamp_millis = 3;
2697
2698 // Accumulated energy used via the rail since device boot in uWs.
2699 optional uint64 energy_microwatt_secs = 4;
2700}
2701
2702/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002703 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002704 * Pulls the time the cpu spend on the frequency index. Frequency index
2705 * starts from highest to lowest. The value should be monotonically
2706 * increasing since boot. However, if there is a cpu
2707 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002708 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002709message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002710 optional uint32 cluster = 1;
2711 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002712 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002713}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002714
Chenjie Yu05013b32017-11-21 10:21:41 -08002715/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002716 * Pulls Cpu Time Per Uid.
2717 * Note that isolated process uid time should be attributed to host uids.
2718 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002719message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002720 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002721 optional uint64 user_time_micros = 2;
2722 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002723}
2724
2725/**
2726 * Pulls Cpu Time Per Uid per frequency.
2727 * Note that isolated process uid time should be attributed to host uids.
2728 * For each uid, we order the time by descending frequencies.
2729 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002730message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002731 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002732 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002733 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002734}
Hugo Benichi884970e2017-11-14 22:42:46 +09002735
Chenjie Yu05013b32017-11-21 10:21:41 -08002736/**
2737 * Pulls Wifi Controller Activity Energy Info
2738 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002739message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002740 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002741 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002742 // stack reported state
2743 // TODO: replace this with proto enum
2744 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002745 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002746 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002747 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002748 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002749 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002750 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002751 // product of current(mA), voltage(V) and time(ms)
2752 optional uint64 controller_energy_used = 6;
2753}
2754
2755/**
2756 * Pulls Modem Activity Energy Info
2757 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002758message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002759 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002760 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002761 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002762 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002763 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002764 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002765 /**
2766 * Tx power index
2767 * index 0 = tx_power < 0dBm
2768 * index 1 = 0dBm < tx_power < 5dBm
2769 * index 2 = 5dBm < tx_power < 15dBm
2770 * index 3 = 15dBm < tx_power < 20dBm
2771 * index 4 = tx_power > 20dBm
2772 */
2773 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002774 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002775 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002776 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002777 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002778 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002779 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002780 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002781 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002782 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002783 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002784 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002785 // product of current(mA), voltage(V) and time(ms)
2786 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002787}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002788
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002789/**
2790 * Pulls Bluetooth Activity Energy Info
2791 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2792 */
2793message BluetoothActivityInfo {
2794 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002795 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002796 // bluetooth stack state
2797 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002798 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002799 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002800 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002801 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002802 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002803 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002804 // product of current(mA), voltage(V) and time(ms)
2805 optional uint64 energy_used = 6;
2806}
2807
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002808/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002809 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002810 *
2811 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002812 */
2813message ProcessMemoryState {
2814 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002815 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002816
2817 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002818 // Usually package name, "system" for system server.
2819 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002820 optional string process_name = 2;
2821
Rafal Slawikda51b932018-12-13 16:31:33 +00002822 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07002823 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002824
2825 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002826 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002827
2828 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002829 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002830
Rajeev Kumar90235992018-01-29 11:06:48 -08002831 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002832 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
2833 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08002834 optional int64 rss_in_bytes = 6;
2835
2836 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00002837 // Value is read from memory.stat, field total_cache if per-app memory
2838 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002839 optional int64 cache_in_bytes = 7;
2840
2841 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00002842 // Value is read from memory.stat, field total_swap if per-app memory
2843 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002844 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002845
Rafal Slawikd03ae422018-11-20 11:27:45 +00002846 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002847 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00002848
2849 // Elapsed real time when the process started.
2850 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
2851 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002852}
2853
2854/*
Rafal Slawik08621582018-10-15 14:53:07 +01002855 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00002856 *
2857 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01002858 */
2859message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01002860 // The uid if available. -1 means not available.
2861 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01002862
Rafal Slawikbf67d072018-10-23 11:07:54 +01002863 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002864 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002865 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01002866
Rafal Slawikbf67d072018-10-23 11:07:54 +01002867 // # of page-faults
2868 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002869
Rafal Slawikbf67d072018-10-23 11:07:54 +01002870 // # of major page-faults
2871 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002872
Rafal Slawikbf67d072018-10-23 11:07:54 +01002873 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002874 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002875 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01002876
Rafal Slawikd03ae422018-11-20 11:27:45 +00002877 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002878 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01002879
2880 // Elapsed real time when the process started.
2881 // Value is read from /proc/PID/stat, field 22.
2882 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01002883}
2884
2885/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00002886 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002887 *
2888 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
2889 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00002890 *
2891 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002892 */
2893message ProcessMemoryHighWaterMark {
2894 // The uid if available. -1 means not available.
2895 optional int32 uid = 1 [(is_uid) = true];
2896
Rafal Slawikda51b932018-12-13 16:31:33 +00002897 // The process name.
2898 // Usually package name or process cmdline.
2899 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002900 optional string process_name = 2;
2901
2902 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
2903 // /proc/PID/status.
2904 optional int64 rss_high_water_mark_in_bytes = 3;
2905}
2906
2907/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002908 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002909 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002910message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002911 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002912}
2913
2914/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002915 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002916 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002917message SystemUptime {
2918 // Milliseconds since the system was booted.
2919 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2920 // for external input).
2921 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002922 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002923}
2924
2925/*
2926 * Reads from /proc/uid_concurrent_active_time which has the format:
2927 * active: X (X is # cores)
2928 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2929 * [uid1]: [time-0] [time-1] [time-2] ... ...
2930 * ...
2931 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2932 * The file contains a monotonically increasing count of time for a single boot.
2933 */
2934message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002935 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002936 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002937}
2938
2939/**
2940 * Reads from /proc/uid_concurrent_policy_time which has the format:
2941 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2942 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2943 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2944 * ...
2945 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2946 * The file contains a monotonically increasing count of time for a single boot.
2947 */
2948message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002949 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002950 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002951 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002952}
2953
2954/*
2955 * Pulls free disk space, for data, system partition and temporary directory.
2956 */
2957message DiskSpace {
2958 // available bytes in data partition
2959 optional uint64 data_available_bytes = 1;
2960 // available bytes in system partition
2961 optional uint64 system_available_bytes = 2;
2962 // available bytes in download cache or temp directories
2963 optional uint64 temp_available_bytes = 3;
2964}
Tej Singhbf972d92018-01-10 20:51:13 -08002965
2966/**
2967 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002968 * Pulled from:
2969 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002970 */
2971message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002972 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08002973}
2974
2975/**
2976 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002977 * Pulled from:
2978 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002979 */
2980message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002981 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08002982}
2983
2984/**
Bookatz17f0d8a2018-09-13 12:56:32 -07002985 * Pulls battery voltage.
2986 * Pulled from:
2987 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2988 */
2989message BatteryVoltage {
2990 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07002991 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07002992}
2993
2994/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08002995 * Pulls battery level (percent full, from 0 to 100).
2996 *
2997 * Pulled from:
2998 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2999 */
3000message BatteryLevel {
3001 // Battery level. Should be in [0, 100].
3002 optional int32 battery_level = 1;
3003}
3004
3005/**
Tej Singhd89137e2018-03-26 14:51:40 -07003006 * Pulls the temperature of various parts of the device.
3007 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003008 *
3009 * Pulled from:
3010 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3011 */
3012message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003013 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003014 optional android.os.TemperatureTypeEnum sensor_location = 1;
3015
3016 // The name of the temperature source. Eg. CPU0
3017 optional string sensor_name = 2;
3018
Tej Singhd89137e2018-03-26 14:51:40 -07003019 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003020 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003021 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003022}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003023
3024/**
3025 * Pulls the statistics of calls to Binder.
3026 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003027 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3028 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003029 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003030 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003031 */
3032message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003033 // UID of the process responsible for the binder transaction. It will be set if the process
3034 // executing the binder transaction attribute the transaction to another uid using
3035 // Binder.setThreadWorkSource().
3036 //
3037 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003038 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003039 // UID of the process executing the binder transaction.
3040 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003041 // Fully qualified class name of the API call.
3042 //
3043 // This is a system server class name.
3044 //
3045 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3046 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3047 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3048 // commonly used APIs.
3049 optional string service_class_name = 2;
3050 // Method name of the API call. It can also be a transaction code if we cannot
3051 // resolve it to a name. See Binder#getTransactionName.
3052 //
3053 // This is a system server method name.
3054 optional string service_method_name = 3;
3055 // Total number of API calls.
3056 optional int64 call_count = 4;
3057 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3058 optional bool screen_interactive = 13;
3059 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3060 // call_count will be equal to recorded_call_count.
3061 //
3062 // If recorded_call_count is different than call_count, it means data collection has been
3063 // sampled. All the fields below will be sampled in this case.
3064 optional int64 recorded_call_count = 12;
3065 // Number of exceptions thrown by the API.
3066 optional int64 recorded_exception_count = 5;
3067 // Total latency of all API calls.
3068 // Average can be computed using total_latency_micros / recorded_call_count.
3069 optional int64 recorded_total_latency_micros = 6;
3070 // Maximum latency of one API call.
3071 optional int64 recorded_max_latency_micros = 7;
3072 // Total CPU usage of all API calls.
3073 // Average can be computed using total_cpu_micros / recorded_call_count.
3074 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3075 optional int64 recorded_total_cpu_micros = 8;
3076 // Maximum CPU usage of one API call.
3077 optional int64 recorded_max_cpu_micros = 9;
3078 // Maximum parcel reply size of one API call.
3079 optional int64 recorded_max_reply_size_bytes = 10;
3080 // Maximum parcel request size of one API call.
3081 optional int64 recorded_max_request_size_bytes = 11;
3082}
3083
3084/**
3085 * Pulls the statistics of exceptions during calls to Binder.
3086 *
3087 * Binder stats are cumulative from boot unless somebody reset the data using
3088 * > adb shell dumpsys binder_calls_stats --reset
3089 */
3090message BinderCallsExceptions {
3091 // Exception class name, e.g. java.lang.IllegalArgumentException.
3092 //
3093 // This is an exception class name thrown by the system server.
3094 optional string exception_class_name = 1;
3095 // Total number of exceptions.
3096 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003097}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003098
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003099/**
3100 * Pulls the statistics of message dispatching on HandlerThreads.
3101 *
3102 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3103 * config on the device.
3104 *
3105 * Next tag: 11
3106 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003107message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003108 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003109 optional int32 uid = 1 [(is_uid) = true];
3110
3111 // Fully qualified class name of the handler target class.
3112 //
3113 // This field does not contain PII. This is a system server class name.
3114 optional string handler_class_name = 2;
3115
3116 // The name of the thread that runs the Looper.
3117 //
3118 // This field does not contain PII. This is a system server thread name.
3119 optional string looper_thread_name = 3;
3120
3121 // The name of the dispatched message.
3122 //
3123 // This field does not contain PII. This is a system server constant or class
3124 // name.
3125 optional string message_name = 4;
3126
3127 // Total number of successfully dispatched messages.
3128 optional int64 message_count = 5;
3129
3130 // Total number of messages that failed dispatching.
3131 optional int64 exception_count = 6;
3132
3133 // Total number of processed messages we have data recorded for. If we
3134 // collected data for all the messages, message_count will be equal to
3135 // recorded_message_count.
3136 //
3137 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003138 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003139 optional int64 recorded_message_count = 7;
3140
3141 // Total latency of all processed messages.
3142 // Average can be computed using recorded_total_latency_micros /
3143 // recorded_message_count.
3144 optional int64 recorded_total_latency_micros = 8;
3145
3146 // Total CPU usage of all processed message.
3147 // Average can be computed using recorded_total_cpu_micros /
3148 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003149 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003150 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003151
3152 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3153 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003154
3155 // Max recorded CPU usage of all processed messages.
3156 optional int64 recorded_max_cpu_micros = 11;
3157
3158 // Max recorded latency of all processed messages.
3159 optional int64 recorded_max_latency_micros = 12;
3160
3161 // Total number of messages we tracked the dispatching delay for. If we
3162 // collected data for all the messages, message_count will be equal to
3163 // recorded_delay_message_count.
3164 //
3165 // If recorded_delay_message_count is different than message_count, it means data
3166 // collection has been sampled or/and not all messages specified the target dispatch time.
3167 // The fields below will be sampled in this case.
3168 optional int64 recorded_delay_message_count = 13;
3169
3170 // Total dispatching delay of all processed messages.
3171 // Calculated as a difference between the target dispatching time (Message.when)
3172 // and the actual dispatching time.
3173 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3174 optional int64 recorded_total_delay_millis = 14;
3175
3176 // Max dispatching delay of all processed messages.
3177 // Calculated as a difference between the target dispatching time (Message.when)
3178 // and the actual dispatching time.
3179 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003180}
Tej Singh86dc9db2018-09-06 00:39:57 +00003181
3182/**
3183 * Pulls disk information, such as write speed and latency.
3184 */
3185message DiskStats {
3186 // Time taken to open, write 512B to, and close a file.
3187 // -1 if error performing the check.
3188 optional int64 data_write_latency_millis = 1;
3189
3190 optional bool file_based_encryption = 2;
3191
3192 // Recent disk write speed in kB/s.
3193 // -1 if error querying storageed.
3194 // 0 if data is unavailable.
3195 optional int32 recent_disk_write_speed = 3;
3196}
3197
3198
3199/**
3200 * Free and total bytes of the Data, Cache, and System partition.
3201 */
3202message DirectoryUsage {
3203 enum Directory {
3204 UNKNOWN = 0;
3205 DATA = 1;
3206 CACHE = 2;
3207 SYSTEM = 3;
3208 }
3209 optional Directory directory = 1;
3210 optional int64 free_bytes = 2;
3211 optional int64 total_bytes = 3;
3212}
3213
3214
3215/**
3216 * Size of an application: apk size, data size, and cache size.
3217 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3218 * Information is only reported for apps with the primary user (user 0).
3219 * Sizes are aggregated by package name.
3220 */
3221message AppSize {
3222 // Including uids will involve modifying diskstats logic.
3223 optional string package_name = 1;
3224 // App size in bytes. -1 if unavailable.
3225 optional int64 app_size_bytes = 2;
3226 // App data size in bytes. -1 if unavailable.
3227 optional int64 app_data_size_bytes = 3;
3228 // App cache size in bytes. -1 if unavailable.
3229 optional int64 app_cache_size_bytes = 4;
3230 // Time that the cache file was produced.
3231 // Uses System.currentTimeMillis(), which is wall clock time.
3232 optional int64 cache_time_millis = 5;
3233}
3234
3235
3236/**
3237 * Size of a particular category. Eg: photos, videos.
3238 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3239 */
3240message CategorySize {
3241 enum Category {
3242 UNKNOWN = 0;
3243 APP_SIZE = 1;
3244 APP_DATA_SIZE = 2;
3245 APP_CACHE_SIZE = 3;
3246 PHOTOS = 4;
3247 VIDEOS = 5;
3248 AUDIO = 6;
3249 DOWNLOADS = 7;
3250 SYSTEM = 8;
3251 OTHER = 9;
3252 }
3253 optional Category category = 1;
3254 // Category size in bytes.
3255 optional int64 size_bytes = 2;
3256 // Time that the cache file was produced.
3257 // Uses System.currentTimeMillis(), which is wall clock time.
3258 optional int64 cache_time_millis = 3;
3259}
Tej Singhd6d6d772018-09-05 17:41:25 -07003260
3261/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003262 * Pulls per uid I/O stats. The stats are cumulative since boot.
3263 *
3264 * Read/write bytes are I/O events from a storage device
3265 * Read/write chars are data requested by read/write syscalls, and can be
3266 * satisfied by caching.
3267 *
3268 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3269 */
3270message DiskIo {
3271 optional int32 uid = 1 [(is_uid) = true];
3272 optional int64 fg_chars_read = 2;
3273 optional int64 fg_chars_write = 3;
3274 optional int64 fg_bytes_read = 4;
3275 optional int64 fg_bytes_write = 5;
3276 optional int64 bg_chars_read = 6;
3277 optional int64 bg_chars_write = 7;
3278 optional int64 bg_bytes_read = 8;
3279 optional int64 bg_bytes_write = 9;
3280 optional int64 fg_fsync = 10;
3281 optional int64 bg_fsync= 11;
3282}
3283
3284
3285/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003286 * Pulls the number of fingerprints for each user.
3287 *
3288 * Pulled from StatsCompanionService, which queries FingerprintManager.
3289 */
3290message NumFingerprints {
3291 // The associated user. Eg: 0 for owners, 10+ for others.
3292 // Defined in android/os/UserHandle.java
3293 optional int32 user = 1;
3294 // Number of fingerprints registered to that user.
3295 optional int32 num_fingerprints = 2;
3296}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003297
Yangsteraf9aee72018-10-12 09:26:16 -07003298message AggStats {
3299 optional int64 min = 1;
3300
3301 optional int64 average = 2;
3302
3303 optional int64 max = 3;
3304}
3305
3306message ProcessStatsStateProto {
3307 optional android.service.procstats.ScreenState screen_state = 1;
3308
3309 optional android.service.procstats.MemoryState memory_state = 2;
3310
3311 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3312 // and not frameworks/base/core/java/android/app/ActivityManager.java
3313 optional android.service.procstats.ProcessState process_state = 3;
3314
3315 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003316 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003317
3318 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003319 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003320
3321 // # of samples taken
3322 optional int32 sample_size = 5;
3323
3324 // PSS is memory reserved for this process
3325 optional AggStats pss = 6;
3326
3327 // USS is memory shared between processes, divided evenly for accounting
3328 optional AggStats uss = 7;
3329
3330 // RSS is memory resident for this process
3331 optional AggStats rss = 8;
3332}
3333
3334// Next Tag: 7
3335message ProcessStatsProto {
3336 // Name of process.
3337 optional string process = 1;
3338
3339 // Uid of the process.
3340 optional int32 uid = 2;
3341
3342 // Information about how often kills occurred
3343 message Kill {
3344 // Count of excessive CPU kills
3345 optional int32 cpu = 1;
3346
3347 // Count of kills when cached
3348 optional int32 cached = 2;
3349
3350 // PSS stats during cached kill
3351 optional AggStats cached_pss = 3;
3352 }
3353 optional Kill kill = 3;
3354
3355 // Time and memory spent in various states.
3356 repeated ProcessStatsStateProto states = 5;
3357
3358 // Total time process has been running... screen_state, memory_state, and process_state
3359 // will not be set.
3360 optional ProcessStatsStateProto total_running_state = 6;
3361}
3362
3363message PackageServiceOperationStatsProto {
3364 // Operate enum: Started, Foreground, Bound, Executing
3365 optional android.service.procstats.ServiceOperationState operation = 1;
3366
3367 // Number of times the service was in this operation.
3368 optional int32 count = 2;
3369
3370 // Information about a state the service can be in.
3371 message StateStats {
3372 // Screen state enum.
3373 optional android.service.procstats.ScreenState screen_state = 1;
3374 // Memory state enum.
3375 optional android.service.procstats.MemoryState memory_state = 2;
3376
3377 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07003378 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003379 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003380 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003381 }
3382 repeated StateStats state_stats = 3;
3383}
3384
3385message PackageServiceStatsProto {
3386 // Name of service component.
3387 optional string service_name = 1;
3388
3389 // The operation stats.
3390 // The package_name, package_uid, package_version, service_name will not be set to save space.
3391 repeated PackageServiceOperationStatsProto operation_stats = 2;
3392}
3393
3394message PackageAssociationSourceProcessStatsProto {
3395 // Uid of the process.
3396 optional int32 process_uid = 1;
3397 // Process name.
3398 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08003399 // Package name.
3400 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07003401 // Total count of the times this association appeared.
3402 optional int32 total_count = 3;
3403
3404 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07003405 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003406
3407 // Total count of the times this association became actively impacting its target process.
3408 optional int32 active_count = 5;
3409
3410 // Information on one source in this association.
3411 message StateStats {
3412 // Process state enum.
3413 optional android.service.procstats.ProcessState process_state = 1;
3414 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003415 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003416 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003417 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003418 }
3419 repeated StateStats active_state_stats = 6;
3420}
3421
3422message PackageAssociationProcessStatsProto {
3423 // Name of the target component.
3424 optional string component_name = 1;
3425 // Information on one source in this association.
3426 repeated PackageAssociationSourceProcessStatsProto sources = 2;
3427}
3428
3429
3430message ProcessStatsPackageProto {
3431 // Name of package.
3432 optional string package = 1;
3433
3434 // Uid of the package.
3435 optional int32 uid = 2;
3436
3437 // Version of the package.
3438 optional int64 version = 3;
3439
3440 // Stats for each process running with the package loaded in to it.
3441 repeated ProcessStatsProto process_stats = 4;
3442
3443 // Stats for each of the package's services.
3444 repeated PackageServiceStatsProto service_stats = 5;
3445
3446 // Stats for each association with the package.
3447 repeated PackageAssociationProcessStatsProto association_stats = 6;
3448}
3449
3450message ProcessStatsSectionProto {
3451 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003452 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07003453
3454 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003455 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003456
3457 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003458 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003459
3460 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003461 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003462
3463 // System runtime library. e.g. "libdvm.so", "libart.so".
3464 optional string runtime = 5;
3465
3466 // whether kernel reports swapped pss.
3467 optional bool has_swapped_pss = 6;
3468
3469 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
3470 enum Status {
3471 STATUS_UNKNOWN = 0;
3472 STATUS_COMPLETE = 1;
3473 STATUS_PARTIAL = 2;
3474 STATUS_SHUTDOWN = 3;
3475 STATUS_SYSPROPS = 4;
3476 }
3477 repeated Status status = 7;
3478
Chenjie Yub2ecc792019-01-17 10:27:26 -08003479 // Number of pages available of various types and sizes, representation fragmentation.
3480 repeated ProcessStatsAvailablePagesProto available_pages = 10;
3481
Yangsteraf9aee72018-10-12 09:26:16 -07003482 // Stats for each process.
3483 repeated ProcessStatsProto process_stats = 8;
3484
3485 // Stats for each package.
3486 repeated ProcessStatsPackageProto package_stats = 9;
3487}
3488
Chenjie Yub2ecc792019-01-17 10:27:26 -08003489message ProcessStatsAvailablePagesProto {
3490 // Node these pages are in (as per /proc/pagetypeinfo)
3491 optional int32 node = 1;
3492
3493 // Zone these pages are in (as per /proc/pagetypeinfo)
3494 optional string zone = 2;
3495
3496 // Label for the type of these pages (as per /proc/pagetypeinfo)
3497 optional string label = 3;
3498
3499 // Distribution of number of pages available by order size. First entry in array is
3500 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
3501 repeated int32 pages_per_order = 4;
3502}
3503
Chenjie Yu12e5e672018-09-14 15:54:59 -07003504/**
3505 * Pulled from ProcessStatsService.java
3506 */
3507message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07003508 optional ProcessStatsSectionProto proc_stats_section = 1;
3509}
3510
Chenjie Yuf910b7802019-01-11 16:08:20 -08003511/**
3512 * Pulled from ProcessStatsService.java
3513 */
3514message ProcStatsPkgProc {
3515 optional ProcessStatsSectionProto proc_stats_section = 1;
3516}
3517
Yangsteraf9aee72018-10-12 09:26:16 -07003518message PowerProfileProto {
3519 optional double cpu_suspend = 1;
3520
3521 optional double cpu_idle = 2;
3522
3523 optional double cpu_active = 3;
3524
3525 message CpuCluster {
3526 optional int32 id = 1;
3527 optional double cluster_power = 2;
3528 optional int32 cores = 3;
3529 repeated int64 speed = 4;
3530 repeated double core_power = 5;
3531 }
3532
3533 repeated CpuCluster cpu_cluster = 40;
3534
3535 optional double wifi_scan = 4;
3536
3537 optional double wifi_on = 5;
3538
3539 optional double wifi_active = 6;
3540
3541 optional double wifi_controller_idle = 7;
3542
3543 optional double wifi_controller_rx = 8;
3544
3545 optional double wifi_controller_tx = 9;
3546
3547 repeated double wifi_controller_tx_levels = 10;
3548
3549 optional double wifi_controller_operating_voltage = 11;
3550
3551 optional double bluetooth_controller_idle = 12;
3552
3553 optional double bluetooth_controller_rx = 13;
3554
3555 optional double bluetooth_controller_tx = 14;
3556
3557 optional double bluetooth_controller_operating_voltage = 15;
3558
3559 optional double modem_controller_sleep = 16;
3560
3561 optional double modem_controller_idle = 17;
3562
3563 optional double modem_controller_rx = 18;
3564
3565 repeated double modem_controller_tx = 19;
3566
3567 optional double modem_controller_operating_voltage = 20;
3568
3569 optional double gps_on = 21;
3570
3571 repeated double gps_signal_quality_based = 22;
3572
3573 optional double gps_operating_voltage = 23;
3574
3575 optional double bluetooth_on = 24;
3576
3577 optional double bluetooth_active = 25;
3578
3579 optional double bluetooth_at_cmd = 26;
3580
3581 optional double ambient_display = 27;
3582
3583 optional double screen_on = 28;
3584
3585 optional double radio_on = 29;
3586
3587 optional double radio_scanning = 30;
3588
3589 optional double radio_active = 31;
3590
3591 optional double screen_full = 32;
3592
3593 optional double audio = 33;
3594
3595 optional double video = 34;
3596
3597 optional double flashlight = 35;
3598
3599 optional double memory = 36;
3600
3601 optional double camera = 37;
3602
3603 optional double wifi_batched_scan = 38;
3604
3605 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003606}
Chenjie Yuab530202018-09-26 12:39:20 -07003607
3608/**
3609 * power_profile.xml and other constants for power model calculations.
3610 * Pulled from PowerProfile.java
3611 */
3612message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003613 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003614}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003615
3616/**
arangelovd5db50e2018-10-12 20:24:39 +01003617 * Logs when a user restriction was added or removed.
3618 *
3619 * Logged from:
3620 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3621 */
3622message UserRestrictionChanged {
3623 // The raw string of the user restriction as defined in UserManager.
3624 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3625 optional string restriction = 1;
3626 // Whether the restriction is enabled or disabled.
3627 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07003628}
Yangster-mac308ea0c2018-10-22 13:10:25 -07003629
3630/**
3631 * Pulls process user time and system time. Puller takes a snapshot of all pids
3632 * in the system and returns cpu stats for those that are working at the time.
3633 * Dead pids will be dropped. Kernel processes are excluded.
3634 * Min cool-down is 5 sec.
3635 */
3636message ProcessCpuTime {
3637 optional int32 uid = 1 [(is_uid) = true];
3638
3639 optional string process_name = 2;
3640 // Process cpu time in user space, cumulative from boot/process start
3641 optional int64 user_time_millis = 3;
3642 // Process cpu time in system space, cumulative from boot/process start
3643 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01003644}
Misha Wagner5a51e002018-10-03 15:04:09 +01003645
3646/**
3647 * Pulls the CPU usage for each thread.
3648 *
3649 * Read from /proc/$PID/task/$TID/time_in_state files.
3650 *
3651 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
3652 * time_in_state files not being present on some phones, have not been addressed. These should be
3653 * considered before a public release.
3654 */
3655message CpuTimePerThreadFreq {
3656 // UID that owns the process.
3657 optional int32 uid = 1 [(is_uid) = true];
3658 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003659 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01003660 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003661 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01003662 // Name of the process taken from `/proc/$PID/cmdline`.
3663 optional string process_name = 4;
3664 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
3665 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00003666
3667 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
3668 // are given in KHz, and time is given in milliseconds since the thread started. All eight
3669 // frequencies are given here as the alternative is sending eight separate atoms. This method
3670 // significantly reduces the amount of data created
3671 optional int32 frequency1_khz = 6;
3672 optional int32 time1_millis = 7;
3673 optional int32 frequency2_khz = 8;
3674 optional int32 time2_millis = 9;
3675 optional int32 frequency3_khz = 10;
3676 optional int32 time3_millis = 11;
3677 optional int32 frequency4_khz = 12;
3678 optional int32 time4_millis = 13;
3679 optional int32 frequency5_khz = 14;
3680 optional int32 time5_millis = 15;
3681 optional int32 frequency6_khz = 16;
3682 optional int32 time6_millis = 17;
3683 optional int32 frequency7_khz = 18;
3684 optional int32 time7_millis = 19;
3685 optional int32 frequency8_khz = 20;
3686 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01003687}
Bookatz75ee6042018-11-09 12:27:37 -08003688
3689/**
Bookatz366a4432018-11-20 09:42:33 -08003690 * Pulls information about the device's build.
3691 */
3692message BuildInformation {
3693 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
3694 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
3695 optional string fingerprint = 1;
3696
3697 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
3698 optional string brand = 2;
3699
3700 // Build.PRODUCT. The name of the overall product.
3701 optional string product = 3;
3702
3703 // Build.DEVICE. The name of the industrial design.
3704 optional string device = 4;
3705
3706 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
3707 optional string version_release = 5;
3708
3709 // Build.ID. E.g. a label like "M4-rc20".
3710 optional string id = 6;
3711
3712 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
3713 // represent this build.
3714 optional string version_incremental = 7;
3715
3716 // Build.TYPE. The type of build, like "user" or "eng".
3717 optional string type = 8;
3718
3719 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
3720 optional string tags = 9;
3721}
3722
3723/**
Bookatz75ee6042018-11-09 12:27:37 -08003724 * Pulls on-device BatteryStats power use calculations for the overall device.
3725 */
3726message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08003727 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3728 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3729 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
3730 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08003731}
3732
3733/**
3734 * Pulls on-device BatteryStats power use calculations broken down by uid.
3735 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
3736 * that is attributed to non-uid items. They must all be included to get the total power use.
3737 */
3738message DeviceCalculatedPowerBlameUid {
3739 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
3740 optional int32 uid = 1 [(is_uid) = true];
3741
Bookatz3dbc13a2018-12-21 12:16:51 -08003742 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3743 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3744 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08003745}
3746
3747/**
3748 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
3749 * drain type.
3750 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
3751 * is attributed uids. They must all be included to get the total power use.
3752 */
3753message DeviceCalculatedPowerBlameOther {
3754 // The type of item whose power use is being reported.
3755 enum DrainType {
3756 AMBIENT_DISPLAY = 0;
3757 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
3758 BLUETOOTH = 2;
3759 CAMERA = 3;
3760 // Cell-standby
3761 CELL = 4;
3762 FLASHLIGHT = 5;
3763 IDLE = 6;
3764 MEMORY = 7;
3765 // Amount that total computed drain exceeded the drain estimated using the
3766 // battery level changes and capacity.
3767 OVERCOUNTED = 8;
3768 PHONE = 9;
3769 SCREEN = 10;
3770 // Amount that total computed drain was below the drain estimated using the
3771 // battery level changes and capacity.
3772 UNACCOUNTED = 11;
3773 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
3774 WIFI = 13;
3775 }
3776 optional DrainType drain_type = 1;
3777
Bookatz3dbc13a2018-12-21 12:16:51 -08003778 // Power used by this item 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;
Rafal Slawik3bea8952018-11-15 12:39:33 +00003781}
arangelov4e994062018-11-13 16:12:38 +00003782
3783/**
3784 * Logs device policy features.
3785 *
3786 * Logged from:
3787 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3788 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
3789 */
3790message DevicePolicyEvent {
3791 // The event id - unique for each event.
3792 optional android.stats.devicepolicy.EventId event_id = 1;
3793 // The admin package name.
3794 optional string admin_package_name = 2;
3795 // A generic integer parameter.
3796 optional int32 integer_value = 3;
3797 // A generic boolean parameter.
3798 optional bool boolean_value = 4;
3799 // A parameter specifying a time period in milliseconds.
3800 optional uint64 time_period_millis = 5;
3801 // A parameter specifying a list of package names, bundle extras or string parameters.
3802 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
3803}
shawnlinea5b66b2018-11-13 15:05:29 +08003804
3805/**
3806 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
3807 *
3808 * Logged from:
3809 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3810 */
3811message DocsUILaunchReported {
3812 optional android.stats.docsui.LaunchAction launch_action = 1;
3813 optional bool has_initial_uri = 2;
3814 optional android.stats.docsui.MimeType mime_type = 3;
3815 optional android.stats.docsui.Root initial_root = 4;
3816}
3817
3818/**
3819 * Logs root/app visited event in file managers/picker. Call this when the user
3820 * taps on root/app in hamburger menu.
3821 *
3822 * Logged from:
3823 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3824 */
3825message DocsUIRootVisitedReported {
3826 optional android.stats.docsui.ContextScope scope = 1;
3827 optional android.stats.docsui.Root root = 2;
3828}
3829
3830/**
3831 * Logs file operation stats. Call this when a file operation has completed.
3832 *
3833 * Logged from:
3834 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3835 */
3836message DocsUIFileOperationReported {
3837 optional android.stats.docsui.Provider provider = 1;
3838 optional android.stats.docsui.FileOperation file_op = 2;
3839}
3840
3841/**
3842 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
3843 * mode.
3844 *
3845 * Logged from:
3846 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3847 */
3848message DocsUIFileOperationCopyMoveModeReported {
3849 optional android.stats.docsui.FileOperation file_op = 1;
3850 optional android.stats.docsui.CopyMoveOpMode mode = 2;
3851}
3852
3853
3854/**
3855 * Logs file sub operation stats. Call this when a file operation has failed.
3856 *
3857 * Logged from:
3858 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3859 */
3860message DocsUIFileOperationFailureReported {
3861 optional android.stats.docsui.Authority authority = 1;
3862 optional android.stats.docsui.SubFileOperation sub_op = 2;
3863}
3864
3865/**
3866* Logs the cancellation of a file operation. Call this when a job is canceled
3867*
3868* Logged from:
3869* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3870*/
3871message DocsUIFileOperationCanceledReported {
3872 optional android.stats.docsui.FileOperation file_op = 1;
3873}
3874
3875/**
3876 * Logs startup time in milliseconds.
3877 *
3878 * Logged from:
3879 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3880 */
3881message DocsUIStartupMsReported {
3882 optional int32 startup_millis = 1;
3883}
3884
3885/**
3886 * Logs the action that was started by user.
3887 *
3888 * Logged from:
3889 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3890 */
3891message DocsUIUserActionReported {
3892 optional android.stats.docsui.UserAction action = 1;
3893}
3894
3895/**
3896 * Logs the invalid type when invalid scoped access is requested.
3897 *
3898 * Logged from:
3899 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
3900 */
3901message DocsUIInvalidScopedAccessRequestReported {
3902 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00003903}
Ben Murdochbab399f2018-12-06 11:01:38 +00003904
3905/**
shawnlina75e82d2019-01-07 10:31:12 +08003906 * Logs the package name that launches docsui picker mode.
3907 *
3908 * Logged from:
3909 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3910 */
3911message DocsUIPickerLaunchedFromReported {
3912 optional string package_name = 1;
3913}
3914
3915/**
3916 * Logs the search type.
3917 *
3918 * Logged from:
3919 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3920 */
3921message DocsUISearchTypeReported {
3922 optional android.stats.docsui.SearchType search_type = 1;
3923}
3924
3925/**
3926 * Logs the search mode.
3927 *
3928 * Logged from:
3929 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3930 */
3931message DocsUISearchModeReported {
3932 optional android.stats.docsui.SearchMode search_mode = 1;
3933}
3934
3935/**
3936 * Logs the pick result information.
3937 *
3938 * Logged from:
3939 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3940 */
3941message DocsUIPickResultReported {
3942 optional int32 total_action_count = 1;
3943 optional int64 duration_millis = 2;
3944 optional int32 file_count= 3;
3945 optional bool is_searching = 4;
3946 optional android.stats.docsui.Root picked_from = 5;
3947 optional android.stats.docsui.MimeType mime_type = 6;
3948 optional int32 repeatedly_pick_times = 7;
3949}
3950
3951/**
Ben Murdochbab399f2018-12-06 11:01:38 +00003952 * Logs when an app's memory is compacted.
3953 *
3954 * Logged from:
3955 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3956 */
3957message AppCompacted {
3958 // The pid of the process being compacted.
3959 optional int32 pid = 1;
3960
3961 // The name of the process being compacted.
3962 optional string process_name = 2;
3963
3964 // The type of compaction.
3965 enum Action {
3966 UNKNOWN = 0;
3967 SOME = 1;
3968 FULL = 2;
3969 }
Ben Murdoch01720b82018-12-19 18:03:44 +00003970 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00003971
3972 // Total RSS in kilobytes consumed by the process prior to compaction.
3973 optional int64 before_rss_total_kilobytes = 4;
3974
3975 // File RSS in kilobytes consumed by the process prior to compaction.
3976 optional int64 before_rss_file_kilobytes = 5;
3977
3978 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
3979 optional int64 before_rss_anon_kilobytes = 6;
3980
3981 // Swap in kilobytes consumed by the process prior to compaction.
3982 optional int64 before_swap_kilobytes = 7;
3983
3984 // Total RSS in kilobytes consumed by the process after compaction.
3985 optional int64 after_rss_total_kilobytes = 8;
3986
3987 // File RSS in kilobytes consumed by the process after compaction.
3988 optional int64 after_rss_file_kilobytes = 9;
3989
3990 // Anonymous RSS in kilobytes consumed by the process after compaction.
3991 optional int64 after_rss_anon_kilobytes = 10;
3992
3993 // Swap in kilobytes consumed by the process after compaction.
3994 optional int64 after_swap_kilobytes = 11;
3995
3996 // The time taken to perform compaction in milliseconds.
3997 optional int64 time_to_compact_millis = 12;
3998
3999 // The last compaction action performed for this app.
4000 optional Action last_action = 13;
4001
Ben Murdoch01720b82018-12-19 18:03:44 +00004002 // The last time that compaction was attempted on this process in milliseconds
4003 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4004 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004005
Ben Murdoch01720b82018-12-19 18:03:44 +00004006 // The oom_score_adj at the time of compaction.
4007 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004008
4009 // The process state at the time of compaction.
4010 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4011}
lifr157fc552018-12-12 16:38:04 +08004012
4013/**
4014 * Logs the latency period(in microseconds) and the return code of
4015 * the DNS(Domain Name System) lookups.
4016 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4017 * to get info(address or hostname) from DNS server(or DNS cache).
4018 * Logged from:
4019 * /system/netd/server/DnsProxyListener.cpp
4020 */
4021message NetworkDnsEventReported {
4022 // The types of the DNS lookups, as defined in
4023 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4024 enum EventType {
4025 EVENT_UNKNOWN = 0;
4026 EVENT_GETADDRINFO = 1;
4027 EVENT_GETHOSTBYNAME = 2;
4028 EVENT_GETHOSTBYADDR = 3;
4029 EVENT_RES_NSEND = 4;
4030 }
4031 optional EventType event_type = 1;
4032
4033 // The return value of the DNS resolver for each DNS lookups.
4034 //bionic/libc/include/netdb.h
4035 //system/netd/resolv/include/netd_resolv/resolv.h
4036 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004037 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004038 EAI_ADDRFAMILY = 1;
4039 EAI_AGAIN = 2;
4040 EAI_BADFLAGS = 3;
4041 EAI_FAIL = 4;
4042 EAI_FAMILY = 5;
4043 EAI_MEMORY = 6;
4044 EAI_NODATA = 7;
4045 EAI_NONAME = 8;
4046 EAI_SERVICE = 9;
4047 EAI_SOCKTYPE = 10;
4048 EAI_SYSTEM = 11;
4049 EAI_BADHINTS = 12;
4050 EAI_PROTOCOL = 13;
4051 EAI_OVERFLOW = 14;
4052 RESOLV_TIMEOUT = 255;
4053 EAI_MAX = 256;
4054 }
4055 optional ReturnCode return_code = 2;
4056
4057 // The latency period(in microseconds) it took for this DNS lookup to complete.
4058 optional int32 latency_micros = 3;
4059}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004060
4061/**
4062 * Logs when a data stall event occurs.
4063 *
4064 * Log from:
4065 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4066 */
4067message DataStallEvent {
4068 // Data stall evaluation type.
4069 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4070 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4071 optional int32 evaluation_type = 1;
4072 // See definition in data_stall_event.proto.
4073 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4074 // See definition in data_stall_event.proto.
4075 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4076 // See definition in data_stall_event.proto.
4077 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4078 // See definition in data_stall_event.proto.
4079 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4080 // See definition in data_stall_event.proto.
4081 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4082}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004083
4084/*
4085 * Logs when RescueParty resets some set of experiment flags.
4086 *
4087 * Logged from:
4088 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4089 */
4090message RescuePartyResetReported {
4091 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4092 optional int32 rescue_level = 1;
4093}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004094
4095/**
4096 * Logs when signed config is received from an APK, and if that config was applied successfully.
4097 * Logged from:
4098 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4099 */
4100message SignedConfigReported {
4101 enum Type {
4102 UNKNOWN_TYPE = 0;
4103 GLOBAL_SETTINGS = 1;
4104 }
4105 optional Type type = 1;
4106
4107 // The final status of the signed config received.
4108 enum Status {
4109 UNKNOWN_STATUS = 0;
4110 APPLIED = 1;
4111 BASE64_FAILURE_CONFIG = 2;
4112 BASE64_FAILURE_SIGNATURE = 3;
4113 SECURITY_EXCEPTION = 4;
4114 INVALID_CONFIG = 5;
4115 OLD_CONFIG = 6;
4116 SIGNATURE_CHECK_FAILED = 7;
4117 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004118 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004119 }
4120 optional Status status = 2;
4121
4122 // The version of the signed config processed.
4123 optional int32 version = 3;
4124
4125 // The package name that the config was extracted from.
4126 optional string from_package = 4;
4127
4128 enum Key {
4129 NO_KEY = 0;
4130 DEBUG = 1;
4131 PRODUCTION = 2;
4132 }
4133 // Which key was used to verify the config.
4134 optional Key verified_with = 5;
4135}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004136
4137/*
4138 * Logs GNSS Network-Initiated (NI) location events.
4139 *
4140 * Logged from:
4141 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4142 */
4143message GnssNiEventReported {
4144 // The type of GnssNiEvent.
4145 enum EventType {
4146 UNKNOWN = 0;
4147 NI_REQUEST = 1;
4148 NI_RESPONSE = 2;
4149 }
4150 optional EventType event_type = 1;
4151
4152 // An ID generated by HAL to associate NI notifications and UI responses.
4153 optional int32 notification_id = 2;
4154
4155 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004156 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004157
4158 // NI requires notification.
4159 optional bool need_notify = 4;
4160
4161 // NI requires verification.
4162 optional bool need_verify = 5;
4163
4164 // NI requires privacy override, no notification/minimal trace.
4165 optional bool privacy_override = 6;
4166
4167 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4168 // seconds.
4169 optional int32 timeout = 7;
4170
4171 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004172 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004173
4174 // String representing the requester of the network inititated location request.
4175 optional string requestor_id = 9;
4176
4177 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4178 // network initiated location request.
4179 optional string text = 10;
4180
4181 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004182 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004183
4184 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004185 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004186
4187 // True if SUPL ES is enabled.
4188 optional bool is_supl_es_enabled = 13;
4189
4190 // True if GNSS location is enabled.
4191 optional bool is_location_enabled = 14;
4192
4193 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004194 optional android.server.location.GnssUserResponseType user_response = 15;
4195}
4196
4197/**
4198 * Logs GNSS non-framework (NFW) location notification.
4199 *
4200 * Logged from:
4201 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4202 */
4203message GnssNfwNotificationReported {
4204 // Package name of the Android proxy application representing the non-framework entity that
4205 // requested location. Set to empty string if unknown.
4206 optional string proxy_app_package_name = 1;
4207
4208 // Protocol stack that initiated the non-framework location request.
4209 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4210
4211 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4212 // set to empty string. This field is opaque to the framework and used for logging purposes.
4213 optional string other_protocol_stack_name = 3;
4214
4215 // Source initiating/receiving the location information.
4216 optional android.server.location.NfwRequestor requestor = 4;
4217
4218 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4219 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4220 // and used for logging purposes.
4221 optional string requestor_id = 5;
4222
4223 // Indicates whether location information was provided for this request.
4224 optional android.server.location.NfwResponseType response_type = 6;
4225
4226 // True if the device is in user initiated emergency session.
4227 optional bool in_emergency_mode = 7;
4228
4229 // True if cached location is provided.
4230 optional bool is_cached_location = 8;
4231
4232 // True if proxy app permission mismatch between framework and GNSS HAL.
4233 optional bool is_permission_mismatched = 9;
4234}
4235
4236/**
4237 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4238 *
4239 * Logged from:
4240 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4241 */
4242message GnssConfigurationReported {
4243 // SUPL host name.
4244 optional string supl_host = 1;
4245
4246 // SUPL port number.
4247 optional int32 supl_port = 2;
4248
4249 // C2K host name.
4250 optional string c2k_host = 3;
4251
4252 // C2K port number.
4253 optional int32 c2k_port = 4;
4254
4255 // The SUPL version requested by Carrier.
4256 optional int32 supl_ver = 5;
4257
4258 // The SUPL mode.
4259 optional android.server.location.SuplMode supl_mode = 6;
4260
4261 // True if NI emergency SUPL restrictions is enabled.
4262 optional bool supl_es = 7;
4263
4264 // LTE Positioning Profile settings
4265 optional android.server.location.LppProfile lpp_profile = 8;
4266
4267 // Positioning protocol on A-Glonass system.
4268 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
4269
4270 // True if emergency PDN is used. Otherwise, regular PDN is used.
4271 optional bool use_emergency_pdn_for_emergency_supl= 10;
4272
4273 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
4274 optional android.server.location.GpsLock gps_lock = 11;
4275
4276 // Number of seconds to extend the emergency session duration post emergency call.
4277 optional int32 es_extension_sec = 12;
4278
4279 // The full list of package names of proxy Android applications representing the non-framework
4280 // location access entities (on/off the device) for which the framework user has granted
4281 // non-framework location access permission. The package names are concatenated in one string
4282 // with spaces as separators.
4283 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004284}