blob: 453a0c033a18f48250b045c95f7bff6f1512c187 [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";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080029import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080030import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080031import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080032import "frameworks/base/core/proto/android/server/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080033import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070034import "frameworks/base/core/proto/android/service/procstats_enum.proto";
35import "frameworks/base/core/proto/android/stats/enums.proto";
shawnlinea5b66b2018-11-13 15:05:29 +080036import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070037import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080038import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080039import "frameworks/base/core/proto/android/telephony/enums.proto";
40import "frameworks/base/core/proto/android/view/enums.proto";
arangelov4e994062018-11-13 16:12:38 +000041import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
42import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080043
Yao Chend54f9dd2017-10-17 17:37:48 +000044/**
Stefan Lafonae2df012017-11-14 09:17:21 -080045 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000046 * raw stats log events from the Android system, also known as "atoms."
47 *
48 * This field contains a single oneof with all of the available messages.
49 * The stats-log-api-gen tool runs as part of the Android build and
50 * generates the android.util.StatsLog class, which contains the constants
51 * and methods that Android uses to log.
52 *
Stefan Lafonae2df012017-11-14 09:17:21 -080053 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000054 * Instead, statsd on Android constructs these messages synthetically,
55 * in the format defined here and in stats_log.proto.
56 */
Stefan Lafonae2df012017-11-14 09:17:21 -080057message Atom {
58 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070059 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070060 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
61 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070062 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070063 BleScanResultReceived ble_scan_result_received = 4;
64 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080065 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070066 SyncStateChanged sync_state_changed = 7;
67 ScheduledJobStateChanged scheduled_job_state_changed = 8;
68 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070069 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080070 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
71 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
72 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070073 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
74 MemoryFactorStateChanged memory_factor_state_changed = 15;
75 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
76 CachedKillReported cached_kill_reported = 17;
77 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070078 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080079 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
80 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
81 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070082 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080083 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070084 CameraStateChanged camera_state_changed = 25;
85 FlashlightStateChanged flashlight_state_changed = 26;
86 UidProcessStateChanged uid_process_state_changed = 27;
87 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
88 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070089 BatteryLevelChanged battery_level_changed = 30;
90 ChargingStateChanged charging_state_changed = 31;
91 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070092 InteractiveStateChanged interactive_state_changed = 33;
93 // 34 is available
Bookatz8c6571b2017-10-24 15:04:41 -070094 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
95 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070096 WifiLockStateChanged wifi_lock_state_changed = 37;
97 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
98 WifiScanStateChanged wifi_scan_state_changed = 39;
99 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700100 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700101 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700102 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900103 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700104 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800105 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -0800106 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800107 AppStartOccurred app_start_occurred = 48;
108 AppStartCanceled app_start_canceled = 49;
109 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800110 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800111 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800112 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800113 LmkStateChanged lmk_state_changed = 54;
114 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800115 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800116 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800117 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800118 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800119 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800120 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800121 KeyguardStateChanged keyguard_state_changed = 62;
122 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
123 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800124 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800125 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800126 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
127 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800128 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700129 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800130 SpeakerImpedanceReported speaker_impedance_reported = 71;
131 HardwareFailed hardware_failed = 72;
132 PhysicalDropDetected physical_drop_detected = 73;
133 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800134 MobileConnectionStateChanged mobile_connection_state_changed = 75;
135 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700136 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800137 AppCrashOccurred app_crash_occurred = 78;
138 ANROccurred anr_occurred = 79;
139 WTFOccurred wtf_occurred = 80;
140 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700141 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700142 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700143 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700144 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700145 ThermalThrottlingStateChanged thermal_throttling = 86;
Tej Singhd6d6d772018-09-05 17:41:25 -0700146 FingerprintAcquired fingerprint_acquired = 87;
147 FingerprintAuthenticated fingerprint_authenticated = 88;
148 FingerprintErrorOccurred fingerprint_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700149 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700150 BatteryHealthSnapshot battery_health_snapshot = 91;
151 SlowIo slow_io = 92;
152 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700153 PhoneServiceStateChanged phone_service_state_changed = 94;
154 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100155 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700156 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700157 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700158 // TODO: service state change is very noisy shortly after boot, as well
159 // as at other transitions - coming out of doze, device plugged in, etc.
160 // Consider removing this if it becomes a problem
161 ServiceStateChanged service_state_changed = 99;
162 ServiceLaunchReported service_launch_reported = 100;
Yangster-macb89807e2018-11-15 21:10:57 -0800163 PhenotypeFlagStateChanged phenotype_flag_state_changed = 101;
164 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000165 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800166 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
167 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
168 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
169 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
170 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
171 DocsUILaunchReported docs_ui_launch_reported = 109;
172 DocsUIRootVisitedReported docs_ui_root_visited = 110;
173 DocsUIStartupMsReported docs_ui_startup_ms = 111;
174 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800175 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
176 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000177 AppCompacted app_compacted = 115;
lifr030d23a2019-01-11 16:54:51 +0800178 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800179 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
180 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
181 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
182 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800183 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000184 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000185 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800186 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800187 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Yao Chend54f9dd2017-10-17 17:37:48 +0000188 }
David Chenc8a43242017-10-17 16:23:28 -0700189
David Chen6e3e6cb2018-01-03 16:14:06 -0800190 // Pulled events will start at field 10000.
Rafal Slawik3bea8952018-11-15 12:39:33 +0000191 // Next: 10043
David Chenc8a43242017-10-17 16:23:28 -0700192 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800193 WifiBytesTransfer wifi_bytes_transfer = 10000;
194 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
195 MobileBytesTransfer mobile_bytes_transfer = 10002;
196 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800197 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800198 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800199 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800200 CpuTimePerFreq cpu_time_per_freq = 10008;
201 CpuTimePerUid cpu_time_per_uid = 10009;
202 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800203 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800204 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800205 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800206 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800207 SystemElapsedRealtime system_elapsed_realtime = 10014;
208 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800209 CpuActiveTime cpu_active_time = 10016;
210 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000211 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800212 RemainingBatteryCapacity remaining_battery_capacity = 10019;
213 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800214 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100215 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100216 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100217 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000218 DiskStats disk_stats = 10025;
219 DirectoryUsage directory_usage = 10026;
220 AppSize app_size = 10027;
221 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700222 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700223 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700224 NumFingerprints num_fingerprints = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700225 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700226 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800227 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700228 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100229 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100230 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700231 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800232 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
233 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
234 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000235 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800236 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800237 BuildInformation build_information = 10044;
David Chenc8a43242017-10-17 16:23:28 -0700238 }
yroa1fe77c2018-02-26 14:22:54 -0800239
Bookatz76aafcf2018-09-17 16:17:10 -0700240 // DO NOT USE field numbers above 100,000 in AOSP.
241 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
242 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700243}
244
Yao Chend54f9dd2017-10-17 17:37:48 +0000245/**
Yangster-mac20877162017-12-22 17:19:39 -0800246 * This proto represents a node of an attribution chain.
247 * Note: All attribution chains are represented as a repeated field of type
248 * AttributionNode. It is understood that in such arrays, the order is that
249 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000250 */
Yangster-mac20877162017-12-22 17:19:39 -0800251message AttributionNode {
252 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800253 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800254
Yangster-mac20877162017-12-22 17:19:39 -0800255 // The (optional) string tag for an element in the attribution chain. If the
256 // element has no tag, it is encoded as an empty string.
257 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700258}
259
Yangster-mac48b3d622018-08-18 12:38:11 -0700260message KeyValuePair {
261 optional int32 key = 1;
262 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700263 int32 value_int = 2;
264 int64 value_long = 3;
265 string value_str = 4;
266 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700267 }
268}
269
270message KeyValuePairsAtom {
271 optional int32 uid = 1;
272 repeated KeyValuePair pairs = 2;
273}
274
Yao Chend54f9dd2017-10-17 17:37:48 +0000275/*
276 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800277 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000278 *
279 * RULES:
280 * - The field ids for each atom must start at 1, and count upwards by 1.
281 * Skipping field ids is not allowed.
282 * - These form an API, so renaming, renumbering or removing fields is
283 * not allowed between android releases. (This is not currently enforced,
284 * but there will be a tool to enforce this restriction).
285 * - The types must be built-in protocol buffer types, namely, no sub-messages
286 * are allowed (yet). The bytes type is also not allowed.
287 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800288 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000289 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800290 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000291 * - A field that is a uid should be a string field, tagged with the [xxx]
292 * annotation. The generated code on android will be represented by UIDs,
293 * and those UIDs will be translated in xxx to those strings.
294 *
295 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700296 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000297 * - If there is a UID, it goes first. Think in an object-oriented fashion.
298 * *****************************************************************************
299 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700300
Yao Chend54f9dd2017-10-17 17:37:48 +0000301/**
Yangster-mace16189a2018-08-26 12:20:16 -0700302 * Logs when the Thermal service HAL notifies the throttling start/stop events.
303 *
304 * Logged from:
305 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
306 */
307message ThermalThrottlingStateChanged {
308 optional android.os.TemperatureTypeEnum sensor_type = 1;
309
310 enum State {
311 UNKNOWN = 0;
312 START = 1;
313 STOP = 2;
314 }
315
316 optional State state = 2;
317
318 optional float temperature = 3;
319}
320
321/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000322 * Logs when the screen state changes.
323 *
324 * Logged from:
325 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
326 */
327message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800328 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700329 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700330}
Yao Chend54f9dd2017-10-17 17:37:48 +0000331
332/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700333 * Logs that the process state of the uid, as determined by ActivityManager
334 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000335 *
336 * Logged from:
337 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
338 */
Bookatzc1a050a2017-10-10 15:49:28 -0700339message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700340 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000341
Bookatzdb026a22018-01-10 19:01:56 -0800342 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700343 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000344}
345
346/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700347 * Logs process state change of a process, as per the activity manager.
348 *
349 * Logged from:
350 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
351 */
352message ProcessStateChanged {
353 optional int32 uid = 1;
354 optional string process_name = 2;
355 optional string package_name = 3;
356 // TODO: remove this when validation is done
357 optional int64 version = 5;
358 // The state, from frameworks/base/core/proto/android/app/enums.proto.
359 optional android.app.ProcessStateEnum state = 4;
360}
361
362/**
363 * Logs when ActivityManagerService sleep state is changed.
364 *
365 * Logged from:
366 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
367 */
368message ActivityManagerSleepStateChanged {
369 // TODO: import frameworks proto
370 enum State {
371 UNKNOWN = 0;
372 ASLEEP = 1;
373 AWAKE = 2;
374 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700375 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700376}
377
378/**
379 * Logs when system memory state changes.
380 *
381 * Logged from:
382 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
383 */
384message MemoryFactorStateChanged {
385 // TODO: import frameworks proto
386 enum State {
387 MEMORY_UNKNOWN = 0;
388 NORMAL = 1; // normal.
389 MODERATE = 2; // moderate memory pressure.
390 LOW = 3; // low memory.
391 CRITICAL = 4; // critical memory.
392
393 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700394 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700395}
396
397/**
398 * Logs when app is using too much cpu, according to ActivityManagerService.
399 *
400 * Logged from:
401 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
402 */
403message ExcessiveCpuUsageReported {
404 optional int32 uid = 1;
405 optional string process_name = 2;
406 optional string package_name = 3;
407 // package version. TODO: remove this when validation is done
408 optional int64 version = 4;
409}
410
411/**
412 * Logs when a cached process is killed, along with its pss.
413 *
414 * Logged from:
415 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
416 */
417message CachedKillReported {
418 optional int32 uid = 1;
419 optional string process_name = 2;
420 optional string package_name = 3;
421 // TODO: remove this when validation is done
422 optional int64 version = 5;
423 optional int64 pss = 4;
424}
425
426/**
427 * Logs when memory stats of a process is reported.
428 *
429 * Logged from:
430 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
431 */
432message ProcessMemoryStatReported {
433 optional int32 uid = 1;
434 optional string process_name = 2;
435 optional string package_name = 3;
436 //TODO: remove this when validation is done
437 optional int64 version = 9;
438 optional int64 pss = 4;
439 optional int64 uss = 5;
440 optional int64 rss = 6;
441 enum Type {
442 ADD_PSS_INTERNAL_SINGLE = 0;
443 ADD_PSS_INTERNAL_ALL_MEM = 1;
444 ADD_PSS_INTERNAL_ALL_POLL = 2;
445 ADD_PSS_EXTERNAL = 3;
446 ADD_PSS_EXTERNAL_SLOW = 4;
447 }
448 optional Type type = 7;
449 optional int64 duration = 8;
450}
451
452/**
Bookatzc1a050a2017-10-10 15:49:28 -0700453 * Logs that a process started, finished, crashed, or ANRed.
454 *
455 * Logged from:
456 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
457 */
458message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700459 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700460
David Chen0b5c90c2018-01-25 16:51:49 -0800461 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800462 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700463
Bookatzddccf0a2017-11-28 16:48:14 -0800464 // What lifecycle state the process changed to.
465 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800466 enum State {
467 FINISHED = 0;
468 STARTED = 1;
469 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800470 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800471 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700472}
473
Bookatzc1a050a2017-10-10 15:49:28 -0700474/**
475 * Logs when the ble scan state changes.
476 *
477 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700478 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700479 */
480message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800481 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700482
483 enum State {
484 OFF = 0;
485 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700486 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
487 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700488 }
489 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700490
Bookatze5ec0b42018-03-26 13:34:56 -0700491 // Does the scan have a filter.
492 optional bool is_filtered = 3;
493 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
494 optional bool is_first_match = 4;
495 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
496 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700497}
498
499/**
500 * Logs reporting of a ble scan finding results.
501 *
502 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700503 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700504 */
Bookatzae6738e2018-09-13 11:38:56 -0700505// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700506message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800507 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700508
509 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800510 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700511}
512
513/**
514 * Logs when a sensor state changes.
515 *
516 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700517 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700518 */
519message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800520 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700521
Bookatzc1a050a2017-10-10 15:49:28 -0700522 // The id (int) of the sensor.
523 optional int32 sensor_id = 2;
524
525 enum State {
526 OFF = 0;
527 ON = 1;
528 }
529 optional State state = 3;
530}
531
Bookatzc1a050a2017-10-10 15:49:28 -0700532/**
533 * Logs when GPS state changes.
534 *
535 * Logged from:
536 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
537 */
538message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800539 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700540
541 enum State {
542 OFF = 0;
543 ON = 1;
544 }
545 optional State state = 2;
546}
547
Bookatz48d362e2018-11-06 15:49:08 -0800548/**
549 * Logs when GPS signal quality.
550 *
551 * Logged from:
552 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
553 */
554message GpsSignalQualityChanged {
555 optional android.server.location.GpsSignalQualityEnum level = 1;
556}
557
Bookatzc1a050a2017-10-10 15:49:28 -0700558
559/**
560 * Logs when a sync manager sync state changes.
561 *
562 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700563 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700564 */
565message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800566 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700567
David Chen0b5c90c2018-01-25 16:51:49 -0800568 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800569 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700570
571 enum State {
572 OFF = 0;
573 ON = 1;
574 }
575 optional State state = 3;
576}
577
Yangster-mac96353002018-09-05 11:18:55 -0700578/*
579 * Deferred job stats.
580 *
581 * Logged from:
582 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
583*/
584message DeferredJobStatsReported {
585 repeated AttributionNode attribution_node = 1;
586
587 // Number of jobs deferred.
588 optional int32 num_jobs_deferred = 2;
589
590 // Time since the last job runs.
591 optional int64 time_since_last_job_millis = 3;
592}
593
Bookatzc1a050a2017-10-10 15:49:28 -0700594/**
595 * Logs when a job scheduler job state changes.
596 *
597 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700598 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700599 */
600message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800601 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700602
603 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800604 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700605
606 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800607 FINISHED = 0;
608 STARTED = 1;
609 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700610 }
611 optional State state = 3;
612
Tej Singh33a412b2018-03-16 18:43:59 -0700613 // The reason a job has stopped.
614 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700615 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700616 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700617}
618
619/**
620 * Logs when the audio state changes.
621 *
622 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700623 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700624 */
625message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800626 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700627
628 enum State {
629 OFF = 0;
630 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700631 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
632 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700633 }
634 optional State state = 2;
635}
636
637/**
638 * Logs when the video codec state changes.
639 *
640 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700641 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700642 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800643message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800644 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700645
646 enum State {
647 OFF = 0;
648 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700649 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
650 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700651 }
652 optional State state = 2;
653}
654
655/**
656 * Logs when the flashlight state changes.
657 *
658 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700659 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700660 */
661message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800662 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700663
664 enum State {
665 OFF = 0;
666 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700667 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
668 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700669 }
670 optional State state = 2;
671}
672
673/**
674 * Logs when the camera state changes.
675 *
676 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700677 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700678 */
679message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800680 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700681
682 enum State {
683 OFF = 0;
684 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700685 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
686 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700687 }
688 optional State state = 2;
689}
690
691/**
692 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000693 *
694 * Logged from:
695 * TODO
696 */
Bookatzd6746242017-10-24 18:39:35 -0700697message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800698 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000699
Bookatz1a1b0462018-01-12 11:47:03 -0800700 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
701 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700702 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700703
704 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
705 optional string tag = 3;
706
707 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800708 RELEASE = 0;
709 ACQUIRE = 1;
710 CHANGE_RELEASE = 2;
711 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700712 }
713 optional State state = 4;
714}
715
716/**
Bookatzc1a050a2017-10-10 15:49:28 -0700717 * Logs when a partial wakelock is considered 'long' (over 1 min).
718 *
719 * Logged from:
720 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
721 */
722message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800723 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700724
Yao Chend54f9dd2017-10-17 17:37:48 +0000725 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
726 optional string tag = 2;
727
Bookatzc1a050a2017-10-10 15:49:28 -0700728 // TODO: I have no idea what this is.
729 optional string history_tag = 3;
730
731 enum State {
732 OFF = 0;
733 ON = 1;
734 }
735 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000736}
737
Bookatzc1a050a2017-10-10 15:49:28 -0700738/**
Bookatza66083f2018-09-20 17:24:00 -0700739 * Logs when the device is interactive, according to the PowerManager Notifier.
740 *
741 * Logged from:
742 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
743 */
744message InteractiveStateChanged {
745 enum State {
746 OFF = 0;
747 ON = 1;
748 }
749 optional State state = 1;
750}
751
752/**
Bookatzc1a050a2017-10-10 15:49:28 -0700753 * Logs Battery Saver state change.
754 *
755 * Logged from:
756 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
757 */
758message BatterySaverModeStateChanged {
759 enum State {
760 OFF = 0;
761 ON = 1;
762 }
763 optional State state = 1;
764}
765
766/**
767 * Logs Doze mode state change.
768 *
769 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800770 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700771 */
772message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800773 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800774}
775
776
777/**
778 * Logs state change of Doze mode including maintenance windows.
779 *
780 * Logged from:
781 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
782 */
783message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800784 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700785}
786
787/**
788 * Logs screen brightness level.
789 *
790 * Logged from:
791 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
792 */
793message ScreenBrightnessChanged {
794 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
795 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700796}
797
798/**
799 * Logs battery level (percent full, from 0 to 100).
800 *
801 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700802 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700803 */
804message BatteryLevelChanged {
805 // Battery level. Should be in [0, 100].
806 optional int32 battery_level = 1;
807}
808
809/**
810 * Logs change in charging status of the device.
811 *
812 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700813 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700814 */
815message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800816 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
817 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700818}
819
820/**
821 * Logs whether the device is plugged in, and what power source it is using.
822 *
823 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700824 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700825 */
826message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800827 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
828 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700829}
830
Bookatz8c6571b2017-10-24 15:04:41 -0700831/**
832 * Logs when an app's wakeup alarm fires.
833 *
834 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700835 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700836 */
837message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800838 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800839
840 // Name of the wakeup alarm.
841 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700842
843 // Name of source package (for historical reasons, since BatteryStats tracked it).
844 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800845}
846
847/**
848 * Logs when an an app causes the mobile radio to change state.
849 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
850 *
851 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700852 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800853 */
854message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800855 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800856
Bookatz1a1b0462018-01-12 11:47:03 -0800857 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
858 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800859}
860
861/**
862 * Logs when an an app causes the wifi radio to change state.
863 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
864 *
865 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700866 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800867 */
868message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800869 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800870
Bookatz1a1b0462018-01-12 11:47:03 -0800871 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
872 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700873}
874
875/**
876 * Logs kernel wakeup reasons and aborts.
877 *
878 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700879 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700880 */
881message KernelWakeupReported {
882 // Name of the kernel wakeup reason (or abort).
883 optional string wakeup_reason_name = 1;
884
885 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800886 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700887}
888
889/**
Bookatzda1798c2018-12-13 14:16:00 -0800890 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800891 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800892 *
893 * Logged from:
894 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
895 */
896message WifiEnabledStateChanged {
897 enum State {
898 OFF = 0;
899 ON = 1;
900 }
901 optional State state = 1;
902}
903
904/**
905 * 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 -0800906 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
907 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800908 *
909 * Logged from:
910 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
911 */
912message WifiRunningStateChanged {
913 repeated AttributionNode attribution_node = 1;
914
915 enum State {
916 OFF = 0;
917 ON = 1;
918 }
919 optional State state = 2;
920}
921
922/**
Bookatze5885242017-10-24 20:10:31 -0700923 * Logs wifi locks held by an app.
924 *
925 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700926 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700927 */
928message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800929 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700930
931 enum State {
932 OFF = 0;
933 ON = 1;
934 }
935 optional State state = 2;
936}
937
938/**
939 * Logs wifi signal strength changes.
940 *
941 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800942 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -0700943 */
944message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800945 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
946 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700947}
948
949/**
950 * Logs wifi scans performed by an app.
951 *
952 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800953 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -0700954 */
955message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800956 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700957
958 enum State {
959 OFF = 0;
960 ON = 1;
961 }
962 optional State state = 2;
963}
964
965/**
Tej Singh4503e102018-01-04 14:35:01 -0800966 * Logs wifi multicast locks held by an app
967 *
968 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800969 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -0800970 */
971message WifiMulticastLockStateChanged {
972 repeated AttributionNode attribution_node = 1;
973
974 enum State {
975 OFF = 0;
976 ON = 1;
977 }
978 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -0800979
980 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -0800981}
982
983/**
Tej Singh1ea42892018-01-19 09:27:00 -0800984 * Logs shutdown reason and duration on next boot.
985 *
986 * Logged from:
987 * frameworks/base/core/java/com/android/server/BootReceiver.java
988 */
989message ShutdownSequenceReported {
990 // True if shutdown is for a reboot. Default: false if we do not know.
991 optional bool reboot = 1;
992
993 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
994 optional string reason = 2;
995
996 // Beginning of shutdown time in ms using wall clock time since unix epoch.
997 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800998 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800999
1000 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001001 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001002}
1003
Tej Singh6483ea42018-01-25 17:45:49 -08001004
1005/**
1006 * Logs boot reason and duration.
1007 *
1008 * Logged from:
1009 * system/core/bootstat/bootstat.cpp
1010 */
1011message BootSequenceReported {
1012 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1013 // Default: "<EMPTY>" if not available.
1014 optional string bootloader_reason = 1;
1015
1016 // Reason for system boot. Eg. bootloader, reboot,userrequested
1017 // Default: "<EMPTY>" if not available.
1018 optional string system_reason = 2;
1019
1020 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001021 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001022
1023 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001024 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001025
1026 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001027 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001028
1029 // Time since last boot in ms. Default: 0 if not available.
1030 optional int64 time_since_last_boot = 6;
1031}
1032
Tej Singhc477d9c2018-02-05 18:31:39 -08001033
1034/**
1035 * Logs call state and disconnect cause (if applicable).
1036 *
1037 * Logged from:
1038 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1039 */
1040message CallStateChanged {
1041 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1042 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1043 optional android.telecom.CallStateEnum call_state = 1;
1044
1045 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1046 // This value is only applicable when the call_state is DISCONNECTED, and
1047 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1048 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1049 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1050
1051 // True if the call is self-managed, which are apps that use the
1052 // telecom infrastructure to make their own calls.
1053 optional bool self_managed = 3;
1054
1055 // True if call is external. External calls are calls on connected Wear
1056 // devices but show up in Telecom so the user can pull them onto the device.
1057 optional bool external_call = 4;
1058}
1059
Tej Singh1ea42892018-01-19 09:27:00 -08001060/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001061 * Logs keyguard state. The keyguard is the lock screen.
1062 *
1063 * Logged from:
1064 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1065 */
1066message KeyguardStateChanged {
1067 enum State {
1068 UNKNOWN = 0;
1069 // The keyguard is hidden when the phone is unlocked.
1070 HIDDEN = 1;
1071 // The keyguard is shown when the phone is locked (screen turns off).
1072 SHOWN= 2;
1073 // The keyguard is occluded when something is overlaying the keyguard.
1074 // Eg. Opening the camera while on the lock screen.
1075 OCCLUDED = 3;
1076 }
1077 optional State state = 1;
1078}
1079
1080/**
1081 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1082 * prompts the user to enter a password (pattern, pin, etc).
1083 *
1084 * Logged from:
1085 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1086 */
1087
1088message KeyguardBouncerStateChanged {
1089 enum State {
1090 UNKNOWN = 0;
1091 // Bouncer is hidden, either as a result of successfully entering the
1092 // password, screen timing out, or user going back to lock screen.
1093 HIDDEN = 1;
1094 // This is when the user is being prompted to enter the password.
1095 SHOWN = 2;
1096 }
1097 optional State state = 1;
1098}
1099
1100/**
1101 * Logs the result of entering a password into the keyguard bouncer.
1102 *
1103 * Logged from:
1104 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1105 */
1106message KeyguardBouncerPasswordEntered {
1107 enum BouncerResult {
1108 UNKNOWN = 0;
1109 // The password entered was incorrect.
1110 FAILURE = 1;
1111 // The password entered was correct.
1112 SUCCESS = 2;
1113 }
1114 optional BouncerResult result = 1;
1115}
1116
Tej Singha883b372018-02-15 11:30:01 -08001117/*
1118 * Logs changes to the configuration of the device. The configuration is defined
1119 * in frameworks/base/core/java/android/content/res/Configuration.java
1120 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1121 * Please go there to interpret the possible values each field can be.
1122 *
1123 * Logged from:
1124 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1125 */
1126message ResourceConfigurationChanged {
1127 // Bit mask of color capabilities of the screen.
1128 // Contains information about the color gamut and hdr mode of the screen.
1129 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001130 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001131
1132 // The target screen density being rendered to.
1133 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001134 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001135
1136 // Current user preference for the scaling factor for fonts,
1137 // relative to the base density scaling.
1138 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001139 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001140
1141 // Flag indicating whether the hard keyboard is hidden.
1142 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001143 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001144
1145 // The type of keyboard attached to the device.
1146 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1147 optional int32 keyboard = 5;
1148
1149 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1150 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001151 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001152
1153 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1154 // 0 if undefined.
1155 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1156 optional int32 mcc = 7;
1157
1158 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1159 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1160 // MNC_ZERO symbol defined in Configuration.java.
1161 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1162 optional int32 mnc = 8;
1163
1164 // The kind of navigation available on the device.
1165 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1166 optional int32 navigation = 9;
1167
1168 // Flag indicating whether the navigation is available.
1169 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001170 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001171
1172 // Overall orientation of the screen.
1173 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1174 optional int32 orientation = 11;
1175
1176 // The current height of the available screen space, in dp units.
1177 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001178 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001179
1180 // Bit mask of overall layout of the screen.
1181 // Contains information about screen size, whether the screen is wider/taller
1182 // than normal, whether the screen layout is right-tl-left or left-to-right,
1183 // and whether the screen has a rounded shape.
1184 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001185 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001186
1187 // Current width of the available screen space, in dp units.
1188 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001189 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001190
1191 // The smallest screen size an application will see in normal operation.
1192 // This is the smallest value of both screenWidthDp and screenHeightDp
1193 // in portrait and landscape.
1194 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001195 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001196
1197 // The type of touch screen attached to the device.
1198 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1199 optional int32 touchscreen = 16;
1200
1201 // Bit mask of the ui mode.
1202 // Contains information about the overall ui mode of the device.
1203 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1204 // Also contains information about whether the device is in night mode.
1205 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001206 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001207}
1208
Tej Singheee317b2018-03-07 19:28:05 -08001209
1210/**
1211 * Logs changes in the connection state of the mobile radio.
1212 *
1213 * Logged from:
1214 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1215 */
1216message MobileConnectionStateChanged {
1217 // States are from the state machine DataConnection.java.
1218 enum State {
1219 UNKNOWN = 0;
1220 // The connection is inactive, or disconnected.
1221 INACTIVE = 1;
1222 // The connection is being activated, or connecting.
1223 ACTIVATING = 2;
1224 // The connection is active, or connected.
1225 ACTIVE = 3;
1226 // The connection is disconnecting.
1227 DISCONNECTING = 4;
1228 // The connection is disconnecting after creating a connection.
1229 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1230 }
1231 optional State state = 1;
1232 // For multi-sim phones, this distinguishes between the sim cards.
1233 optional int32 sim_slot_index = 2;
1234 // Used to identify the connection. Starts at 0 and increments by 1 for
1235 // every new network created. Resets whenever the device reboots.
1236 optional int32 data_connection_id = 3;
1237 // A bitmask for the capabilities of this connection.
1238 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1239 // Default value (if we have no information): 0
1240 optional int64 capabilities = 4;
1241 // If this connection has internet.
1242 // This just checks if the DEFAULT bit of capabilities is set.
1243 optional bool has_internet = 5;
1244}
1245
1246/**
1247 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1248 *
1249 * Logged from:
1250 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1251 */
1252message MobileRadioTechnologyChanged {
1253 optional android.telephony.NetworkTypeEnum state = 1;
1254 // For multi-sim phones, this distinguishes between the sim cards.
1255 optional int32 sim_slot_index = 2;
1256}
1257
Andrew Chantb56388b2018-03-22 21:07:33 -07001258/**
1259 * Logs the VID and PID of any connected USB devices.
1260 *
1261 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1262 *
1263 * Logged by Vendor.
1264 */
1265message UsbDeviceAttached {
1266 optional int32 vid = 1;
1267 optional int32 pid = 2;
1268 optional bool has_audio = 3;
1269 optional bool has_hid = 4;
1270 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001271 enum State {
1272 STATE_DISCONNECTED = 0;
1273 STATE_CONNECTED = 1;
1274 }
1275 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001276 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001277}
1278
Tej Singheee317b2018-03-07 19:28:05 -08001279
Tej Singhdd7bd352018-02-09 19:33:15 -08001280/**
Tej Singh5d991e12018-03-09 19:48:11 -08001281 * Logs when Bluetooth is enabled and disabled.
1282 *
1283 * Logged from:
1284 * services/core/java/com/android/server/BluetoothManagerService.java
1285 */
1286message BluetoothEnabledStateChanged {
1287 repeated AttributionNode attribution_node = 1;
1288 // Whether or not bluetooth is enabled on the device.
1289 enum State {
1290 UNKNOWN = 0;
1291 ENABLED = 1;
1292 DISABLED = 2;
1293 }
1294 optional State state = 2;
1295 // The reason for being enabled/disabled.
1296 // Eg. Airplane mode, crash, application request.
1297 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1298 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001299 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001300}
1301
1302/**
1303 * Logs when a Bluetooth device connects and disconnects.
1304 *
1305 * Logged from:
1306 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1307 */
1308message BluetoothConnectionStateChanged {
1309 // The state of the connection.
1310 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1311 optional android.bluetooth.ConnectionStateEnum state = 1;
1312 // An identifier that can be used to match connect and disconnect events.
1313 // Currently is last two bytes of a hash of a device level ID and
1314 // the mac address of the bluetooth device that is connected.
1315 optional int32 obfuscated_id = 2;
1316 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1317 // From android.bluetooth.BluetoothAdapter.java
1318 optional int32 bt_profile = 3;
1319}
1320
Jack Heab86dbd22018-12-18 15:43:27 -08001321// Logs when there is an event affecting Bluetooth device's link layer connection.
1322// - This event is triggered when there is a related HCI command or event
1323// - Users of this metrics can deduce Bluetooth device's connection state from these events
1324// - HCI commands are logged before the command is sent, after receiving command status, and after
1325// receiving command complete
1326// - HCI events are logged when they arrive
1327//
1328// Low level log from system/bt
1329//
1330// Bluetooth classic commands:
1331// - CMD_CREATE_CONNECTION
1332// - CMD_DISCONNECT
1333// - CMD_CREATE_CONNECTION_CANCEL
1334// - CMD_ACCEPT_CONNECTION_REQUEST
1335// - CMD_REJECT_CONNECTION_REQUEST
1336// - CMD_SETUP_ESCO_CONNECTION
1337// - CMD_ACCEPT_ESCO_CONNECTION
1338// - CMD_REJECT_ESCO_CONNECTION
1339// - CMD_ENH_SETUP_ESCO_CONNECTION
1340// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1341//
1342// Bluetooth low energy commands:
1343// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1344// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1345// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1346// - CMD_BLE_CLEAR_WHITE_LIST
1347// - CMD_BLE_ADD_WHITE_LIST
1348// - CMD_BLE_REMOVE_WHITE_LIST
1349//
1350// Bluetooth classic events:
1351// - EVT_CONNECTION_COMP
1352// - EVT_CONNECTION_REQUEST
1353// - EVT_DISCONNECTION_COMP
1354// - EVT_ESCO_CONNECTION_COMP
1355// - EVT_ESCO_CONNECTION_CHANGED
1356//
1357// Bluetooth low energy meta events:
1358// - BLE_EVT_CONN_COMPLETE_EVT
1359// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1360//
1361// Next tag: 10
1362message BluetoothLinkLayerConnectionEvent {
1363 // An identifier that can be used to match events for this device.
1364 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1365 // Salt: Randomly generated 256 bit value
1366 // Hash algorithm: HMAC-SHA256
1367 // Size: 32 byte
1368 // Default: null or empty if the device identifier is not known
1369 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1370 // Connection handle of this connection if available
1371 // Range: 0x0000 - 0x0EFF (12 bits)
1372 // Default: 0xFFFF if the handle is unknown
1373 optional int32 connection_handle = 2;
1374 // Direction of the link
1375 // Default: DIRECTION_UNKNOWN
1376 optional android.bluetooth.DirectionEnum direction = 3;
1377 // Type of this link
1378 // Default: LINK_TYPE_UNKNOWN
1379 optional android.bluetooth.LinkTypeEnum type = 4;
1380
1381 // Reason metadata for this link layer connection event, rules for interpretation:
1382 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1383 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1384 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1385 // set and valid, ignore hci_ble_event
1386
1387 // HCI command associated with this event
1388 // Default: CMD_UNKNOWN
1389 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1390 // HCI event associated with this event
1391 // Default: EVT_UNKNOWN
1392 optional android.bluetooth.hci.EventEnum hci_event = 6;
1393 // HCI BLE meta event associated with this event
1394 // Default: BLE_EVT_UNKNOWN
1395 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1396 // HCI command status code if this is triggerred by hci_cmd
1397 // Default: STATUS_UNKNOWN
1398 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1399 // HCI reason code associated with this event
1400 // Default: STATUS_UNKNOWN
1401 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1402}
1403
1404
Tej Singh5d991e12018-03-09 19:48:11 -08001405/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001406 * Logs when something is plugged into or removed from the USB-C connector.
1407 *
1408 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001409 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08001410 */
1411message UsbConnectorStateChanged {
1412 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001413 STATE_DISCONNECTED = 0;
1414 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08001415 }
1416 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001417 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08001418 // Last active session in ms.
1419 // 0 when the port is in connected state.
1420 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001421}
1422
1423/**
1424 * Logs the reported speaker impedance.
1425 *
1426 * Logged from:
1427 * Vendor audio implementation.
1428 */
1429message SpeakerImpedanceReported {
1430 optional int32 speaker_location = 1;
1431 optional int32 impedance = 2;
1432}
1433
1434/**
1435 * Logs the report of a failed hardware.
1436 *
1437 * Logged from:
1438 * Vendor HALs.
1439 *
1440 */
1441message HardwareFailed {
1442 enum HardwareType {
1443 HARDWARE_FAILED_UNKNOWN = 0;
1444 HARDWARE_FAILED_MICROPHONE = 1;
1445 HARDWARE_FAILED_CODEC = 2;
1446 HARDWARE_FAILED_SPEAKER = 3;
1447 HARDWARE_FAILED_FINGERPRINT = 4;
1448 }
1449 optional HardwareType hardware_type = 1;
1450
1451 /* hardware_location allows vendors to differentiate between multiple instances of
1452 * the same hardware_type. The specific locations are vendor defined integers,
1453 * referring to board-specific numbering schemes.
1454 */
1455 optional int32 hardware_location = 2;
1456
1457 /* failure_code is specific to the HardwareType of the failed hardware.
1458 * It should use the enum values defined below.
1459 */
1460 enum MicrophoneFailureCode {
1461 MICROPHONE_FAILURE_COMPLETE = 0;
1462 }
1463 enum CodecFailureCode {
1464 CODEC_FAILURE_COMPLETE = 0;
1465 }
1466 enum SpeakerFailureCode {
1467 SPEAKER_FAILURE_COMPLETE = 0;
1468 SPEAKER_FAILURE_HIGH_Z = 1;
1469 SPEAKER_FAILURE_SHORT = 2;
1470 }
1471 enum FingerprintFailureCode {
1472 FINGERPRINT_FAILURE_COMPLETE = 0;
1473 FINGERPRINT_SENSOR_BROKEN = 1;
1474 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1475 }
1476 optional int32 failure_code = 3;
1477}
1478
1479/**
1480 * Log an event when the device has been physically dropped.
1481 * Reported from the /vendor partition.
1482 */
1483message PhysicalDropDetected {
1484 // Confidence that the event was actually a drop, 0 -> 100
1485 optional int32 confidence_pctg = 1;
1486 // Peak acceleration of the drop, in 1/1000s of a g.
1487 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001488 // Duration of freefall in ms
1489 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001490}
1491
1492/**
1493 * Log bucketed battery charge cycles.
1494 *
1495 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08001496 * a given charge point. For example, if 10 cycle buckets are
1497 * initialized, bucket 1 is the lowest 1/10th of the battery,
1498 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08001499 *
1500 * Logged from:
1501 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1502 */
1503message ChargeCyclesReported {
1504 optional int32 cycle_bucket_1 = 1;
1505 optional int32 cycle_bucket_2 = 2;
1506 optional int32 cycle_bucket_3 = 3;
1507 optional int32 cycle_bucket_4 = 4;
1508 optional int32 cycle_bucket_5 = 5;
1509 optional int32 cycle_bucket_6 = 6;
1510 optional int32 cycle_bucket_7 = 7;
1511 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08001512 optional int32 cycle_bucket_9 = 9;
1513 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08001514}
1515
1516/**
Howard Roa46b6582018-09-18 16:45:02 -07001517 * Log battery health snapshot.
1518 *
1519 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1520 * are snapshotted periodically over 24hrs.
1521 */
1522message BatteryHealthSnapshot {
1523 enum BatterySnapshotType {
1524 UNKNOWN = 0;
1525 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1526 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1527 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1528 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1529 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1530 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1531 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1532 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1533 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1534 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1535 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1536 }
1537 optional BatterySnapshotType type = 1;
1538 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001539 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001540 // Voltage Battery Voltage, in microVolts.
1541 optional int32 voltage_micro_volt = 3;
1542 // Current Battery current, in microAmps.
1543 optional int32 current_micro_amps = 4;
1544 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1545 optional int32 open_circuit_micro_volt = 5;
1546 // Resistance Battery Resistance, in microOhms.
1547 optional int32 resistance_micro_ohm = 6;
1548 // Level Battery Level, as % of full.
1549 optional int32 level_percent = 7;
1550}
1551
1552/**
1553 * Log slow I/O operations on the primary storage.
1554 */
1555message SlowIo {
1556 // Classifications of IO Operations.
1557 enum IoOperation {
1558 UNKNOWN = 0;
1559 READ = 1;
1560 WRITE = 2;
1561 UNMAP = 3;
1562 SYNC = 4;
1563 }
1564 optional IoOperation operation = 1;
1565
1566 // The number of slow IO operations of this type over 24 hours.
1567 optional int32 count = 2;
1568}
1569
1570/**
1571 * Log battery caused shutdown with the last recorded voltage.
1572 */
1573message BatteryCausedShutdown {
1574 // The last recorded battery voltage prior to shutdown.
1575 optional int32 last_recorded_micro_volt = 1;
1576}
1577
1578/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001579 * Logs the duration of a davey (jank of >=700ms) when it occurs
1580 *
1581 * Logged from:
1582 * frameworks/base/libs/hwui/JankTracker.cpp
1583 */
1584message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001585 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001586 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001587
Tej Singhbb8554a2018-01-26 11:59:14 -08001588 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001589 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001590}
1591
1592/**
Bookatze5885242017-10-24 20:10:31 -07001593 * Logs phone signal strength changes.
1594 *
1595 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001596 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001597 */
1598message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001599 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1600 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001601}
1602
Yangster4ccebea2018-10-09 17:09:02 -07001603
1604/**
1605 * Logs when the phone state, sim state or signal strength changes
1606 *
1607 * Logged from:
1608 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1609 */
1610message PhoneServiceStateChanged {
1611 optional android.telephony.ServiceStateEnum state = 1;
1612 optional android.telephony.SimStateEnum sim_state = 2;
1613 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1614}
1615
1616/**
1617 * Logs when the phone becomes on or off.
1618 *
1619 * Logged from:
1620 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1621 */
1622message PhoneStateChanged {
1623 enum State {
1624 OFF = 0;
1625 ON = 1;
1626 }
1627 optional State state = 1;
1628}
1629
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001630message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07001631 optional android.stats.launcher.LauncherAction action = 1;
1632 optional android.stats.launcher.LauncherState src_state = 2;
1633 optional android.stats.launcher.LauncherState dst_state = 3;
1634 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001635 optional bool is_swipe_up_enabled = 5;
1636}
1637
David Chenc28b2bb2017-10-24 12:52:52 -07001638/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001639 * Logs when Settings UI has changed.
1640 *
1641 * Logged from:
1642 * packages/apps/Settings
1643 */
1644message SettingsUIChanged {
1645 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001646 * Where this SettingsUIChange event comes from. For example, if
1647 * it's a PAGE_VISIBLE event, where the page is opened from.
1648 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001649 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001650
1651 /**
1652 * What the UI action is.
1653 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001654 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001655
1656 /**
1657 * Where the action is happening
1658 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001659 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001660
1661 /**
1662 * What preference changed in this event.
1663 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001664 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07001665
1666 /**
1667 * The new value of the changed preference.
1668 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001669 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07001670}
1671
1672/**
David Chenc28b2bb2017-10-24 12:52:52 -07001673 * Logs that a setting was updated.
1674 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001675 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001676 * The tag and is_default allow resetting of settings to default values based on the specified
1677 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1678 */
1679message SettingChanged {
1680 // The name of the setting.
1681 optional string setting = 1;
1682
1683 // The change being imposed on this setting. May represent a number, eg "3".
1684 optional string value = 2;
1685
1686 // The new value of this setting. For most settings, this is same as value. For some settings,
1687 // value is +X or -X where X represents an element in a set. For example, if the previous value
1688 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1689 // The +/- feature is currently only used for location_providers_allowed.
1690 optional string new_value = 3;
1691
1692 // The previous value of this setting.
1693 optional string prev_value = 4;
1694
1695 // The tag used with the is_default for resetting sets of settings. This is generally null.
1696 optional string tag = 5;
1697
Bookatz90867622018-01-31 15:05:57 -08001698 // True if this setting with tag should be resettable.
1699 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001700
David Chenbd789912018-03-16 17:19:55 -07001701 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001702 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001703
1704 enum ChangeReason {
1705 UPDATED = 1; // Updated can be an insertion or an update.
1706 DELETED = 2;
1707 }
1708 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001709}
Chenjie Yub3dda412017-10-24 13:41:59 -07001710
Chenjie Yu05013b32017-11-21 10:21:41 -08001711/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001712 * Logs activity going to foreground or background
1713 *
1714 * Logged from:
1715 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1716 */
1717message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001718 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001719 optional string pkg_name = 2;
1720 optional string class_name = 3;
1721
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001722 enum State {
1723 BACKGROUND = 0;
1724 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001725 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001726 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001727}
David Chenc8a43242017-10-17 16:23:28 -07001728
1729/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001730 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001731 * Logged from:
1732 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1733 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001734message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001735 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001736
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001737 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001738
1739 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001740 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001741 optional string process_name = 3;
1742
1743 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001744 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001745
1746 optional string package_name = 5;
1747
1748 enum InstantApp {
1749 UNAVAILABLE = 0;
1750 FALSE = 1;
1751 TRUE = 2;
1752 }
1753 optional InstantApp is_instant_app = 6;
1754
1755 enum ForegroundState {
1756 UNKNOWN = 0;
1757 BACKGROUND = 1;
1758 FOREGROUND = 2;
1759 }
1760 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08001761
1762 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001763}
David Chen9e3808c2017-11-20 17:25:34 -08001764
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001765/**
1766 * Logs when a WTF (What a Terrible Failure) happened.
1767 * Logged from:
1768 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1769 */
1770message WTFOccurred {
1771 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001772
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001773 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001774
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001775 // The name of the process.
1776 // system_server if it is not by an app
1777 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001778
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001779 // The pid if available. -1 means not available.
1780 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08001781
1782 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001783}
1784
1785/**
1786 * Logs when system server reports low memory.
1787 * Logged from:
1788 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1789 */
1790message LowMemReported {
1791}
1792
1793/**
1794 * Logs when an app ANR (App Not Responding) occurs.
1795 * Logged from:
1796 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1797 */
1798message ANROccurred {
1799 optional int32 uid = 1 [(is_uid) = true];
1800
1801 optional string process_name = 2;
1802
1803 optional string short_component_name = 3;
1804
1805 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001806
1807 enum InstantApp {
1808 UNAVAILABLE = 0;
1809 FALSE = 1;
1810 TRUE = 2;
1811 }
1812 optional InstantApp is_instant_app = 5;
1813
1814 enum ForegroundState {
1815 UNKNOWN = 0;
1816 BACKGROUND = 1;
1817 FOREGROUND = 2;
1818 }
1819 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08001820
1821 optional android.server.ErrorSource error_source = 7;
1822
1823 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08001824}
1825
Bookatza7020bd2018-08-28 16:29:35 -07001826/**
1827 * Logs when the vibrator state changes.
1828 * Logged from:
1829 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1830 */
1831message VibratorStateChanged {
1832 repeated AttributionNode attribution_node = 1;
1833
1834 enum State {
1835 OFF = 0;
1836 ON = 1;
1837 }
1838 optional State state = 2;
1839
1840 // Duration (in milliseconds) requested to keep the vibrator on.
1841 // Only applicable for State == ON.
1842 optional int64 duration_millis = 3;
1843}
1844
David Chen0a368b22017-12-06 16:28:16 -08001845/*
1846 * Allows other apps to push events into statsd.
1847 * Logged from:
1848 * frameworks/base/core/java/android/util/StatsLog.java
1849 */
David Chen0b5c90c2018-01-25 16:51:49 -08001850message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001851 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001852 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001853
1854 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1855 optional int32 label = 2;
1856
1857 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1858 // predicates for the metrics).
1859 enum State {
1860 UNKNOWN = 0;
1861 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1862 STOP = 2;
1863 START = 3;
1864 }
1865 optional State state = 3;
1866}
1867
David Chen9e3808c2017-11-20 17:25:34 -08001868/**
Bookatz7948c872018-09-04 12:58:33 -07001869 * Logs the wall-clock time when a significant wall-clock time shift occurs.
1870 * For example, this could be due to the user manually changing the time.
1871 *
1872 * Logged from:
1873 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
1874 */
1875message WallClockTimeShifted {
1876 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
1877 optional int64 wall_clock_timestamp_millis = 1;
1878}
1879
1880/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001881 * Logs when statsd detects an anomaly.
1882 *
1883 * Logged from:
1884 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1885 */
1886message AnomalyDetected {
1887 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001888 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001889
Yangster-mac94e197c2018-01-02 16:03:03 -08001890 // Id of the config whose anomaly detection alert fired.
1891 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001892
Yangster-mac94e197c2018-01-02 16:03:03 -08001893 // Id of the alert (i.e. name of the anomaly that was detected).
1894 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001895}
1896
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001897message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001898 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001899 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001900
1901 // The app package name.
1902 optional string pkg_name = 2;
1903
1904 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001905 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001906 WARM = 1;
1907 HOT = 2;
1908 COLD = 3;
1909 }
1910 // The transition type.
1911 optional TransitionType type = 3;
1912
1913 // The activity name.
1914 optional string activity_name = 4;
1915
1916 // The name of the calling app. Empty if not set.
1917 optional string calling_pkg_name = 5;
1918
1919 // Whether the app is an instant app.
1920 optional bool is_instant_app = 6;
1921
1922 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001923 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001924
Bookatz80d11a02018-01-16 10:46:35 -08001925 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001926
David Chen0b5c90c2018-01-25 16:51:49 -08001927 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001928 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001929 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001930 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001931 optional int32 bind_application_delay_millis = 11;
1932 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001933
1934 // Empty if not set.
1935 optional string launch_token = 13;
1936
Calin Juravle759fbda2018-02-20 19:52:30 +00001937 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001938 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001939
1940 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001941 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001942}
1943
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001944message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001945 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001946 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001947
1948 // The app package name.
1949 optional string pkg_name = 2;
1950
1951 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001952 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001953 WARM = 1;
1954 HOT = 2;
1955 COLD = 3;
1956 }
1957 // The transition type.
1958 optional TransitionType type = 3;
1959
1960 // The activity name.
1961 optional string activity_name = 4;
1962}
1963
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001964message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001965 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001966 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001967
1968 // The app package name.
1969 optional string pkg_name = 2;
1970
1971 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001972 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001973 WITH_BUNDLE = 1;
1974 WITHOUT_BUNDLE = 2;
1975 }
1976 // The transition type.
1977 optional TransitionType type = 3;
1978
1979 // The activity name.
1980 optional string activity_name = 4;
1981
1982 optional bool transition_process_running = 5;
1983
1984 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001985 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001986}
1987
Bookatz8fcd09a2017-12-18 13:01:10 -08001988/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001989 * Logs a picture-in-picture action
1990 * Logged from:
1991 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1992 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1993 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1994 */
1995message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001996 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001997 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001998
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001999 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002000
Chenjie Yu52cacc62017-12-08 18:11:45 -08002001 enum State {
2002 ENTERED = 1;
2003 EXPANDED_TO_FULL_SCREEN = 2;
2004 MINIMIZED = 3;
2005 DISMISSED = 4;
2006 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002007 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002008}
2009
2010/**
Chenjie Yue8904192017-12-08 19:12:57 -08002011 * Logs overlay action
2012 * Logged from:
2013 * services/core/java/com/android/server/wm/Session.java
2014 */
2015message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002016 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002017
2018 optional string package_name = 2;
2019
2020 optional bool using_alert_window = 3;
2021
2022 enum State {
2023 ENTERED = 1;
2024 EXITED = 2;
2025 }
2026 optional State state = 4;
2027}
2028
Chenjie Yuccfe6452018-01-30 11:33:21 -08002029/*
2030 * Logs foreground service starts and stops.
2031 * Note that this is not when a service starts or stops, but when it is
2032 * considered foreground.
2033 * Logged from
2034 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2035 */
2036message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002037 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002038 // package_name + "/" + class_name
2039 optional string short_name = 2;
2040
2041 enum State {
2042 ENTER = 1;
2043 EXIT = 2;
2044 }
2045 optional State state = 3;
2046}
2047
Chenjie Yue8904192017-12-08 19:12:57 -08002048/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002049 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2050 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2051 * attributed back to the parent (host) uid. One example is Chrome.
2052 *
2053 * Logged from:
2054 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2055 */
2056message IsolatedUidChanged {
2057 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002058 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002059 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002060 optional int32 parent_uid = 1;
2061
2062 optional int32 isolated_uid = 2;
2063
2064 // We expect an isolated uid to be removed before if it's used for another parent uid.
2065 enum Event {
2066 REMOVED = 0;
2067 CREATED = 1;
2068 }
2069 optional Event event = 3;
2070}
2071
2072/*
2073 * Logs the reception of an incoming network packet causing the main system to wake up for
2074 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2075 * and processed by WakeupController.cpp.
2076 */
2077message PacketWakeupOccurred {
2078 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2079 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002080 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002081 // The interface name on which the packet was received.
2082 optional string iface = 2;
2083 // The ethertype value of the packet.
2084 optional int32 ethertype = 3;
2085 // String representation of the destination MAC address of the packet.
2086 optional string destination_hardware_address = 4;
2087 // String representation of the source address of the packet if this was an IP packet.
2088 optional string source_ip = 5;
2089 // String representation of the destination address of the packet if this was an IP packet.
2090 optional string destination_ip = 6;
2091 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2092 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2093 // families.
2094 optional int32 ip_next_header = 7;
2095 // The source port if this was a TCP or UDP packet.
2096 optional int32 source_port = 8;
2097 // The destination port if this was a TCP or UDP packet.
2098 optional int32 destination_port = 9;
2099}
2100
2101/*
2102 * Logs the memory stats for an app on startup.
2103 * Logged from:
2104 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2105 */
2106message AppStartMemoryStateCaptured {
2107 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002108 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002109
2110 // The process name.
2111 optional string process_name = 2;
2112
2113 // The activity name.
2114 optional string activity_name = 3;
2115
2116 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002117 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002118
2119 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002120 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002121
2122 // RSS
2123 optional int64 rss_in_bytes = 6;
2124
2125 // CACHE
2126 optional int64 cache_in_bytes = 7;
2127
2128 // SWAP
2129 optional int64 swap_in_bytes = 8;
2130}
2131
2132/*
2133 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2134 * for LMK event.
2135 * Logged from:
2136 * system/core/lmkd/lmkd.c
2137 */
2138message LmkStateChanged {
2139 enum State {
2140 UNKNOWN = 0;
2141 START = 1;
2142 STOP = 2;
2143 }
2144 optional State state = 1;
2145}
2146
2147/*
2148 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2149 * Logged from:
2150 * system/core/lmkd/lmkd.c
2151 */
2152message LmkKillOccurred {
2153 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002154 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002155
2156 // The process name.
2157 optional string process_name = 2;
2158
2159 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002160 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002161
2162 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002163 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002164
2165 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002166 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002167
2168 // RSS
2169 optional int64 rss_in_bytes = 6;
2170
2171 // CACHE
2172 optional int64 cache_in_bytes = 7;
2173
2174 // SWAP
2175 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002176
2177 // The elapsed real time of start of the process.
2178 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002179}
2180
Rajeev Kumar51b54602018-03-01 12:18:26 -08002181/*
2182 * Logs when the ActivityManagerService detects that an app died.
2183 *
2184 * Logged from:
2185 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2186 */
2187message AppDied {
2188 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002189 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002190}
2191
Howard Ro21a039c2018-08-06 14:55:47 -07002192/**
2193 * An atom for generic metrics logging. Available from Android Q.
2194 */
2195message GenericAtom {
2196 // The uid of the application that sent this custom atom.
2197 optional int32 uid = 1 [(is_uid) = true];
2198
2199 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002200 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002201}
2202
Tej Singhd6d6d772018-09-05 17:41:25 -07002203/**
2204 * Logs when a fingerprint acquire event occurs.
2205 *
2206 * Logged from:
2207 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2208 */
2209message FingerprintAcquired {
2210 // The associated user. Eg: 0 for owners, 10+ for others.
2211 // Defined in android/os/UserHandle.java
2212 optional int32 user = 1;
2213 // If this acquire is for a crypto fingerprint.
2214 // e.g. Secure purchases, unlock password storage.
2215 optional bool is_crypto = 2;
2216}
2217
2218/**
2219 * Logs when a fingerprint authentication event occurs.
2220 *
2221 * Logged from:
2222 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2223 */
2224message FingerprintAuthenticated {
2225 // The associated user. Eg: 0 for owners, 10+ for others.
2226 // Defined in android/os/UserHandle.java
2227 optional int32 user = 1;
2228 // If this authentication is for a crypto fingerprint.
2229 // e.g. Secure purchases, unlock password storage.
2230 optional bool is_crypto = 2;
2231 // Whether or not this authentication was successful.
2232 optional bool is_authenticated = 3;
2233}
2234
2235/**
2236 * Logs when a fingerprint error occurs.
2237 *
2238 * Logged from:
2239 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2240 */
2241message FingerprintErrorOccurred {
2242 // The associated user. Eg: 0 for owners, 10+ for others.
2243 // Defined in android/os/UserHandle.java
2244 optional int32 user = 1;
2245 // If this error is for a crypto fingerprint.
2246 // e.g. Secure purchases, unlock password storage.
2247 optional bool is_crypto = 2;
2248
2249 enum Error {
2250 UNKNOWN = 0;
2251 LOCKOUT = 1;
2252 PERMANENT_LOCKOUT = 2;
2253 }
2254 // The type of error.
2255 optional Error error = 3;
2256}
Howard Ro688ae182018-09-25 00:09:36 -07002257
2258message Notification {
2259
2260 // Type of notification event.
2261 enum Type {
2262 TYPE_UNKNOWN = 0;
2263 // Notification became visible to the user.
2264 TYPE_OPEN = 1;
2265 // Notification became hidden.
2266 TYPE_CLOSE = 2;
2267 // Notification switched to detail mode.
2268 TYPE_DETAIL = 3;
2269 // Notification was clicked.
2270 TYPE_ACTION = 4;
2271 // Notification was dismissed.
2272 TYPE_DISMISS = 5;
2273 // Notification switched to summary mode. The enum value of 14 is to
2274 // match that of metrics_constants.
2275 TYPE_COLLAPSE = 14;
2276 }
2277 optional Type type = 1;
2278
2279 // Package name associated with the notification.
2280 optional string package_name = 2;
2281
2282 // Tag associated with notification.
2283 optional string tag = 3;
2284
2285 // Application-supplied ID associated with the notification.
2286 optional int32 id = 4;
2287
2288 // Index of notification in the notification panel.
2289 optional int32 shade_index = 5;
2290
2291 // The number of notifications in the notification panel.
2292 optional int32 shade_count = 6;
2293
2294 // Importance for the notification.
2295 optional int32 importance = 7;
2296
2297 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002298 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002299
2300 // Importance for the notification channel.
2301 optional int32 channel_importance = 9;
2302
Howard Ro183c2bd2018-10-18 13:52:10 -07002303 // Application-supplied ID associated with the notifications group.
2304 optional string group_id = 10;
2305
Howard Ro688ae182018-09-25 00:09:36 -07002306 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002307 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002308
Howard Ro183c2bd2018-10-18 13:52:10 -07002309 // Reason for dismissal of a notification. This field is only meaningful for
2310 // TYPE_DISMISS events.
2311 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002312
Howard Ro183c2bd2018-10-18 13:52:10 -07002313 // The first post time of notification, stable across updates.
2314 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002315
Howard Ro183c2bd2018-10-18 13:52:10 -07002316 // The most recent interruption time, or the creation time if no updates.
2317 // Differs from update_millis because updates are filtered based on whether
2318 // they actually interrupted the user.
2319 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002320
Howard Ro183c2bd2018-10-18 13:52:10 -07002321 // The most recent update time, or the creation time if no updates.
2322 optional int64 update_millis = 15;
2323
2324 // The most recent visibility event.
2325 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002326}
2327
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002328/*
Yangster-macb89807e2018-11-15 21:10:57 -08002329 * Logs when a flag flip state changes.
2330 * Logged in P/h.
2331 */
2332message PhenotypeFlagStateChanged {
2333 // Mendel configuration name.
2334 optional string mendel_config_name = 1;
2335 // State
2336 enum State {
2337 STATE_UNKNOWN = 0;
2338 COMMITTED = 1;
2339 }
2340 optional State state = 2;
2341}
2342
2343/*
2344 * Logs when a binary push state changes.
2345 * Logged in Play store
2346 */
2347message BinaryPushStateChanged {
2348 // Binary package name.
2349 optional string binary_name = 1;
2350 // Version code.
2351 optional int64 version = 2;
2352 // State
2353 enum State {
2354 STATE_UNKNOWN = 0;
2355 DOWNLOAD_START = 1;
2356 DOWNLOAD_DONE = 2;
2357 INSTALL_START = 3;
2358 INSTALL_DONE = 4;
2359 REBOOT_START = 5;
2360 REBOOT_DONE = 6;
2361 }
2362 optional State state = 3;
2363}
2364
2365/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002366 * Logs when a connection becomes available and lost.
2367 * Logged in StatsCompanionService.java
2368 */
2369message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002370 // Id of the network.
2371 optional int32 net_id = 1;
2372
2373 enum State {
2374 UNKNOWN = 0;
2375 CONNECTED = 1;
2376 DISCONNECTED = 2;
2377 }
2378 // Connected state of a network.
2379 optional State state = 2;
2380}
2381
2382/**
2383 * Logs when a service starts and stops.
2384 * Logged from:
2385 * services/core/java/com/android/server/am/ActiveServices.java
2386 */
2387message ServiceStateChanged {
2388
2389 optional int32 uid = 1 [(is_uid) = true];
2390
2391 optional string package_name = 2;
2392
2393 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002394
2395 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002396 START = 1;
2397 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002398 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07002399
2400 optional State state = 4;
2401}
2402
2403/**
2404 * Logs when a service is launched.
2405 * Logged from:
2406 * services/core/java/com/android/server/am/ActiveServices.java
2407 */
2408message ServiceLaunchReported {
2409
2410 optional int32 uid = 1 [(is_uid) = true];
2411
2412 optional string package_name = 2;
2413
2414 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002415}
Howard Ro688ae182018-09-25 00:09:36 -07002416
Chenjie Yubbcbc602018-02-05 16:51:52 -08002417//////////////////////////////////////////////////////////////////////
2418// Pulled atoms below this line //
2419//////////////////////////////////////////////////////////////////////
2420
2421/**
David Chenc8a43242017-10-17 16:23:28 -07002422 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2423 *
2424 * Pulled from:
2425 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2426 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002427message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002428 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002429
2430 optional int64 rx_bytes = 2;
2431
2432 optional int64 rx_packets = 3;
2433
2434 optional int64 tx_bytes = 4;
2435
2436 optional int64 tx_packets = 5;
2437}
2438
2439/**
2440 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2441 *
2442 * Pulled from:
2443 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2444 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002445message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002446 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002447
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002448 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2449 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002450
2451 optional int64 rx_bytes = 3;
2452
2453 optional int64 rx_packets = 4;
2454
2455 optional int64 tx_bytes = 5;
2456
2457 optional int64 tx_packets = 6;
2458}
2459
2460/**
2461 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2462 *
2463 * Pulled from:
2464 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2465 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002466message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002467 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002468
2469 optional int64 rx_bytes = 2;
2470
2471 optional int64 rx_packets = 3;
2472
2473 optional int64 tx_bytes = 4;
2474
2475 optional int64 tx_packets = 5;
2476}
2477
2478/**
2479 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2480 *
2481 * Pulled from:
2482 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2483 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002484message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002485 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002486
Yao Chenc40a19d2018-03-15 16:48:25 -07002487 // 1 denotes foreground and 0 denotes background. This is called Set in
2488 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002489 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002490
2491 optional int64 rx_bytes = 3;
2492
2493 optional int64 rx_packets = 4;
2494
2495 optional int64 tx_bytes = 5;
2496
2497 optional int64 tx_packets = 6;
2498}
2499
2500/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002501 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2502 *
2503 * Pulled from:
2504 * StatsCompanionService
2505 */
2506message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002507 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002508
2509 optional int64 rx_bytes = 2;
2510
2511 optional int64 tx_bytes = 3;
2512}
2513
2514/**
David Chenc8a43242017-10-17 16:23:28 -07002515 * Pulls the kernel wakelock durations. This atom is adapted from
2516 * android/internal/os/KernelWakelockStats.java
2517 *
2518 * Pulled from:
2519 * StatsCompanionService using KernelWakelockReader.
2520 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002521message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002522 optional string name = 1;
2523
2524 optional int32 count = 2;
2525
2526 optional int32 version = 3;
2527
Yangster-maca8a30442018-10-13 23:46:34 -07002528 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002529}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002530
Chenjie Yu05013b32017-11-21 10:21:41 -08002531/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002532 * Pulls low power state information. If power.stats HAL is not available, this
2533 * includes platform and subsystem sleep state information,
2534 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
2535 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002536 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002537 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002538 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
2539 * as defined in:
2540 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002541 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002542message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002543 // Subsystem name
2544 optional string subsystem_name = 1;
2545 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2546 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002547 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
2548 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002549 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002550 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002551 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002552 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002553 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002554}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002555
Chenjie Yu05013b32017-11-21 10:21:41 -08002556/**
Bookatz92da2832018-11-01 18:10:03 -07002557 * Pulls on-device power measurement information.
2558 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
2559 * Pulled from:
2560 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
2561 */
2562message OnDevicePowerMeasurement {
2563 // Name of the subsystem (to which the rail belongs).
2564 optional string subsystem_name = 1;
2565
2566 // Rail name. The rail lies within the subsystem.
2567 optional string rail_name = 2;
2568
2569 // Time (in ms since boot) at which the rail energy value was measured.
2570 // This may differ slightly from the time that statsd logs this information.
2571 optional uint64 measurement_timestamp_millis = 3;
2572
2573 // Accumulated energy used via the rail since device boot in uWs.
2574 optional uint64 energy_microwatt_secs = 4;
2575}
2576
2577/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002578 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002579 * Pulls the time the cpu spend on the frequency index. Frequency index
2580 * starts from highest to lowest. The value should be monotonically
2581 * increasing since boot. However, if there is a cpu
2582 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002583 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002584message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002585 optional uint32 cluster = 1;
2586 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002587 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002588}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002589
Chenjie Yu05013b32017-11-21 10:21:41 -08002590/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002591 * Pulls Cpu Time Per Uid.
2592 * Note that isolated process uid time should be attributed to host uids.
2593 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002594message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002595 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002596 optional uint64 user_time_micros = 2;
2597 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002598}
2599
2600/**
2601 * Pulls Cpu Time Per Uid per frequency.
2602 * Note that isolated process uid time should be attributed to host uids.
2603 * For each uid, we order the time by descending frequencies.
2604 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002605message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002606 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002607 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002608 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002609}
Hugo Benichi884970e2017-11-14 22:42:46 +09002610
Chenjie Yu05013b32017-11-21 10:21:41 -08002611/**
2612 * Pulls Wifi Controller Activity Energy Info
2613 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002614message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002615 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002616 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002617 // stack reported state
2618 // TODO: replace this with proto enum
2619 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002620 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002621 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002622 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002623 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002624 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002625 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002626 // product of current(mA), voltage(V) and time(ms)
2627 optional uint64 controller_energy_used = 6;
2628}
2629
2630/**
2631 * Pulls Modem Activity Energy Info
2632 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002633message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002634 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002635 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002636 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002637 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002638 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002639 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002640 /**
2641 * Tx power index
2642 * index 0 = tx_power < 0dBm
2643 * index 1 = 0dBm < tx_power < 5dBm
2644 * index 2 = 5dBm < tx_power < 15dBm
2645 * index 3 = 15dBm < tx_power < 20dBm
2646 * index 4 = tx_power > 20dBm
2647 */
2648 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002649 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002650 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002651 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002652 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002653 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002654 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002655 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002656 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002657 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002658 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002659 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002660 // product of current(mA), voltage(V) and time(ms)
2661 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002662}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002663
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002664/**
2665 * Pulls Bluetooth Activity Energy Info
2666 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2667 */
2668message BluetoothActivityInfo {
2669 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002670 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002671 // bluetooth stack state
2672 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002673 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002674 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002675 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002676 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002677 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002678 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002679 // product of current(mA), voltage(V) and time(ms)
2680 optional uint64 energy_used = 6;
2681}
2682
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002683/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002684 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002685 *
2686 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002687 */
2688message ProcessMemoryState {
2689 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002690 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002691
2692 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002693 // Usually package name, "system" for system server.
2694 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002695 optional string process_name = 2;
2696
Rafal Slawikda51b932018-12-13 16:31:33 +00002697 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07002698 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002699
2700 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002701 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002702
2703 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002704 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002705
Rajeev Kumar90235992018-01-29 11:06:48 -08002706 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002707 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
2708 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08002709 optional int64 rss_in_bytes = 6;
2710
2711 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00002712 // Value is read from memory.stat, field total_cache if per-app memory
2713 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002714 optional int64 cache_in_bytes = 7;
2715
2716 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00002717 // Value is read from memory.stat, field total_swap if per-app memory
2718 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002719 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002720
Rafal Slawikd03ae422018-11-20 11:27:45 +00002721 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002722 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00002723
2724 // Elapsed real time when the process started.
2725 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
2726 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002727}
2728
2729/*
Rafal Slawik08621582018-10-15 14:53:07 +01002730 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00002731 *
2732 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01002733 */
2734message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01002735 // The uid if available. -1 means not available.
2736 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01002737
Rafal Slawikbf67d072018-10-23 11:07:54 +01002738 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002739 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002740 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01002741
Rafal Slawikbf67d072018-10-23 11:07:54 +01002742 // # of page-faults
2743 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002744
Rafal Slawikbf67d072018-10-23 11:07:54 +01002745 // # of major page-faults
2746 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002747
Rafal Slawikbf67d072018-10-23 11:07:54 +01002748 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002749 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002750 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01002751
Rafal Slawikd03ae422018-11-20 11:27:45 +00002752 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002753 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01002754
2755 // Elapsed real time when the process started.
2756 // Value is read from /proc/PID/stat, field 22.
2757 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01002758}
2759
2760/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00002761 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002762 *
2763 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
2764 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00002765 *
2766 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002767 */
2768message ProcessMemoryHighWaterMark {
2769 // The uid if available. -1 means not available.
2770 optional int32 uid = 1 [(is_uid) = true];
2771
Rafal Slawikda51b932018-12-13 16:31:33 +00002772 // The process name.
2773 // Usually package name or process cmdline.
2774 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002775 optional string process_name = 2;
2776
2777 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
2778 // /proc/PID/status.
2779 optional int64 rss_high_water_mark_in_bytes = 3;
2780}
2781
2782/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002783 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002784 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002785message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002786 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002787}
2788
2789/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002790 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002791 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002792message SystemUptime {
2793 // Milliseconds since the system was booted.
2794 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2795 // for external input).
2796 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002797 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002798}
2799
2800/*
2801 * Reads from /proc/uid_concurrent_active_time which has the format:
2802 * active: X (X is # cores)
2803 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2804 * [uid1]: [time-0] [time-1] [time-2] ... ...
2805 * ...
2806 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2807 * The file contains a monotonically increasing count of time for a single boot.
2808 */
2809message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002810 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002811 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002812}
2813
2814/**
2815 * Reads from /proc/uid_concurrent_policy_time which has the format:
2816 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2817 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2818 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2819 * ...
2820 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2821 * The file contains a monotonically increasing count of time for a single boot.
2822 */
2823message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002824 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002825 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002826 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002827}
2828
2829/*
2830 * Pulls free disk space, for data, system partition and temporary directory.
2831 */
2832message DiskSpace {
2833 // available bytes in data partition
2834 optional uint64 data_available_bytes = 1;
2835 // available bytes in system partition
2836 optional uint64 system_available_bytes = 2;
2837 // available bytes in download cache or temp directories
2838 optional uint64 temp_available_bytes = 3;
2839}
Tej Singhbf972d92018-01-10 20:51:13 -08002840
2841/**
2842 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002843 * Pulled from:
2844 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002845 */
2846message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002847 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08002848}
2849
2850/**
2851 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002852 * Pulled from:
2853 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002854 */
2855message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002856 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08002857}
2858
2859/**
Bookatz17f0d8a2018-09-13 12:56:32 -07002860 * Pulls battery voltage.
2861 * Pulled from:
2862 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2863 */
2864message BatteryVoltage {
2865 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07002866 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07002867}
2868
2869/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08002870 * Pulls battery level (percent full, from 0 to 100).
2871 *
2872 * Pulled from:
2873 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2874 */
2875message BatteryLevel {
2876 // Battery level. Should be in [0, 100].
2877 optional int32 battery_level = 1;
2878}
2879
2880/**
Tej Singhd89137e2018-03-26 14:51:40 -07002881 * Pulls the temperature of various parts of the device.
2882 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002883 *
2884 * Pulled from:
2885 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2886 */
2887message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08002888 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08002889 optional android.os.TemperatureTypeEnum sensor_location = 1;
2890
2891 // The name of the temperature source. Eg. CPU0
2892 optional string sensor_name = 2;
2893
Tej Singhd89137e2018-03-26 14:51:40 -07002894 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08002895 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07002896 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08002897}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002898
2899/**
2900 * Pulls the statistics of calls to Binder.
2901 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01002902 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
2903 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002904 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002905 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002906 */
2907message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002908 // UID of the process responsible for the binder transaction. It will be set if the process
2909 // executing the binder transaction attribute the transaction to another uid using
2910 // Binder.setThreadWorkSource().
2911 //
2912 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002913 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002914 // UID of the process executing the binder transaction.
2915 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002916 // Fully qualified class name of the API call.
2917 //
2918 // This is a system server class name.
2919 //
2920 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
2921 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
2922 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
2923 // commonly used APIs.
2924 optional string service_class_name = 2;
2925 // Method name of the API call. It can also be a transaction code if we cannot
2926 // resolve it to a name. See Binder#getTransactionName.
2927 //
2928 // This is a system server method name.
2929 optional string service_method_name = 3;
2930 // Total number of API calls.
2931 optional int64 call_count = 4;
2932 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2933 optional bool screen_interactive = 13;
2934 // Total number of API calls we have data recorded for. If we collected data for all the calls,
2935 // call_count will be equal to recorded_call_count.
2936 //
2937 // If recorded_call_count is different than call_count, it means data collection has been
2938 // sampled. All the fields below will be sampled in this case.
2939 optional int64 recorded_call_count = 12;
2940 // Number of exceptions thrown by the API.
2941 optional int64 recorded_exception_count = 5;
2942 // Total latency of all API calls.
2943 // Average can be computed using total_latency_micros / recorded_call_count.
2944 optional int64 recorded_total_latency_micros = 6;
2945 // Maximum latency of one API call.
2946 optional int64 recorded_max_latency_micros = 7;
2947 // Total CPU usage of all API calls.
2948 // Average can be computed using total_cpu_micros / recorded_call_count.
2949 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
2950 optional int64 recorded_total_cpu_micros = 8;
2951 // Maximum CPU usage of one API call.
2952 optional int64 recorded_max_cpu_micros = 9;
2953 // Maximum parcel reply size of one API call.
2954 optional int64 recorded_max_reply_size_bytes = 10;
2955 // Maximum parcel request size of one API call.
2956 optional int64 recorded_max_request_size_bytes = 11;
2957}
2958
2959/**
2960 * Pulls the statistics of exceptions during calls to Binder.
2961 *
2962 * Binder stats are cumulative from boot unless somebody reset the data using
2963 * > adb shell dumpsys binder_calls_stats --reset
2964 */
2965message BinderCallsExceptions {
2966 // Exception class name, e.g. java.lang.IllegalArgumentException.
2967 //
2968 // This is an exception class name thrown by the system server.
2969 optional string exception_class_name = 1;
2970 // Total number of exceptions.
2971 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002972}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002973
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002974/**
2975 * Pulls the statistics of message dispatching on HandlerThreads.
2976 *
2977 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
2978 * config on the device.
2979 *
2980 * Next tag: 11
2981 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002982message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01002983 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002984 optional int32 uid = 1 [(is_uid) = true];
2985
2986 // Fully qualified class name of the handler target class.
2987 //
2988 // This field does not contain PII. This is a system server class name.
2989 optional string handler_class_name = 2;
2990
2991 // The name of the thread that runs the Looper.
2992 //
2993 // This field does not contain PII. This is a system server thread name.
2994 optional string looper_thread_name = 3;
2995
2996 // The name of the dispatched message.
2997 //
2998 // This field does not contain PII. This is a system server constant or class
2999 // name.
3000 optional string message_name = 4;
3001
3002 // Total number of successfully dispatched messages.
3003 optional int64 message_count = 5;
3004
3005 // Total number of messages that failed dispatching.
3006 optional int64 exception_count = 6;
3007
3008 // Total number of processed messages we have data recorded for. If we
3009 // collected data for all the messages, message_count will be equal to
3010 // recorded_message_count.
3011 //
3012 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003013 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003014 optional int64 recorded_message_count = 7;
3015
3016 // Total latency of all processed messages.
3017 // Average can be computed using recorded_total_latency_micros /
3018 // recorded_message_count.
3019 optional int64 recorded_total_latency_micros = 8;
3020
3021 // Total CPU usage of all processed message.
3022 // Average can be computed using recorded_total_cpu_micros /
3023 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003024 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003025 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003026
3027 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3028 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003029
3030 // Max recorded CPU usage of all processed messages.
3031 optional int64 recorded_max_cpu_micros = 11;
3032
3033 // Max recorded latency of all processed messages.
3034 optional int64 recorded_max_latency_micros = 12;
3035
3036 // Total number of messages we tracked the dispatching delay for. If we
3037 // collected data for all the messages, message_count will be equal to
3038 // recorded_delay_message_count.
3039 //
3040 // If recorded_delay_message_count is different than message_count, it means data
3041 // collection has been sampled or/and not all messages specified the target dispatch time.
3042 // The fields below will be sampled in this case.
3043 optional int64 recorded_delay_message_count = 13;
3044
3045 // Total dispatching delay of all processed messages.
3046 // Calculated as a difference between the target dispatching time (Message.when)
3047 // and the actual dispatching time.
3048 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3049 optional int64 recorded_total_delay_millis = 14;
3050
3051 // Max dispatching delay of all processed messages.
3052 // Calculated as a difference between the target dispatching time (Message.when)
3053 // and the actual dispatching time.
3054 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003055}
Tej Singh86dc9db2018-09-06 00:39:57 +00003056
3057/**
3058 * Pulls disk information, such as write speed and latency.
3059 */
3060message DiskStats {
3061 // Time taken to open, write 512B to, and close a file.
3062 // -1 if error performing the check.
3063 optional int64 data_write_latency_millis = 1;
3064
3065 optional bool file_based_encryption = 2;
3066
3067 // Recent disk write speed in kB/s.
3068 // -1 if error querying storageed.
3069 // 0 if data is unavailable.
3070 optional int32 recent_disk_write_speed = 3;
3071}
3072
3073
3074/**
3075 * Free and total bytes of the Data, Cache, and System partition.
3076 */
3077message DirectoryUsage {
3078 enum Directory {
3079 UNKNOWN = 0;
3080 DATA = 1;
3081 CACHE = 2;
3082 SYSTEM = 3;
3083 }
3084 optional Directory directory = 1;
3085 optional int64 free_bytes = 2;
3086 optional int64 total_bytes = 3;
3087}
3088
3089
3090/**
3091 * Size of an application: apk size, data size, and cache size.
3092 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3093 * Information is only reported for apps with the primary user (user 0).
3094 * Sizes are aggregated by package name.
3095 */
3096message AppSize {
3097 // Including uids will involve modifying diskstats logic.
3098 optional string package_name = 1;
3099 // App size in bytes. -1 if unavailable.
3100 optional int64 app_size_bytes = 2;
3101 // App data size in bytes. -1 if unavailable.
3102 optional int64 app_data_size_bytes = 3;
3103 // App cache size in bytes. -1 if unavailable.
3104 optional int64 app_cache_size_bytes = 4;
3105 // Time that the cache file was produced.
3106 // Uses System.currentTimeMillis(), which is wall clock time.
3107 optional int64 cache_time_millis = 5;
3108}
3109
3110
3111/**
3112 * Size of a particular category. Eg: photos, videos.
3113 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3114 */
3115message CategorySize {
3116 enum Category {
3117 UNKNOWN = 0;
3118 APP_SIZE = 1;
3119 APP_DATA_SIZE = 2;
3120 APP_CACHE_SIZE = 3;
3121 PHOTOS = 4;
3122 VIDEOS = 5;
3123 AUDIO = 6;
3124 DOWNLOADS = 7;
3125 SYSTEM = 8;
3126 OTHER = 9;
3127 }
3128 optional Category category = 1;
3129 // Category size in bytes.
3130 optional int64 size_bytes = 2;
3131 // Time that the cache file was produced.
3132 // Uses System.currentTimeMillis(), which is wall clock time.
3133 optional int64 cache_time_millis = 3;
3134}
Tej Singhd6d6d772018-09-05 17:41:25 -07003135
3136/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003137 * Pulls per uid I/O stats. The stats are cumulative since boot.
3138 *
3139 * Read/write bytes are I/O events from a storage device
3140 * Read/write chars are data requested by read/write syscalls, and can be
3141 * satisfied by caching.
3142 *
3143 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3144 */
3145message DiskIo {
3146 optional int32 uid = 1 [(is_uid) = true];
3147 optional int64 fg_chars_read = 2;
3148 optional int64 fg_chars_write = 3;
3149 optional int64 fg_bytes_read = 4;
3150 optional int64 fg_bytes_write = 5;
3151 optional int64 bg_chars_read = 6;
3152 optional int64 bg_chars_write = 7;
3153 optional int64 bg_bytes_read = 8;
3154 optional int64 bg_bytes_write = 9;
3155 optional int64 fg_fsync = 10;
3156 optional int64 bg_fsync= 11;
3157}
3158
3159
3160/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003161 * Pulls the number of fingerprints for each user.
3162 *
3163 * Pulled from StatsCompanionService, which queries FingerprintManager.
3164 */
3165message NumFingerprints {
3166 // The associated user. Eg: 0 for owners, 10+ for others.
3167 // Defined in android/os/UserHandle.java
3168 optional int32 user = 1;
3169 // Number of fingerprints registered to that user.
3170 optional int32 num_fingerprints = 2;
3171}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003172
Yangsteraf9aee72018-10-12 09:26:16 -07003173message AggStats {
3174 optional int64 min = 1;
3175
3176 optional int64 average = 2;
3177
3178 optional int64 max = 3;
3179}
3180
3181message ProcessStatsStateProto {
3182 optional android.service.procstats.ScreenState screen_state = 1;
3183
3184 optional android.service.procstats.MemoryState memory_state = 2;
3185
3186 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3187 // and not frameworks/base/core/java/android/app/ActivityManager.java
3188 optional android.service.procstats.ProcessState process_state = 3;
3189
3190 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003191 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003192
3193 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003194 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003195
3196 // # of samples taken
3197 optional int32 sample_size = 5;
3198
3199 // PSS is memory reserved for this process
3200 optional AggStats pss = 6;
3201
3202 // USS is memory shared between processes, divided evenly for accounting
3203 optional AggStats uss = 7;
3204
3205 // RSS is memory resident for this process
3206 optional AggStats rss = 8;
3207}
3208
3209// Next Tag: 7
3210message ProcessStatsProto {
3211 // Name of process.
3212 optional string process = 1;
3213
3214 // Uid of the process.
3215 optional int32 uid = 2;
3216
3217 // Information about how often kills occurred
3218 message Kill {
3219 // Count of excessive CPU kills
3220 optional int32 cpu = 1;
3221
3222 // Count of kills when cached
3223 optional int32 cached = 2;
3224
3225 // PSS stats during cached kill
3226 optional AggStats cached_pss = 3;
3227 }
3228 optional Kill kill = 3;
3229
3230 // Time and memory spent in various states.
3231 repeated ProcessStatsStateProto states = 5;
3232
3233 // Total time process has been running... screen_state, memory_state, and process_state
3234 // will not be set.
3235 optional ProcessStatsStateProto total_running_state = 6;
3236}
3237
3238message PackageServiceOperationStatsProto {
3239 // Operate enum: Started, Foreground, Bound, Executing
3240 optional android.service.procstats.ServiceOperationState operation = 1;
3241
3242 // Number of times the service was in this operation.
3243 optional int32 count = 2;
3244
3245 // Information about a state the service can be in.
3246 message StateStats {
3247 // Screen state enum.
3248 optional android.service.procstats.ScreenState screen_state = 1;
3249 // Memory state enum.
3250 optional android.service.procstats.MemoryState memory_state = 2;
3251
3252 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07003253 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003254 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003255 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003256 }
3257 repeated StateStats state_stats = 3;
3258}
3259
3260message PackageServiceStatsProto {
3261 // Name of service component.
3262 optional string service_name = 1;
3263
3264 // The operation stats.
3265 // The package_name, package_uid, package_version, service_name will not be set to save space.
3266 repeated PackageServiceOperationStatsProto operation_stats = 2;
3267}
3268
3269message PackageAssociationSourceProcessStatsProto {
3270 // Uid of the process.
3271 optional int32 process_uid = 1;
3272 // Process name.
3273 optional string process_name = 2;
3274
3275 // Total count of the times this association appeared.
3276 optional int32 total_count = 3;
3277
3278 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07003279 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003280
3281 // Total count of the times this association became actively impacting its target process.
3282 optional int32 active_count = 5;
3283
3284 // Information on one source in this association.
3285 message StateStats {
3286 // Process state enum.
3287 optional android.service.procstats.ProcessState process_state = 1;
3288 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003289 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003290 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003291 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003292 }
3293 repeated StateStats active_state_stats = 6;
3294}
3295
3296message PackageAssociationProcessStatsProto {
3297 // Name of the target component.
3298 optional string component_name = 1;
3299 // Information on one source in this association.
3300 repeated PackageAssociationSourceProcessStatsProto sources = 2;
3301}
3302
3303
3304message ProcessStatsPackageProto {
3305 // Name of package.
3306 optional string package = 1;
3307
3308 // Uid of the package.
3309 optional int32 uid = 2;
3310
3311 // Version of the package.
3312 optional int64 version = 3;
3313
3314 // Stats for each process running with the package loaded in to it.
3315 repeated ProcessStatsProto process_stats = 4;
3316
3317 // Stats for each of the package's services.
3318 repeated PackageServiceStatsProto service_stats = 5;
3319
3320 // Stats for each association with the package.
3321 repeated PackageAssociationProcessStatsProto association_stats = 6;
3322}
3323
3324message ProcessStatsSectionProto {
3325 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003326 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07003327
3328 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003329 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003330
3331 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003332 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003333
3334 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003335 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003336
3337 // System runtime library. e.g. "libdvm.so", "libart.so".
3338 optional string runtime = 5;
3339
3340 // whether kernel reports swapped pss.
3341 optional bool has_swapped_pss = 6;
3342
3343 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
3344 enum Status {
3345 STATUS_UNKNOWN = 0;
3346 STATUS_COMPLETE = 1;
3347 STATUS_PARTIAL = 2;
3348 STATUS_SHUTDOWN = 3;
3349 STATUS_SYSPROPS = 4;
3350 }
3351 repeated Status status = 7;
3352
3353 // Stats for each process.
3354 repeated ProcessStatsProto process_stats = 8;
3355
3356 // Stats for each package.
3357 repeated ProcessStatsPackageProto package_stats = 9;
3358}
3359
Chenjie Yu12e5e672018-09-14 15:54:59 -07003360/**
3361 * Pulled from ProcessStatsService.java
3362 */
3363message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07003364 optional ProcessStatsSectionProto proc_stats_section = 1;
3365}
3366
Chenjie Yuf910b7802019-01-11 16:08:20 -08003367/**
3368 * Pulled from ProcessStatsService.java
3369 */
3370message ProcStatsPkgProc {
3371 optional ProcessStatsSectionProto proc_stats_section = 1;
3372}
3373
Yangsteraf9aee72018-10-12 09:26:16 -07003374message PowerProfileProto {
3375 optional double cpu_suspend = 1;
3376
3377 optional double cpu_idle = 2;
3378
3379 optional double cpu_active = 3;
3380
3381 message CpuCluster {
3382 optional int32 id = 1;
3383 optional double cluster_power = 2;
3384 optional int32 cores = 3;
3385 repeated int64 speed = 4;
3386 repeated double core_power = 5;
3387 }
3388
3389 repeated CpuCluster cpu_cluster = 40;
3390
3391 optional double wifi_scan = 4;
3392
3393 optional double wifi_on = 5;
3394
3395 optional double wifi_active = 6;
3396
3397 optional double wifi_controller_idle = 7;
3398
3399 optional double wifi_controller_rx = 8;
3400
3401 optional double wifi_controller_tx = 9;
3402
3403 repeated double wifi_controller_tx_levels = 10;
3404
3405 optional double wifi_controller_operating_voltage = 11;
3406
3407 optional double bluetooth_controller_idle = 12;
3408
3409 optional double bluetooth_controller_rx = 13;
3410
3411 optional double bluetooth_controller_tx = 14;
3412
3413 optional double bluetooth_controller_operating_voltage = 15;
3414
3415 optional double modem_controller_sleep = 16;
3416
3417 optional double modem_controller_idle = 17;
3418
3419 optional double modem_controller_rx = 18;
3420
3421 repeated double modem_controller_tx = 19;
3422
3423 optional double modem_controller_operating_voltage = 20;
3424
3425 optional double gps_on = 21;
3426
3427 repeated double gps_signal_quality_based = 22;
3428
3429 optional double gps_operating_voltage = 23;
3430
3431 optional double bluetooth_on = 24;
3432
3433 optional double bluetooth_active = 25;
3434
3435 optional double bluetooth_at_cmd = 26;
3436
3437 optional double ambient_display = 27;
3438
3439 optional double screen_on = 28;
3440
3441 optional double radio_on = 29;
3442
3443 optional double radio_scanning = 30;
3444
3445 optional double radio_active = 31;
3446
3447 optional double screen_full = 32;
3448
3449 optional double audio = 33;
3450
3451 optional double video = 34;
3452
3453 optional double flashlight = 35;
3454
3455 optional double memory = 36;
3456
3457 optional double camera = 37;
3458
3459 optional double wifi_batched_scan = 38;
3460
3461 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003462}
Chenjie Yuab530202018-09-26 12:39:20 -07003463
3464/**
3465 * power_profile.xml and other constants for power model calculations.
3466 * Pulled from PowerProfile.java
3467 */
3468message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003469 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003470}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003471
3472/**
arangelovd5db50e2018-10-12 20:24:39 +01003473 * Logs when a user restriction was added or removed.
3474 *
3475 * Logged from:
3476 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3477 */
3478message UserRestrictionChanged {
3479 // The raw string of the user restriction as defined in UserManager.
3480 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3481 optional string restriction = 1;
3482 // Whether the restriction is enabled or disabled.
3483 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07003484}
Yangster-mac308ea0c2018-10-22 13:10:25 -07003485
3486/**
3487 * Pulls process user time and system time. Puller takes a snapshot of all pids
3488 * in the system and returns cpu stats for those that are working at the time.
3489 * Dead pids will be dropped. Kernel processes are excluded.
3490 * Min cool-down is 5 sec.
3491 */
3492message ProcessCpuTime {
3493 optional int32 uid = 1 [(is_uid) = true];
3494
3495 optional string process_name = 2;
3496 // Process cpu time in user space, cumulative from boot/process start
3497 optional int64 user_time_millis = 3;
3498 // Process cpu time in system space, cumulative from boot/process start
3499 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01003500}
Misha Wagner5a51e002018-10-03 15:04:09 +01003501
3502/**
3503 * Pulls the CPU usage for each thread.
3504 *
3505 * Read from /proc/$PID/task/$TID/time_in_state files.
3506 *
3507 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
3508 * time_in_state files not being present on some phones, have not been addressed. These should be
3509 * considered before a public release.
3510 */
3511message CpuTimePerThreadFreq {
3512 // UID that owns the process.
3513 optional int32 uid = 1 [(is_uid) = true];
3514 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003515 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01003516 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003517 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01003518 // Name of the process taken from `/proc/$PID/cmdline`.
3519 optional string process_name = 4;
3520 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
3521 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00003522
3523 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
3524 // are given in KHz, and time is given in milliseconds since the thread started. All eight
3525 // frequencies are given here as the alternative is sending eight separate atoms. This method
3526 // significantly reduces the amount of data created
3527 optional int32 frequency1_khz = 6;
3528 optional int32 time1_millis = 7;
3529 optional int32 frequency2_khz = 8;
3530 optional int32 time2_millis = 9;
3531 optional int32 frequency3_khz = 10;
3532 optional int32 time3_millis = 11;
3533 optional int32 frequency4_khz = 12;
3534 optional int32 time4_millis = 13;
3535 optional int32 frequency5_khz = 14;
3536 optional int32 time5_millis = 15;
3537 optional int32 frequency6_khz = 16;
3538 optional int32 time6_millis = 17;
3539 optional int32 frequency7_khz = 18;
3540 optional int32 time7_millis = 19;
3541 optional int32 frequency8_khz = 20;
3542 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01003543}
Bookatz75ee6042018-11-09 12:27:37 -08003544
3545/**
Bookatz366a4432018-11-20 09:42:33 -08003546 * Pulls information about the device's build.
3547 */
3548message BuildInformation {
3549 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
3550 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
3551 optional string fingerprint = 1;
3552
3553 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
3554 optional string brand = 2;
3555
3556 // Build.PRODUCT. The name of the overall product.
3557 optional string product = 3;
3558
3559 // Build.DEVICE. The name of the industrial design.
3560 optional string device = 4;
3561
3562 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
3563 optional string version_release = 5;
3564
3565 // Build.ID. E.g. a label like "M4-rc20".
3566 optional string id = 6;
3567
3568 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
3569 // represent this build.
3570 optional string version_incremental = 7;
3571
3572 // Build.TYPE. The type of build, like "user" or "eng".
3573 optional string type = 8;
3574
3575 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
3576 optional string tags = 9;
3577}
3578
3579/**
Bookatz75ee6042018-11-09 12:27:37 -08003580 * Pulls on-device BatteryStats power use calculations for the overall device.
3581 */
3582message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08003583 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3584 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3585 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
3586 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08003587}
3588
3589/**
3590 * Pulls on-device BatteryStats power use calculations broken down by uid.
3591 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
3592 * that is attributed to non-uid items. They must all be included to get the total power use.
3593 */
3594message DeviceCalculatedPowerBlameUid {
3595 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
3596 optional int32 uid = 1 [(is_uid) = true];
3597
Bookatz3dbc13a2018-12-21 12:16:51 -08003598 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3599 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3600 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08003601}
3602
3603/**
3604 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
3605 * drain type.
3606 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
3607 * is attributed uids. They must all be included to get the total power use.
3608 */
3609message DeviceCalculatedPowerBlameOther {
3610 // The type of item whose power use is being reported.
3611 enum DrainType {
3612 AMBIENT_DISPLAY = 0;
3613 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
3614 BLUETOOTH = 2;
3615 CAMERA = 3;
3616 // Cell-standby
3617 CELL = 4;
3618 FLASHLIGHT = 5;
3619 IDLE = 6;
3620 MEMORY = 7;
3621 // Amount that total computed drain exceeded the drain estimated using the
3622 // battery level changes and capacity.
3623 OVERCOUNTED = 8;
3624 PHONE = 9;
3625 SCREEN = 10;
3626 // Amount that total computed drain was below the drain estimated using the
3627 // battery level changes and capacity.
3628 UNACCOUNTED = 11;
3629 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
3630 WIFI = 13;
3631 }
3632 optional DrainType drain_type = 1;
3633
Bookatz3dbc13a2018-12-21 12:16:51 -08003634 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3635 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3636 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00003637}
arangelov4e994062018-11-13 16:12:38 +00003638
3639/**
3640 * Logs device policy features.
3641 *
3642 * Logged from:
3643 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3644 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
3645 */
3646message DevicePolicyEvent {
3647 // The event id - unique for each event.
3648 optional android.stats.devicepolicy.EventId event_id = 1;
3649 // The admin package name.
3650 optional string admin_package_name = 2;
3651 // A generic integer parameter.
3652 optional int32 integer_value = 3;
3653 // A generic boolean parameter.
3654 optional bool boolean_value = 4;
3655 // A parameter specifying a time period in milliseconds.
3656 optional uint64 time_period_millis = 5;
3657 // A parameter specifying a list of package names, bundle extras or string parameters.
3658 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
3659}
shawnlinea5b66b2018-11-13 15:05:29 +08003660
3661/**
3662 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
3663 *
3664 * Logged from:
3665 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3666 */
3667message DocsUILaunchReported {
3668 optional android.stats.docsui.LaunchAction launch_action = 1;
3669 optional bool has_initial_uri = 2;
3670 optional android.stats.docsui.MimeType mime_type = 3;
3671 optional android.stats.docsui.Root initial_root = 4;
3672}
3673
3674/**
3675 * Logs root/app visited event in file managers/picker. Call this when the user
3676 * taps on root/app in hamburger menu.
3677 *
3678 * Logged from:
3679 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3680 */
3681message DocsUIRootVisitedReported {
3682 optional android.stats.docsui.ContextScope scope = 1;
3683 optional android.stats.docsui.Root root = 2;
3684}
3685
3686/**
3687 * Logs file operation stats. Call this when a file operation has completed.
3688 *
3689 * Logged from:
3690 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3691 */
3692message DocsUIFileOperationReported {
3693 optional android.stats.docsui.Provider provider = 1;
3694 optional android.stats.docsui.FileOperation file_op = 2;
3695}
3696
3697/**
3698 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
3699 * mode.
3700 *
3701 * Logged from:
3702 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3703 */
3704message DocsUIFileOperationCopyMoveModeReported {
3705 optional android.stats.docsui.FileOperation file_op = 1;
3706 optional android.stats.docsui.CopyMoveOpMode mode = 2;
3707}
3708
3709
3710/**
3711 * Logs file sub operation stats. Call this when a file operation has failed.
3712 *
3713 * Logged from:
3714 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3715 */
3716message DocsUIFileOperationFailureReported {
3717 optional android.stats.docsui.Authority authority = 1;
3718 optional android.stats.docsui.SubFileOperation sub_op = 2;
3719}
3720
3721/**
3722* Logs the cancellation of a file operation. Call this when a job is canceled
3723*
3724* Logged from:
3725* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3726*/
3727message DocsUIFileOperationCanceledReported {
3728 optional android.stats.docsui.FileOperation file_op = 1;
3729}
3730
3731/**
3732 * Logs startup time in milliseconds.
3733 *
3734 * Logged from:
3735 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3736 */
3737message DocsUIStartupMsReported {
3738 optional int32 startup_millis = 1;
3739}
3740
3741/**
3742 * Logs the action that was started by user.
3743 *
3744 * Logged from:
3745 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3746 */
3747message DocsUIUserActionReported {
3748 optional android.stats.docsui.UserAction action = 1;
3749}
3750
3751/**
3752 * Logs the invalid type when invalid scoped access is requested.
3753 *
3754 * Logged from:
3755 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
3756 */
3757message DocsUIInvalidScopedAccessRequestReported {
3758 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00003759}
Ben Murdochbab399f2018-12-06 11:01:38 +00003760
3761/**
shawnlina75e82d2019-01-07 10:31:12 +08003762 * Logs the package name that launches docsui picker mode.
3763 *
3764 * Logged from:
3765 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3766 */
3767message DocsUIPickerLaunchedFromReported {
3768 optional string package_name = 1;
3769}
3770
3771/**
3772 * Logs the search type.
3773 *
3774 * Logged from:
3775 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3776 */
3777message DocsUISearchTypeReported {
3778 optional android.stats.docsui.SearchType search_type = 1;
3779}
3780
3781/**
3782 * Logs the search mode.
3783 *
3784 * Logged from:
3785 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3786 */
3787message DocsUISearchModeReported {
3788 optional android.stats.docsui.SearchMode search_mode = 1;
3789}
3790
3791/**
3792 * Logs the pick result information.
3793 *
3794 * Logged from:
3795 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3796 */
3797message DocsUIPickResultReported {
3798 optional int32 total_action_count = 1;
3799 optional int64 duration_millis = 2;
3800 optional int32 file_count= 3;
3801 optional bool is_searching = 4;
3802 optional android.stats.docsui.Root picked_from = 5;
3803 optional android.stats.docsui.MimeType mime_type = 6;
3804 optional int32 repeatedly_pick_times = 7;
3805}
3806
3807/**
Ben Murdochbab399f2018-12-06 11:01:38 +00003808 * Logs when an app's memory is compacted.
3809 *
3810 * Logged from:
3811 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3812 */
3813message AppCompacted {
3814 // The pid of the process being compacted.
3815 optional int32 pid = 1;
3816
3817 // The name of the process being compacted.
3818 optional string process_name = 2;
3819
3820 // The type of compaction.
3821 enum Action {
3822 UNKNOWN = 0;
3823 SOME = 1;
3824 FULL = 2;
3825 }
Ben Murdoch01720b82018-12-19 18:03:44 +00003826 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00003827
3828 // Total RSS in kilobytes consumed by the process prior to compaction.
3829 optional int64 before_rss_total_kilobytes = 4;
3830
3831 // File RSS in kilobytes consumed by the process prior to compaction.
3832 optional int64 before_rss_file_kilobytes = 5;
3833
3834 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
3835 optional int64 before_rss_anon_kilobytes = 6;
3836
3837 // Swap in kilobytes consumed by the process prior to compaction.
3838 optional int64 before_swap_kilobytes = 7;
3839
3840 // Total RSS in kilobytes consumed by the process after compaction.
3841 optional int64 after_rss_total_kilobytes = 8;
3842
3843 // File RSS in kilobytes consumed by the process after compaction.
3844 optional int64 after_rss_file_kilobytes = 9;
3845
3846 // Anonymous RSS in kilobytes consumed by the process after compaction.
3847 optional int64 after_rss_anon_kilobytes = 10;
3848
3849 // Swap in kilobytes consumed by the process after compaction.
3850 optional int64 after_swap_kilobytes = 11;
3851
3852 // The time taken to perform compaction in milliseconds.
3853 optional int64 time_to_compact_millis = 12;
3854
3855 // The last compaction action performed for this app.
3856 optional Action last_action = 13;
3857
Ben Murdoch01720b82018-12-19 18:03:44 +00003858 // The last time that compaction was attempted on this process in milliseconds
3859 // since boot, not including sleep (see SystemClock.uptimeMillis()).
3860 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00003861
Ben Murdoch01720b82018-12-19 18:03:44 +00003862 // The oom_score_adj at the time of compaction.
3863 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00003864
3865 // The process state at the time of compaction.
3866 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
3867}
lifr157fc552018-12-12 16:38:04 +08003868
3869/**
3870 * Logs the latency period(in microseconds) and the return code of
3871 * the DNS(Domain Name System) lookups.
3872 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
3873 * to get info(address or hostname) from DNS server(or DNS cache).
3874 * Logged from:
3875 * /system/netd/server/DnsProxyListener.cpp
3876 */
3877message NetworkDnsEventReported {
3878 // The types of the DNS lookups, as defined in
3879 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
3880 enum EventType {
3881 EVENT_UNKNOWN = 0;
3882 EVENT_GETADDRINFO = 1;
3883 EVENT_GETHOSTBYNAME = 2;
3884 EVENT_GETHOSTBYADDR = 3;
3885 EVENT_RES_NSEND = 4;
3886 }
3887 optional EventType event_type = 1;
3888
3889 // The return value of the DNS resolver for each DNS lookups.
3890 //bionic/libc/include/netdb.h
3891 //system/netd/resolv/include/netd_resolv/resolv.h
3892 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08003893 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08003894 EAI_ADDRFAMILY = 1;
3895 EAI_AGAIN = 2;
3896 EAI_BADFLAGS = 3;
3897 EAI_FAIL = 4;
3898 EAI_FAMILY = 5;
3899 EAI_MEMORY = 6;
3900 EAI_NODATA = 7;
3901 EAI_NONAME = 8;
3902 EAI_SERVICE = 9;
3903 EAI_SOCKTYPE = 10;
3904 EAI_SYSTEM = 11;
3905 EAI_BADHINTS = 12;
3906 EAI_PROTOCOL = 13;
3907 EAI_OVERFLOW = 14;
3908 RESOLV_TIMEOUT = 255;
3909 EAI_MAX = 256;
3910 }
3911 optional ReturnCode return_code = 2;
3912
3913 // The latency period(in microseconds) it took for this DNS lookup to complete.
3914 optional int32 latency_micros = 3;
3915}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08003916
3917/**
3918 * Logs when a data stall event occurs.
3919 *
3920 * Log from:
3921 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
3922 */
3923message DataStallEvent {
3924 // Data stall evaluation type.
3925 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
3926 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
3927 optional int32 evaluation_type = 1;
3928 // See definition in data_stall_event.proto.
3929 optional com.android.server.connectivity.ProbeResult validation_result = 2;
3930 // See definition in data_stall_event.proto.
3931 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
3932 // See definition in data_stall_event.proto.
3933 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
3934 // See definition in data_stall_event.proto.
3935 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
3936 // See definition in data_stall_event.proto.
3937 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
3938}
Christian Brunschenf86039e2018-12-21 12:26:14 +00003939
3940/*
3941 * Logs when RescueParty resets some set of experiment flags.
3942 *
3943 * Logged from:
3944 * frameworks/base/services/core/java/com/android/server/RescueParty.java
3945 */
3946message RescuePartyResetReported {
3947 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
3948 optional int32 rescue_level = 1;
3949}
Mathew Inwoodb375be52019-01-04 11:36:25 +00003950
3951/**
3952 * Logs when signed config is received from an APK, and if that config was applied successfully.
3953 * Logged from:
3954 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
3955 */
3956message SignedConfigReported {
3957 enum Type {
3958 UNKNOWN_TYPE = 0;
3959 GLOBAL_SETTINGS = 1;
3960 }
3961 optional Type type = 1;
3962
3963 // The final status of the signed config received.
3964 enum Status {
3965 UNKNOWN_STATUS = 0;
3966 APPLIED = 1;
3967 BASE64_FAILURE_CONFIG = 2;
3968 BASE64_FAILURE_SIGNATURE = 3;
3969 SECURITY_EXCEPTION = 4;
3970 INVALID_CONFIG = 5;
3971 OLD_CONFIG = 6;
3972 SIGNATURE_CHECK_FAILED = 7;
3973 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00003974 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00003975 }
3976 optional Status status = 2;
3977
3978 // The version of the signed config processed.
3979 optional int32 version = 3;
3980
3981 // The package name that the config was extracted from.
3982 optional string from_package = 4;
3983
3984 enum Key {
3985 NO_KEY = 0;
3986 DEBUG = 1;
3987 PRODUCTION = 2;
3988 }
3989 // Which key was used to verify the config.
3990 optional Key verified_with = 5;
3991}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08003992
3993/*
3994 * Logs GNSS Network-Initiated (NI) location events.
3995 *
3996 * Logged from:
3997 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
3998 */
3999message GnssNiEventReported {
4000 // The type of GnssNiEvent.
4001 enum EventType {
4002 UNKNOWN = 0;
4003 NI_REQUEST = 1;
4004 NI_RESPONSE = 2;
4005 }
4006 optional EventType event_type = 1;
4007
4008 // An ID generated by HAL to associate NI notifications and UI responses.
4009 optional int32 notification_id = 2;
4010
4011 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
4012 optional int32 ni_type = 3;
4013
4014 // NI requires notification.
4015 optional bool need_notify = 4;
4016
4017 // NI requires verification.
4018 optional bool need_verify = 5;
4019
4020 // NI requires privacy override, no notification/minimal trace.
4021 optional bool privacy_override = 6;
4022
4023 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4024 // seconds.
4025 optional int32 timeout = 7;
4026
4027 // Default response when timeout.
4028 optional int32 default_response = 8;
4029
4030 // String representing the requester of the network inititated location request.
4031 optional string requestor_id = 9;
4032
4033 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4034 // network initiated location request.
4035 optional string text = 10;
4036
4037 // requestorId decoding scheme.
4038 optional int32 requestor_id_encoding = 11;
4039
4040 // Notification message text decoding scheme.
4041 optional int32 text_encoding = 12;
4042
4043 // True if SUPL ES is enabled.
4044 optional bool is_supl_es_enabled = 13;
4045
4046 // True if GNSS location is enabled.
4047 optional bool is_location_enabled = 14;
4048
4049 // GNSS NI responses which define the response in NI structures.
4050 optional int32 user_response = 15;
4051}