blob: f9828a2b530284d92501b71797c11a0f3d1b71f1 [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";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080028import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080029import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080030import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080031import "frameworks/base/core/proto/android/server/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080032import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070033import "frameworks/base/core/proto/android/service/procstats_enum.proto";
34import "frameworks/base/core/proto/android/stats/enums.proto";
shawnlinea5b66b2018-11-13 15:05:29 +080035import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070036import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080037import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080038import "frameworks/base/core/proto/android/telephony/enums.proto";
39import "frameworks/base/core/proto/android/view/enums.proto";
arangelov4e994062018-11-13 16:12:38 +000040import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
41import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080042
Yao Chend54f9dd2017-10-17 17:37:48 +000043/**
Stefan Lafonae2df012017-11-14 09:17:21 -080044 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000045 * raw stats log events from the Android system, also known as "atoms."
46 *
47 * This field contains a single oneof with all of the available messages.
48 * The stats-log-api-gen tool runs as part of the Android build and
49 * generates the android.util.StatsLog class, which contains the constants
50 * and methods that Android uses to log.
51 *
Stefan Lafonae2df012017-11-14 09:17:21 -080052 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000053 * Instead, statsd on Android constructs these messages synthetically,
54 * in the format defined here and in stats_log.proto.
55 */
Stefan Lafonae2df012017-11-14 09:17:21 -080056message Atom {
57 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070058 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070059 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
60 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070061 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070062 BleScanResultReceived ble_scan_result_received = 4;
63 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080064 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070065 SyncStateChanged sync_state_changed = 7;
66 ScheduledJobStateChanged scheduled_job_state_changed = 8;
67 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070068 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080069 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
70 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
71 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070072 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
73 MemoryFactorStateChanged memory_factor_state_changed = 15;
74 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
75 CachedKillReported cached_kill_reported = 17;
76 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070077 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080078 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
79 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
80 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070081 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080082 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070083 CameraStateChanged camera_state_changed = 25;
84 FlashlightStateChanged flashlight_state_changed = 26;
85 UidProcessStateChanged uid_process_state_changed = 27;
86 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
87 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070088 BatteryLevelChanged battery_level_changed = 30;
89 ChargingStateChanged charging_state_changed = 31;
90 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070091 InteractiveStateChanged interactive_state_changed = 33;
92 // 34 is available
Bookatz8c6571b2017-10-24 15:04:41 -070093 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
94 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070095 WifiLockStateChanged wifi_lock_state_changed = 37;
96 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
97 WifiScanStateChanged wifi_scan_state_changed = 39;
98 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -070099 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700100 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700101 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900102 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700103 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800104 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -0800105 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800106 AppStartOccurred app_start_occurred = 48;
107 AppStartCanceled app_start_canceled = 49;
108 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800109 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800110 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800111 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800112 LmkStateChanged lmk_state_changed = 54;
113 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800114 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800115 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800116 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800117 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800118 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800119 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800120 KeyguardStateChanged keyguard_state_changed = 62;
121 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
122 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800123 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800124 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800125 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
126 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800127 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700128 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800129 SpeakerImpedanceReported speaker_impedance_reported = 71;
130 HardwareFailed hardware_failed = 72;
131 PhysicalDropDetected physical_drop_detected = 73;
132 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800133 MobileConnectionStateChanged mobile_connection_state_changed = 75;
134 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700135 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800136 AppCrashOccurred app_crash_occurred = 78;
137 ANROccurred anr_occurred = 79;
138 WTFOccurred wtf_occurred = 80;
139 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700140 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700141 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700142 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700143 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700144 ThermalThrottlingStateChanged thermal_throttling = 86;
Tej Singhd6d6d772018-09-05 17:41:25 -0700145 FingerprintAcquired fingerprint_acquired = 87;
146 FingerprintAuthenticated fingerprint_authenticated = 88;
147 FingerprintErrorOccurred fingerprint_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700148 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700149 BatteryHealthSnapshot battery_health_snapshot = 91;
150 SlowIo slow_io = 92;
151 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700152 PhoneServiceStateChanged phone_service_state_changed = 94;
153 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100154 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700155 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700156 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700157 // TODO: service state change is very noisy shortly after boot, as well
158 // as at other transitions - coming out of doze, device plugged in, etc.
159 // Consider removing this if it becomes a problem
160 ServiceStateChanged service_state_changed = 99;
161 ServiceLaunchReported service_launch_reported = 100;
Yangster-macb89807e2018-11-15 21:10:57 -0800162 PhenotypeFlagStateChanged phenotype_flag_state_changed = 101;
163 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000164 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800165 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
166 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
167 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
168 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
169 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
170 DocsUILaunchReported docs_ui_launch_reported = 109;
171 DocsUIRootVisitedReported docs_ui_root_visited = 110;
172 DocsUIStartupMsReported docs_ui_startup_ms = 111;
173 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800174 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
175 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000176 AppCompacted app_compacted = 115;
lifr030d23a2019-01-11 16:54:51 +0800177 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800178 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
179 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
180 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
181 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800182 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000183 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000184 SignedConfigReported signed_config_reported = 123;
Yao Chend54f9dd2017-10-17 17:37:48 +0000185 }
David Chenc8a43242017-10-17 16:23:28 -0700186
David Chen6e3e6cb2018-01-03 16:14:06 -0800187 // Pulled events will start at field 10000.
Rafal Slawik3bea8952018-11-15 12:39:33 +0000188 // Next: 10043
David Chenc8a43242017-10-17 16:23:28 -0700189 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800190 WifiBytesTransfer wifi_bytes_transfer = 10000;
191 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
192 MobileBytesTransfer mobile_bytes_transfer = 10002;
193 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800194 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800195 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800196 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800197 CpuTimePerFreq cpu_time_per_freq = 10008;
198 CpuTimePerUid cpu_time_per_uid = 10009;
199 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800200 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800201 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800202 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800203 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800204 SystemElapsedRealtime system_elapsed_realtime = 10014;
205 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800206 CpuActiveTime cpu_active_time = 10016;
207 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000208 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800209 RemainingBatteryCapacity remaining_battery_capacity = 10019;
210 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800211 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100212 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100213 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100214 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000215 DiskStats disk_stats = 10025;
216 DirectoryUsage directory_usage = 10026;
217 AppSize app_size = 10027;
218 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700219 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700220 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700221 NumFingerprints num_fingerprints = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700222 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700223 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800224 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700225 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100226 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100227 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700228 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800229 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
230 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
231 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000232 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800233 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800234 BuildInformation build_information = 10044;
David Chenc8a43242017-10-17 16:23:28 -0700235 }
yroa1fe77c2018-02-26 14:22:54 -0800236
Bookatz76aafcf2018-09-17 16:17:10 -0700237 // DO NOT USE field numbers above 100,000 in AOSP.
238 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
239 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700240}
241
Yao Chend54f9dd2017-10-17 17:37:48 +0000242/**
Yangster-mac20877162017-12-22 17:19:39 -0800243 * This proto represents a node of an attribution chain.
244 * Note: All attribution chains are represented as a repeated field of type
245 * AttributionNode. It is understood that in such arrays, the order is that
246 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000247 */
Yangster-mac20877162017-12-22 17:19:39 -0800248message AttributionNode {
249 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800250 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800251
Yangster-mac20877162017-12-22 17:19:39 -0800252 // The (optional) string tag for an element in the attribution chain. If the
253 // element has no tag, it is encoded as an empty string.
254 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700255}
256
Yangster-mac48b3d622018-08-18 12:38:11 -0700257message KeyValuePair {
258 optional int32 key = 1;
259 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700260 int32 value_int = 2;
261 int64 value_long = 3;
262 string value_str = 4;
263 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700264 }
265}
266
267message KeyValuePairsAtom {
268 optional int32 uid = 1;
269 repeated KeyValuePair pairs = 2;
270}
271
Yao Chend54f9dd2017-10-17 17:37:48 +0000272/*
273 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800274 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000275 *
276 * RULES:
277 * - The field ids for each atom must start at 1, and count upwards by 1.
278 * Skipping field ids is not allowed.
279 * - These form an API, so renaming, renumbering or removing fields is
280 * not allowed between android releases. (This is not currently enforced,
281 * but there will be a tool to enforce this restriction).
282 * - The types must be built-in protocol buffer types, namely, no sub-messages
283 * are allowed (yet). The bytes type is also not allowed.
284 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800285 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000286 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800287 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000288 * - A field that is a uid should be a string field, tagged with the [xxx]
289 * annotation. The generated code on android will be represented by UIDs,
290 * and those UIDs will be translated in xxx to those strings.
291 *
292 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700293 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000294 * - If there is a UID, it goes first. Think in an object-oriented fashion.
295 * *****************************************************************************
296 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700297
Yao Chend54f9dd2017-10-17 17:37:48 +0000298/**
Yangster-mace16189a2018-08-26 12:20:16 -0700299 * Logs when the Thermal service HAL notifies the throttling start/stop events.
300 *
301 * Logged from:
302 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
303 */
304message ThermalThrottlingStateChanged {
305 optional android.os.TemperatureTypeEnum sensor_type = 1;
306
307 enum State {
308 UNKNOWN = 0;
309 START = 1;
310 STOP = 2;
311 }
312
313 optional State state = 2;
314
315 optional float temperature = 3;
316}
317
318/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000319 * Logs when the screen state changes.
320 *
321 * Logged from:
322 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
323 */
324message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800325 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700326 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700327}
Yao Chend54f9dd2017-10-17 17:37:48 +0000328
329/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700330 * Logs that the process state of the uid, as determined by ActivityManager
331 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000332 *
333 * Logged from:
334 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
335 */
Bookatzc1a050a2017-10-10 15:49:28 -0700336message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700337 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000338
Bookatzdb026a22018-01-10 19:01:56 -0800339 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700340 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000341}
342
343/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700344 * Logs process state change of a process, as per the activity manager.
345 *
346 * Logged from:
347 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
348 */
349message ProcessStateChanged {
350 optional int32 uid = 1;
351 optional string process_name = 2;
352 optional string package_name = 3;
353 // TODO: remove this when validation is done
354 optional int64 version = 5;
355 // The state, from frameworks/base/core/proto/android/app/enums.proto.
356 optional android.app.ProcessStateEnum state = 4;
357}
358
359/**
360 * Logs when ActivityManagerService sleep state is changed.
361 *
362 * Logged from:
363 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
364 */
365message ActivityManagerSleepStateChanged {
366 // TODO: import frameworks proto
367 enum State {
368 UNKNOWN = 0;
369 ASLEEP = 1;
370 AWAKE = 2;
371 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700372 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700373}
374
375/**
376 * Logs when system memory state changes.
377 *
378 * Logged from:
379 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
380 */
381message MemoryFactorStateChanged {
382 // TODO: import frameworks proto
383 enum State {
384 MEMORY_UNKNOWN = 0;
385 NORMAL = 1; // normal.
386 MODERATE = 2; // moderate memory pressure.
387 LOW = 3; // low memory.
388 CRITICAL = 4; // critical memory.
389
390 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700391 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700392}
393
394/**
395 * Logs when app is using too much cpu, according to ActivityManagerService.
396 *
397 * Logged from:
398 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
399 */
400message ExcessiveCpuUsageReported {
401 optional int32 uid = 1;
402 optional string process_name = 2;
403 optional string package_name = 3;
404 // package version. TODO: remove this when validation is done
405 optional int64 version = 4;
406}
407
408/**
409 * Logs when a cached process is killed, along with its pss.
410 *
411 * Logged from:
412 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
413 */
414message CachedKillReported {
415 optional int32 uid = 1;
416 optional string process_name = 2;
417 optional string package_name = 3;
418 // TODO: remove this when validation is done
419 optional int64 version = 5;
420 optional int64 pss = 4;
421}
422
423/**
424 * Logs when memory stats of a process is reported.
425 *
426 * Logged from:
427 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
428 */
429message ProcessMemoryStatReported {
430 optional int32 uid = 1;
431 optional string process_name = 2;
432 optional string package_name = 3;
433 //TODO: remove this when validation is done
434 optional int64 version = 9;
435 optional int64 pss = 4;
436 optional int64 uss = 5;
437 optional int64 rss = 6;
438 enum Type {
439 ADD_PSS_INTERNAL_SINGLE = 0;
440 ADD_PSS_INTERNAL_ALL_MEM = 1;
441 ADD_PSS_INTERNAL_ALL_POLL = 2;
442 ADD_PSS_EXTERNAL = 3;
443 ADD_PSS_EXTERNAL_SLOW = 4;
444 }
445 optional Type type = 7;
446 optional int64 duration = 8;
447}
448
449/**
Bookatzc1a050a2017-10-10 15:49:28 -0700450 * Logs that a process started, finished, crashed, or ANRed.
451 *
452 * Logged from:
453 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
454 */
455message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700456 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700457
David Chen0b5c90c2018-01-25 16:51:49 -0800458 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800459 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700460
Bookatzddccf0a2017-11-28 16:48:14 -0800461 // What lifecycle state the process changed to.
462 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800463 enum State {
464 FINISHED = 0;
465 STARTED = 1;
466 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800467 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800468 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700469}
470
Bookatzc1a050a2017-10-10 15:49:28 -0700471/**
472 * Logs when the ble scan state changes.
473 *
474 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700475 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700476 */
477message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800478 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700479
480 enum State {
481 OFF = 0;
482 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700483 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
484 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700485 }
486 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700487
Bookatze5ec0b42018-03-26 13:34:56 -0700488 // Does the scan have a filter.
489 optional bool is_filtered = 3;
490 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
491 optional bool is_first_match = 4;
492 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
493 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700494}
495
496/**
497 * Logs reporting of a ble scan finding results.
498 *
499 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700500 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700501 */
Bookatzae6738e2018-09-13 11:38:56 -0700502// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700503message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800504 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700505
506 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800507 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700508}
509
510/**
511 * Logs when a sensor state changes.
512 *
513 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700514 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700515 */
516message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800517 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700518
Bookatzc1a050a2017-10-10 15:49:28 -0700519 // The id (int) of the sensor.
520 optional int32 sensor_id = 2;
521
522 enum State {
523 OFF = 0;
524 ON = 1;
525 }
526 optional State state = 3;
527}
528
Bookatzc1a050a2017-10-10 15:49:28 -0700529/**
530 * Logs when GPS state changes.
531 *
532 * Logged from:
533 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
534 */
535message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800536 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700537
538 enum State {
539 OFF = 0;
540 ON = 1;
541 }
542 optional State state = 2;
543}
544
Bookatz48d362e2018-11-06 15:49:08 -0800545/**
546 * Logs when GPS signal quality.
547 *
548 * Logged from:
549 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
550 */
551message GpsSignalQualityChanged {
552 optional android.server.location.GpsSignalQualityEnum level = 1;
553}
554
Bookatzc1a050a2017-10-10 15:49:28 -0700555
556/**
557 * Logs when a sync manager sync state changes.
558 *
559 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700560 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700561 */
562message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800563 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700564
David Chen0b5c90c2018-01-25 16:51:49 -0800565 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800566 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700567
568 enum State {
569 OFF = 0;
570 ON = 1;
571 }
572 optional State state = 3;
573}
574
Yangster-mac96353002018-09-05 11:18:55 -0700575/*
576 * Deferred job stats.
577 *
578 * Logged from:
579 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
580*/
581message DeferredJobStatsReported {
582 repeated AttributionNode attribution_node = 1;
583
584 // Number of jobs deferred.
585 optional int32 num_jobs_deferred = 2;
586
587 // Time since the last job runs.
588 optional int64 time_since_last_job_millis = 3;
589}
590
Bookatzc1a050a2017-10-10 15:49:28 -0700591/**
592 * Logs when a job scheduler job state changes.
593 *
594 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700595 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700596 */
597message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800598 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700599
600 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800601 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700602
603 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800604 FINISHED = 0;
605 STARTED = 1;
606 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700607 }
608 optional State state = 3;
609
Tej Singh33a412b2018-03-16 18:43:59 -0700610 // The reason a job has stopped.
611 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700612 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700613 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700614}
615
616/**
617 * Logs when the audio state changes.
618 *
619 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700620 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700621 */
622message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800623 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700624
625 enum State {
626 OFF = 0;
627 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700628 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
629 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700630 }
631 optional State state = 2;
632}
633
634/**
635 * Logs when the video codec state changes.
636 *
637 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700638 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700639 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800640message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800641 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700642
643 enum State {
644 OFF = 0;
645 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700646 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
647 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700648 }
649 optional State state = 2;
650}
651
652/**
653 * Logs when the flashlight state changes.
654 *
655 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700656 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700657 */
658message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800659 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700660
661 enum State {
662 OFF = 0;
663 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700664 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
665 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700666 }
667 optional State state = 2;
668}
669
670/**
671 * Logs when the camera state changes.
672 *
673 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700674 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700675 */
676message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800677 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700678
679 enum State {
680 OFF = 0;
681 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700682 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
683 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700684 }
685 optional State state = 2;
686}
687
688/**
689 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000690 *
691 * Logged from:
692 * TODO
693 */
Bookatzd6746242017-10-24 18:39:35 -0700694message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800695 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000696
Bookatz1a1b0462018-01-12 11:47:03 -0800697 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
698 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700699 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700700
701 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
702 optional string tag = 3;
703
704 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800705 RELEASE = 0;
706 ACQUIRE = 1;
707 CHANGE_RELEASE = 2;
708 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700709 }
710 optional State state = 4;
711}
712
713/**
Bookatzc1a050a2017-10-10 15:49:28 -0700714 * Logs when a partial wakelock is considered 'long' (over 1 min).
715 *
716 * Logged from:
717 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
718 */
719message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800720 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700721
Yao Chend54f9dd2017-10-17 17:37:48 +0000722 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
723 optional string tag = 2;
724
Bookatzc1a050a2017-10-10 15:49:28 -0700725 // TODO: I have no idea what this is.
726 optional string history_tag = 3;
727
728 enum State {
729 OFF = 0;
730 ON = 1;
731 }
732 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000733}
734
Bookatzc1a050a2017-10-10 15:49:28 -0700735/**
Bookatza66083f2018-09-20 17:24:00 -0700736 * Logs when the device is interactive, according to the PowerManager Notifier.
737 *
738 * Logged from:
739 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
740 */
741message InteractiveStateChanged {
742 enum State {
743 OFF = 0;
744 ON = 1;
745 }
746 optional State state = 1;
747}
748
749/**
Bookatzc1a050a2017-10-10 15:49:28 -0700750 * Logs Battery Saver state change.
751 *
752 * Logged from:
753 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
754 */
755message BatterySaverModeStateChanged {
756 enum State {
757 OFF = 0;
758 ON = 1;
759 }
760 optional State state = 1;
761}
762
763/**
764 * Logs Doze mode state change.
765 *
766 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800767 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700768 */
769message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800770 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800771}
772
773
774/**
775 * Logs state change of Doze mode including maintenance windows.
776 *
777 * Logged from:
778 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
779 */
780message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800781 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700782}
783
784/**
785 * Logs screen brightness level.
786 *
787 * Logged from:
788 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
789 */
790message ScreenBrightnessChanged {
791 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
792 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700793}
794
795/**
796 * Logs battery level (percent full, from 0 to 100).
797 *
798 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700799 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700800 */
801message BatteryLevelChanged {
802 // Battery level. Should be in [0, 100].
803 optional int32 battery_level = 1;
804}
805
806/**
807 * Logs change in charging status of the device.
808 *
809 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700810 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700811 */
812message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800813 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
814 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700815}
816
817/**
818 * Logs whether the device is plugged in, and what power source it is using.
819 *
820 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700821 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700822 */
823message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800824 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
825 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700826}
827
Bookatz8c6571b2017-10-24 15:04:41 -0700828/**
829 * Logs when an app's wakeup alarm fires.
830 *
831 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700832 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700833 */
834message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800835 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800836
837 // Name of the wakeup alarm.
838 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700839
840 // Name of source package (for historical reasons, since BatteryStats tracked it).
841 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800842}
843
844/**
845 * Logs when an an app causes the mobile radio to change state.
846 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
847 *
848 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700849 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800850 */
851message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800852 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800853
Bookatz1a1b0462018-01-12 11:47:03 -0800854 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
855 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800856}
857
858/**
859 * Logs when an an app causes the wifi radio to change state.
860 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
861 *
862 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700863 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800864 */
865message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800866 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800867
Bookatz1a1b0462018-01-12 11:47:03 -0800868 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
869 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700870}
871
872/**
873 * Logs kernel wakeup reasons and aborts.
874 *
875 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700876 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700877 */
878message KernelWakeupReported {
879 // Name of the kernel wakeup reason (or abort).
880 optional string wakeup_reason_name = 1;
881
882 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800883 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700884}
885
886/**
Bookatzda1798c2018-12-13 14:16:00 -0800887 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800888 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800889 *
890 * Logged from:
891 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
892 */
893message WifiEnabledStateChanged {
894 enum State {
895 OFF = 0;
896 ON = 1;
897 }
898 optional State state = 1;
899}
900
901/**
902 * 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 -0800903 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
904 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800905 *
906 * Logged from:
907 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
908 */
909message WifiRunningStateChanged {
910 repeated AttributionNode attribution_node = 1;
911
912 enum State {
913 OFF = 0;
914 ON = 1;
915 }
916 optional State state = 2;
917}
918
919/**
Bookatze5885242017-10-24 20:10:31 -0700920 * Logs wifi locks held by an app.
921 *
922 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700923 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700924 */
925message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800926 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700927
928 enum State {
929 OFF = 0;
930 ON = 1;
931 }
932 optional State state = 2;
933}
934
935/**
936 * Logs wifi signal strength changes.
937 *
938 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800939 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -0700940 */
941message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800942 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
943 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700944}
945
946/**
947 * Logs wifi scans performed by an app.
948 *
949 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800950 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -0700951 */
952message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800953 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700954
955 enum State {
956 OFF = 0;
957 ON = 1;
958 }
959 optional State state = 2;
960}
961
962/**
Tej Singh4503e102018-01-04 14:35:01 -0800963 * Logs wifi multicast locks held by an app
964 *
965 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800966 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -0800967 */
968message WifiMulticastLockStateChanged {
969 repeated AttributionNode attribution_node = 1;
970
971 enum State {
972 OFF = 0;
973 ON = 1;
974 }
975 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -0800976
977 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -0800978}
979
980/**
Tej Singh1ea42892018-01-19 09:27:00 -0800981 * Logs shutdown reason and duration on next boot.
982 *
983 * Logged from:
984 * frameworks/base/core/java/com/android/server/BootReceiver.java
985 */
986message ShutdownSequenceReported {
987 // True if shutdown is for a reboot. Default: false if we do not know.
988 optional bool reboot = 1;
989
990 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
991 optional string reason = 2;
992
993 // Beginning of shutdown time in ms using wall clock time since unix epoch.
994 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800995 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800996
997 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800998 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800999}
1000
Tej Singh6483ea42018-01-25 17:45:49 -08001001
1002/**
1003 * Logs boot reason and duration.
1004 *
1005 * Logged from:
1006 * system/core/bootstat/bootstat.cpp
1007 */
1008message BootSequenceReported {
1009 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1010 // Default: "<EMPTY>" if not available.
1011 optional string bootloader_reason = 1;
1012
1013 // Reason for system boot. Eg. bootloader, reboot,userrequested
1014 // Default: "<EMPTY>" if not available.
1015 optional string system_reason = 2;
1016
1017 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001018 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001019
1020 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001021 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001022
1023 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001024 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001025
1026 // Time since last boot in ms. Default: 0 if not available.
1027 optional int64 time_since_last_boot = 6;
1028}
1029
Tej Singhc477d9c2018-02-05 18:31:39 -08001030
1031/**
1032 * Logs call state and disconnect cause (if applicable).
1033 *
1034 * Logged from:
1035 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1036 */
1037message CallStateChanged {
1038 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1039 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1040 optional android.telecom.CallStateEnum call_state = 1;
1041
1042 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1043 // This value is only applicable when the call_state is DISCONNECTED, and
1044 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1045 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1046 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1047
1048 // True if the call is self-managed, which are apps that use the
1049 // telecom infrastructure to make their own calls.
1050 optional bool self_managed = 3;
1051
1052 // True if call is external. External calls are calls on connected Wear
1053 // devices but show up in Telecom so the user can pull them onto the device.
1054 optional bool external_call = 4;
1055}
1056
Tej Singh1ea42892018-01-19 09:27:00 -08001057/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001058 * Logs keyguard state. The keyguard is the lock screen.
1059 *
1060 * Logged from:
1061 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1062 */
1063message KeyguardStateChanged {
1064 enum State {
1065 UNKNOWN = 0;
1066 // The keyguard is hidden when the phone is unlocked.
1067 HIDDEN = 1;
1068 // The keyguard is shown when the phone is locked (screen turns off).
1069 SHOWN= 2;
1070 // The keyguard is occluded when something is overlaying the keyguard.
1071 // Eg. Opening the camera while on the lock screen.
1072 OCCLUDED = 3;
1073 }
1074 optional State state = 1;
1075}
1076
1077/**
1078 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1079 * prompts the user to enter a password (pattern, pin, etc).
1080 *
1081 * Logged from:
1082 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1083 */
1084
1085message KeyguardBouncerStateChanged {
1086 enum State {
1087 UNKNOWN = 0;
1088 // Bouncer is hidden, either as a result of successfully entering the
1089 // password, screen timing out, or user going back to lock screen.
1090 HIDDEN = 1;
1091 // This is when the user is being prompted to enter the password.
1092 SHOWN = 2;
1093 }
1094 optional State state = 1;
1095}
1096
1097/**
1098 * Logs the result of entering a password into the keyguard bouncer.
1099 *
1100 * Logged from:
1101 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1102 */
1103message KeyguardBouncerPasswordEntered {
1104 enum BouncerResult {
1105 UNKNOWN = 0;
1106 // The password entered was incorrect.
1107 FAILURE = 1;
1108 // The password entered was correct.
1109 SUCCESS = 2;
1110 }
1111 optional BouncerResult result = 1;
1112}
1113
Tej Singha883b372018-02-15 11:30:01 -08001114/*
1115 * Logs changes to the configuration of the device. The configuration is defined
1116 * in frameworks/base/core/java/android/content/res/Configuration.java
1117 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1118 * Please go there to interpret the possible values each field can be.
1119 *
1120 * Logged from:
1121 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1122 */
1123message ResourceConfigurationChanged {
1124 // Bit mask of color capabilities of the screen.
1125 // Contains information about the color gamut and hdr mode of the screen.
1126 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001127 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001128
1129 // The target screen density being rendered to.
1130 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001131 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001132
1133 // Current user preference for the scaling factor for fonts,
1134 // relative to the base density scaling.
1135 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001136 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001137
1138 // Flag indicating whether the hard keyboard is hidden.
1139 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001140 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001141
1142 // The type of keyboard attached to the device.
1143 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1144 optional int32 keyboard = 5;
1145
1146 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1147 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001148 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001149
1150 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1151 // 0 if undefined.
1152 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1153 optional int32 mcc = 7;
1154
1155 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1156 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1157 // MNC_ZERO symbol defined in Configuration.java.
1158 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1159 optional int32 mnc = 8;
1160
1161 // The kind of navigation available on the device.
1162 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1163 optional int32 navigation = 9;
1164
1165 // Flag indicating whether the navigation is available.
1166 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001167 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001168
1169 // Overall orientation of the screen.
1170 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1171 optional int32 orientation = 11;
1172
1173 // The current height of the available screen space, in dp units.
1174 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001175 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001176
1177 // Bit mask of overall layout of the screen.
1178 // Contains information about screen size, whether the screen is wider/taller
1179 // than normal, whether the screen layout is right-tl-left or left-to-right,
1180 // and whether the screen has a rounded shape.
1181 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001182 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001183
1184 // Current width of the available screen space, in dp units.
1185 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001186 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001187
1188 // The smallest screen size an application will see in normal operation.
1189 // This is the smallest value of both screenWidthDp and screenHeightDp
1190 // in portrait and landscape.
1191 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001192 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001193
1194 // The type of touch screen attached to the device.
1195 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1196 optional int32 touchscreen = 16;
1197
1198 // Bit mask of the ui mode.
1199 // Contains information about the overall ui mode of the device.
1200 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1201 // Also contains information about whether the device is in night mode.
1202 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001203 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001204}
1205
Tej Singheee317b2018-03-07 19:28:05 -08001206
1207/**
1208 * Logs changes in the connection state of the mobile radio.
1209 *
1210 * Logged from:
1211 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1212 */
1213message MobileConnectionStateChanged {
1214 // States are from the state machine DataConnection.java.
1215 enum State {
1216 UNKNOWN = 0;
1217 // The connection is inactive, or disconnected.
1218 INACTIVE = 1;
1219 // The connection is being activated, or connecting.
1220 ACTIVATING = 2;
1221 // The connection is active, or connected.
1222 ACTIVE = 3;
1223 // The connection is disconnecting.
1224 DISCONNECTING = 4;
1225 // The connection is disconnecting after creating a connection.
1226 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1227 }
1228 optional State state = 1;
1229 // For multi-sim phones, this distinguishes between the sim cards.
1230 optional int32 sim_slot_index = 2;
1231 // Used to identify the connection. Starts at 0 and increments by 1 for
1232 // every new network created. Resets whenever the device reboots.
1233 optional int32 data_connection_id = 3;
1234 // A bitmask for the capabilities of this connection.
1235 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1236 // Default value (if we have no information): 0
1237 optional int64 capabilities = 4;
1238 // If this connection has internet.
1239 // This just checks if the DEFAULT bit of capabilities is set.
1240 optional bool has_internet = 5;
1241}
1242
1243/**
1244 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1245 *
1246 * Logged from:
1247 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1248 */
1249message MobileRadioTechnologyChanged {
1250 optional android.telephony.NetworkTypeEnum state = 1;
1251 // For multi-sim phones, this distinguishes between the sim cards.
1252 optional int32 sim_slot_index = 2;
1253}
1254
Andrew Chantb56388b2018-03-22 21:07:33 -07001255/**
1256 * Logs the VID and PID of any connected USB devices.
1257 *
1258 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1259 *
1260 * Logged by Vendor.
1261 */
1262message UsbDeviceAttached {
1263 optional int32 vid = 1;
1264 optional int32 pid = 2;
1265 optional bool has_audio = 3;
1266 optional bool has_hid = 4;
1267 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001268 enum State {
1269 STATE_DISCONNECTED = 0;
1270 STATE_CONNECTED = 1;
1271 }
1272 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001273 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001274}
1275
Tej Singheee317b2018-03-07 19:28:05 -08001276
Tej Singhdd7bd352018-02-09 19:33:15 -08001277/**
Tej Singh5d991e12018-03-09 19:48:11 -08001278 * Logs when Bluetooth is enabled and disabled.
1279 *
1280 * Logged from:
1281 * services/core/java/com/android/server/BluetoothManagerService.java
1282 */
1283message BluetoothEnabledStateChanged {
1284 repeated AttributionNode attribution_node = 1;
1285 // Whether or not bluetooth is enabled on the device.
1286 enum State {
1287 UNKNOWN = 0;
1288 ENABLED = 1;
1289 DISABLED = 2;
1290 }
1291 optional State state = 2;
1292 // The reason for being enabled/disabled.
1293 // Eg. Airplane mode, crash, application request.
1294 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1295 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001296 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001297}
1298
1299/**
1300 * Logs when a Bluetooth device connects and disconnects.
1301 *
1302 * Logged from:
1303 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1304 */
1305message BluetoothConnectionStateChanged {
1306 // The state of the connection.
1307 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1308 optional android.bluetooth.ConnectionStateEnum state = 1;
1309 // An identifier that can be used to match connect and disconnect events.
1310 // Currently is last two bytes of a hash of a device level ID and
1311 // the mac address of the bluetooth device that is connected.
1312 optional int32 obfuscated_id = 2;
1313 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1314 // From android.bluetooth.BluetoothAdapter.java
1315 optional int32 bt_profile = 3;
1316}
1317
1318/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001319 * Logs when something is plugged into or removed from the USB-C connector.
1320 *
1321 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001322 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08001323 */
1324message UsbConnectorStateChanged {
1325 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001326 STATE_DISCONNECTED = 0;
1327 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08001328 }
1329 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001330 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08001331 // Last active session in ms.
1332 // 0 when the port is in connected state.
1333 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001334}
1335
1336/**
1337 * Logs the reported speaker impedance.
1338 *
1339 * Logged from:
1340 * Vendor audio implementation.
1341 */
1342message SpeakerImpedanceReported {
1343 optional int32 speaker_location = 1;
1344 optional int32 impedance = 2;
1345}
1346
1347/**
1348 * Logs the report of a failed hardware.
1349 *
1350 * Logged from:
1351 * Vendor HALs.
1352 *
1353 */
1354message HardwareFailed {
1355 enum HardwareType {
1356 HARDWARE_FAILED_UNKNOWN = 0;
1357 HARDWARE_FAILED_MICROPHONE = 1;
1358 HARDWARE_FAILED_CODEC = 2;
1359 HARDWARE_FAILED_SPEAKER = 3;
1360 HARDWARE_FAILED_FINGERPRINT = 4;
1361 }
1362 optional HardwareType hardware_type = 1;
1363
1364 /* hardware_location allows vendors to differentiate between multiple instances of
1365 * the same hardware_type. The specific locations are vendor defined integers,
1366 * referring to board-specific numbering schemes.
1367 */
1368 optional int32 hardware_location = 2;
1369
1370 /* failure_code is specific to the HardwareType of the failed hardware.
1371 * It should use the enum values defined below.
1372 */
1373 enum MicrophoneFailureCode {
1374 MICROPHONE_FAILURE_COMPLETE = 0;
1375 }
1376 enum CodecFailureCode {
1377 CODEC_FAILURE_COMPLETE = 0;
1378 }
1379 enum SpeakerFailureCode {
1380 SPEAKER_FAILURE_COMPLETE = 0;
1381 SPEAKER_FAILURE_HIGH_Z = 1;
1382 SPEAKER_FAILURE_SHORT = 2;
1383 }
1384 enum FingerprintFailureCode {
1385 FINGERPRINT_FAILURE_COMPLETE = 0;
1386 FINGERPRINT_SENSOR_BROKEN = 1;
1387 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1388 }
1389 optional int32 failure_code = 3;
1390}
1391
1392/**
1393 * Log an event when the device has been physically dropped.
1394 * Reported from the /vendor partition.
1395 */
1396message PhysicalDropDetected {
1397 // Confidence that the event was actually a drop, 0 -> 100
1398 optional int32 confidence_pctg = 1;
1399 // Peak acceleration of the drop, in 1/1000s of a g.
1400 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001401 // Duration of freefall in ms
1402 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001403}
1404
1405/**
1406 * Log bucketed battery charge cycles.
1407 *
1408 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08001409 * a given charge point. For example, if 10 cycle buckets are
1410 * initialized, bucket 1 is the lowest 1/10th of the battery,
1411 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08001412 *
1413 * Logged from:
1414 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1415 */
1416message ChargeCyclesReported {
1417 optional int32 cycle_bucket_1 = 1;
1418 optional int32 cycle_bucket_2 = 2;
1419 optional int32 cycle_bucket_3 = 3;
1420 optional int32 cycle_bucket_4 = 4;
1421 optional int32 cycle_bucket_5 = 5;
1422 optional int32 cycle_bucket_6 = 6;
1423 optional int32 cycle_bucket_7 = 7;
1424 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08001425 optional int32 cycle_bucket_9 = 9;
1426 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08001427}
1428
1429/**
Howard Roa46b6582018-09-18 16:45:02 -07001430 * Log battery health snapshot.
1431 *
1432 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1433 * are snapshotted periodically over 24hrs.
1434 */
1435message BatteryHealthSnapshot {
1436 enum BatterySnapshotType {
1437 UNKNOWN = 0;
1438 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1439 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1440 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1441 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1442 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1443 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1444 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1445 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1446 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1447 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1448 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1449 }
1450 optional BatterySnapshotType type = 1;
1451 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001452 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001453 // Voltage Battery Voltage, in microVolts.
1454 optional int32 voltage_micro_volt = 3;
1455 // Current Battery current, in microAmps.
1456 optional int32 current_micro_amps = 4;
1457 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1458 optional int32 open_circuit_micro_volt = 5;
1459 // Resistance Battery Resistance, in microOhms.
1460 optional int32 resistance_micro_ohm = 6;
1461 // Level Battery Level, as % of full.
1462 optional int32 level_percent = 7;
1463}
1464
1465/**
1466 * Log slow I/O operations on the primary storage.
1467 */
1468message SlowIo {
1469 // Classifications of IO Operations.
1470 enum IoOperation {
1471 UNKNOWN = 0;
1472 READ = 1;
1473 WRITE = 2;
1474 UNMAP = 3;
1475 SYNC = 4;
1476 }
1477 optional IoOperation operation = 1;
1478
1479 // The number of slow IO operations of this type over 24 hours.
1480 optional int32 count = 2;
1481}
1482
1483/**
1484 * Log battery caused shutdown with the last recorded voltage.
1485 */
1486message BatteryCausedShutdown {
1487 // The last recorded battery voltage prior to shutdown.
1488 optional int32 last_recorded_micro_volt = 1;
1489}
1490
1491/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001492 * Logs the duration of a davey (jank of >=700ms) when it occurs
1493 *
1494 * Logged from:
1495 * frameworks/base/libs/hwui/JankTracker.cpp
1496 */
1497message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001498 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001499 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001500
Tej Singhbb8554a2018-01-26 11:59:14 -08001501 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001502 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001503}
1504
1505/**
Bookatze5885242017-10-24 20:10:31 -07001506 * Logs phone signal strength changes.
1507 *
1508 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001509 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001510 */
1511message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001512 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1513 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001514}
1515
Yangster4ccebea2018-10-09 17:09:02 -07001516
1517/**
1518 * Logs when the phone state, sim state or signal strength changes
1519 *
1520 * Logged from:
1521 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1522 */
1523message PhoneServiceStateChanged {
1524 optional android.telephony.ServiceStateEnum state = 1;
1525 optional android.telephony.SimStateEnum sim_state = 2;
1526 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1527}
1528
1529/**
1530 * Logs when the phone becomes on or off.
1531 *
1532 * Logged from:
1533 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1534 */
1535message PhoneStateChanged {
1536 enum State {
1537 OFF = 0;
1538 ON = 1;
1539 }
1540 optional State state = 1;
1541}
1542
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001543message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07001544 optional android.stats.launcher.LauncherAction action = 1;
1545 optional android.stats.launcher.LauncherState src_state = 2;
1546 optional android.stats.launcher.LauncherState dst_state = 3;
1547 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001548 optional bool is_swipe_up_enabled = 5;
1549}
1550
David Chenc28b2bb2017-10-24 12:52:52 -07001551/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001552 * Logs when Settings UI has changed.
1553 *
1554 * Logged from:
1555 * packages/apps/Settings
1556 */
1557message SettingsUIChanged {
1558 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001559 * Where this SettingsUIChange event comes from. For example, if
1560 * it's a PAGE_VISIBLE event, where the page is opened from.
1561 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001562 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001563
1564 /**
1565 * What the UI action is.
1566 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001567 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001568
1569 /**
1570 * Where the action is happening
1571 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001572 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001573
1574 /**
1575 * What preference changed in this event.
1576 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001577 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07001578
1579 /**
1580 * The new value of the changed preference.
1581 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001582 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07001583}
1584
1585/**
David Chenc28b2bb2017-10-24 12:52:52 -07001586 * Logs that a setting was updated.
1587 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001588 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001589 * The tag and is_default allow resetting of settings to default values based on the specified
1590 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1591 */
1592message SettingChanged {
1593 // The name of the setting.
1594 optional string setting = 1;
1595
1596 // The change being imposed on this setting. May represent a number, eg "3".
1597 optional string value = 2;
1598
1599 // The new value of this setting. For most settings, this is same as value. For some settings,
1600 // value is +X or -X where X represents an element in a set. For example, if the previous value
1601 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1602 // The +/- feature is currently only used for location_providers_allowed.
1603 optional string new_value = 3;
1604
1605 // The previous value of this setting.
1606 optional string prev_value = 4;
1607
1608 // The tag used with the is_default for resetting sets of settings. This is generally null.
1609 optional string tag = 5;
1610
Bookatz90867622018-01-31 15:05:57 -08001611 // True if this setting with tag should be resettable.
1612 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001613
David Chenbd789912018-03-16 17:19:55 -07001614 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001615 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001616
1617 enum ChangeReason {
1618 UPDATED = 1; // Updated can be an insertion or an update.
1619 DELETED = 2;
1620 }
1621 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001622}
Chenjie Yub3dda412017-10-24 13:41:59 -07001623
Chenjie Yu05013b32017-11-21 10:21:41 -08001624/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001625 * Logs activity going to foreground or background
1626 *
1627 * Logged from:
1628 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1629 */
1630message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001631 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001632 optional string pkg_name = 2;
1633 optional string class_name = 3;
1634
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001635 enum State {
1636 BACKGROUND = 0;
1637 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001638 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001639 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001640}
David Chenc8a43242017-10-17 16:23:28 -07001641
1642/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001643 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001644 * Logged from:
1645 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1646 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001647message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001648 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001649
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001650 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001651
1652 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001653 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001654 optional string process_name = 3;
1655
1656 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001657 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001658
1659 optional string package_name = 5;
1660
1661 enum InstantApp {
1662 UNAVAILABLE = 0;
1663 FALSE = 1;
1664 TRUE = 2;
1665 }
1666 optional InstantApp is_instant_app = 6;
1667
1668 enum ForegroundState {
1669 UNKNOWN = 0;
1670 BACKGROUND = 1;
1671 FOREGROUND = 2;
1672 }
1673 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08001674
1675 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001676}
David Chen9e3808c2017-11-20 17:25:34 -08001677
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001678/**
1679 * Logs when a WTF (What a Terrible Failure) happened.
1680 * Logged from:
1681 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1682 */
1683message WTFOccurred {
1684 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001685
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001686 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001687
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001688 // The name of the process.
1689 // system_server if it is not by an app
1690 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001691
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001692 // The pid if available. -1 means not available.
1693 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08001694
1695 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001696}
1697
1698/**
1699 * Logs when system server reports low memory.
1700 * Logged from:
1701 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1702 */
1703message LowMemReported {
1704}
1705
1706/**
1707 * Logs when an app ANR (App Not Responding) occurs.
1708 * Logged from:
1709 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1710 */
1711message ANROccurred {
1712 optional int32 uid = 1 [(is_uid) = true];
1713
1714 optional string process_name = 2;
1715
1716 optional string short_component_name = 3;
1717
1718 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001719
1720 enum InstantApp {
1721 UNAVAILABLE = 0;
1722 FALSE = 1;
1723 TRUE = 2;
1724 }
1725 optional InstantApp is_instant_app = 5;
1726
1727 enum ForegroundState {
1728 UNKNOWN = 0;
1729 BACKGROUND = 1;
1730 FOREGROUND = 2;
1731 }
1732 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08001733
1734 optional android.server.ErrorSource error_source = 7;
1735
1736 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08001737}
1738
Bookatza7020bd2018-08-28 16:29:35 -07001739/**
1740 * Logs when the vibrator state changes.
1741 * Logged from:
1742 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1743 */
1744message VibratorStateChanged {
1745 repeated AttributionNode attribution_node = 1;
1746
1747 enum State {
1748 OFF = 0;
1749 ON = 1;
1750 }
1751 optional State state = 2;
1752
1753 // Duration (in milliseconds) requested to keep the vibrator on.
1754 // Only applicable for State == ON.
1755 optional int64 duration_millis = 3;
1756}
1757
David Chen0a368b22017-12-06 16:28:16 -08001758/*
1759 * Allows other apps to push events into statsd.
1760 * Logged from:
1761 * frameworks/base/core/java/android/util/StatsLog.java
1762 */
David Chen0b5c90c2018-01-25 16:51:49 -08001763message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001764 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001765 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001766
1767 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1768 optional int32 label = 2;
1769
1770 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1771 // predicates for the metrics).
1772 enum State {
1773 UNKNOWN = 0;
1774 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1775 STOP = 2;
1776 START = 3;
1777 }
1778 optional State state = 3;
1779}
1780
David Chen9e3808c2017-11-20 17:25:34 -08001781/**
Bookatz7948c872018-09-04 12:58:33 -07001782 * Logs the wall-clock time when a significant wall-clock time shift occurs.
1783 * For example, this could be due to the user manually changing the time.
1784 *
1785 * Logged from:
1786 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
1787 */
1788message WallClockTimeShifted {
1789 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
1790 optional int64 wall_clock_timestamp_millis = 1;
1791}
1792
1793/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001794 * Logs when statsd detects an anomaly.
1795 *
1796 * Logged from:
1797 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1798 */
1799message AnomalyDetected {
1800 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001801 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001802
Yangster-mac94e197c2018-01-02 16:03:03 -08001803 // Id of the config whose anomaly detection alert fired.
1804 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001805
Yangster-mac94e197c2018-01-02 16:03:03 -08001806 // Id of the alert (i.e. name of the anomaly that was detected).
1807 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001808}
1809
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001810message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001811 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001812 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001813
1814 // The app package name.
1815 optional string pkg_name = 2;
1816
1817 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001818 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001819 WARM = 1;
1820 HOT = 2;
1821 COLD = 3;
1822 }
1823 // The transition type.
1824 optional TransitionType type = 3;
1825
1826 // The activity name.
1827 optional string activity_name = 4;
1828
1829 // The name of the calling app. Empty if not set.
1830 optional string calling_pkg_name = 5;
1831
1832 // Whether the app is an instant app.
1833 optional bool is_instant_app = 6;
1834
1835 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001836 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001837
Bookatz80d11a02018-01-16 10:46:35 -08001838 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001839
David Chen0b5c90c2018-01-25 16:51:49 -08001840 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001841 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001842 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001843 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001844 optional int32 bind_application_delay_millis = 11;
1845 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001846
1847 // Empty if not set.
1848 optional string launch_token = 13;
1849
Calin Juravle759fbda2018-02-20 19:52:30 +00001850 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001851 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001852
1853 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001854 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001855}
1856
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001857message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001858 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001859 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001860
1861 // The app package name.
1862 optional string pkg_name = 2;
1863
1864 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001865 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001866 WARM = 1;
1867 HOT = 2;
1868 COLD = 3;
1869 }
1870 // The transition type.
1871 optional TransitionType type = 3;
1872
1873 // The activity name.
1874 optional string activity_name = 4;
1875}
1876
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001877message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001878 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001879 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001880
1881 // The app package name.
1882 optional string pkg_name = 2;
1883
1884 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001885 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001886 WITH_BUNDLE = 1;
1887 WITHOUT_BUNDLE = 2;
1888 }
1889 // The transition type.
1890 optional TransitionType type = 3;
1891
1892 // The activity name.
1893 optional string activity_name = 4;
1894
1895 optional bool transition_process_running = 5;
1896
1897 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001898 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001899}
1900
Bookatz8fcd09a2017-12-18 13:01:10 -08001901/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001902 * Logs a picture-in-picture action
1903 * Logged from:
1904 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1905 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1906 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1907 */
1908message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001909 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001910 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001911
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001912 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001913
Chenjie Yu52cacc62017-12-08 18:11:45 -08001914 enum State {
1915 ENTERED = 1;
1916 EXPANDED_TO_FULL_SCREEN = 2;
1917 MINIMIZED = 3;
1918 DISMISSED = 4;
1919 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001920 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001921}
1922
1923/**
Chenjie Yue8904192017-12-08 19:12:57 -08001924 * Logs overlay action
1925 * Logged from:
1926 * services/core/java/com/android/server/wm/Session.java
1927 */
1928message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001929 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001930
1931 optional string package_name = 2;
1932
1933 optional bool using_alert_window = 3;
1934
1935 enum State {
1936 ENTERED = 1;
1937 EXITED = 2;
1938 }
1939 optional State state = 4;
1940}
1941
Chenjie Yuccfe6452018-01-30 11:33:21 -08001942/*
1943 * Logs foreground service starts and stops.
1944 * Note that this is not when a service starts or stops, but when it is
1945 * considered foreground.
1946 * Logged from
1947 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1948 */
1949message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001950 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001951 // package_name + "/" + class_name
1952 optional string short_name = 2;
1953
1954 enum State {
1955 ENTER = 1;
1956 EXIT = 2;
1957 }
1958 optional State state = 3;
1959}
1960
Chenjie Yue8904192017-12-08 19:12:57 -08001961/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001962 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1963 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1964 * attributed back to the parent (host) uid. One example is Chrome.
1965 *
1966 * Logged from:
1967 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1968 */
1969message IsolatedUidChanged {
1970 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001971 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07001972 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001973 optional int32 parent_uid = 1;
1974
1975 optional int32 isolated_uid = 2;
1976
1977 // We expect an isolated uid to be removed before if it's used for another parent uid.
1978 enum Event {
1979 REMOVED = 0;
1980 CREATED = 1;
1981 }
1982 optional Event event = 3;
1983}
1984
1985/*
1986 * Logs the reception of an incoming network packet causing the main system to wake up for
1987 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1988 * and processed by WakeupController.cpp.
1989 */
1990message PacketWakeupOccurred {
1991 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1992 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001993 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001994 // The interface name on which the packet was received.
1995 optional string iface = 2;
1996 // The ethertype value of the packet.
1997 optional int32 ethertype = 3;
1998 // String representation of the destination MAC address of the packet.
1999 optional string destination_hardware_address = 4;
2000 // String representation of the source address of the packet if this was an IP packet.
2001 optional string source_ip = 5;
2002 // String representation of the destination address of the packet if this was an IP packet.
2003 optional string destination_ip = 6;
2004 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2005 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2006 // families.
2007 optional int32 ip_next_header = 7;
2008 // The source port if this was a TCP or UDP packet.
2009 optional int32 source_port = 8;
2010 // The destination port if this was a TCP or UDP packet.
2011 optional int32 destination_port = 9;
2012}
2013
2014/*
2015 * Logs the memory stats for an app on startup.
2016 * Logged from:
2017 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2018 */
2019message AppStartMemoryStateCaptured {
2020 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002021 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002022
2023 // The process name.
2024 optional string process_name = 2;
2025
2026 // The activity name.
2027 optional string activity_name = 3;
2028
2029 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002030 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002031
2032 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002033 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002034
2035 // RSS
2036 optional int64 rss_in_bytes = 6;
2037
2038 // CACHE
2039 optional int64 cache_in_bytes = 7;
2040
2041 // SWAP
2042 optional int64 swap_in_bytes = 8;
2043}
2044
2045/*
2046 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2047 * for LMK event.
2048 * Logged from:
2049 * system/core/lmkd/lmkd.c
2050 */
2051message LmkStateChanged {
2052 enum State {
2053 UNKNOWN = 0;
2054 START = 1;
2055 STOP = 2;
2056 }
2057 optional State state = 1;
2058}
2059
2060/*
2061 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2062 * Logged from:
2063 * system/core/lmkd/lmkd.c
2064 */
2065message LmkKillOccurred {
2066 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002067 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002068
2069 // The process name.
2070 optional string process_name = 2;
2071
2072 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002073 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002074
2075 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002076 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002077
2078 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002079 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002080
2081 // RSS
2082 optional int64 rss_in_bytes = 6;
2083
2084 // CACHE
2085 optional int64 cache_in_bytes = 7;
2086
2087 // SWAP
2088 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002089
2090 // The elapsed real time of start of the process.
2091 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002092}
2093
Rajeev Kumar51b54602018-03-01 12:18:26 -08002094/*
2095 * Logs when the ActivityManagerService detects that an app died.
2096 *
2097 * Logged from:
2098 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2099 */
2100message AppDied {
2101 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002102 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002103}
2104
Howard Ro21a039c2018-08-06 14:55:47 -07002105/**
2106 * An atom for generic metrics logging. Available from Android Q.
2107 */
2108message GenericAtom {
2109 // The uid of the application that sent this custom atom.
2110 optional int32 uid = 1 [(is_uid) = true];
2111
2112 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002113 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002114}
2115
Tej Singhd6d6d772018-09-05 17:41:25 -07002116/**
2117 * Logs when a fingerprint acquire event occurs.
2118 *
2119 * Logged from:
2120 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2121 */
2122message FingerprintAcquired {
2123 // The associated user. Eg: 0 for owners, 10+ for others.
2124 // Defined in android/os/UserHandle.java
2125 optional int32 user = 1;
2126 // If this acquire is for a crypto fingerprint.
2127 // e.g. Secure purchases, unlock password storage.
2128 optional bool is_crypto = 2;
2129}
2130
2131/**
2132 * Logs when a fingerprint authentication event occurs.
2133 *
2134 * Logged from:
2135 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2136 */
2137message FingerprintAuthenticated {
2138 // The associated user. Eg: 0 for owners, 10+ for others.
2139 // Defined in android/os/UserHandle.java
2140 optional int32 user = 1;
2141 // If this authentication is for a crypto fingerprint.
2142 // e.g. Secure purchases, unlock password storage.
2143 optional bool is_crypto = 2;
2144 // Whether or not this authentication was successful.
2145 optional bool is_authenticated = 3;
2146}
2147
2148/**
2149 * Logs when a fingerprint error occurs.
2150 *
2151 * Logged from:
2152 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2153 */
2154message FingerprintErrorOccurred {
2155 // The associated user. Eg: 0 for owners, 10+ for others.
2156 // Defined in android/os/UserHandle.java
2157 optional int32 user = 1;
2158 // If this error is for a crypto fingerprint.
2159 // e.g. Secure purchases, unlock password storage.
2160 optional bool is_crypto = 2;
2161
2162 enum Error {
2163 UNKNOWN = 0;
2164 LOCKOUT = 1;
2165 PERMANENT_LOCKOUT = 2;
2166 }
2167 // The type of error.
2168 optional Error error = 3;
2169}
Howard Ro688ae182018-09-25 00:09:36 -07002170
2171message Notification {
2172
2173 // Type of notification event.
2174 enum Type {
2175 TYPE_UNKNOWN = 0;
2176 // Notification became visible to the user.
2177 TYPE_OPEN = 1;
2178 // Notification became hidden.
2179 TYPE_CLOSE = 2;
2180 // Notification switched to detail mode.
2181 TYPE_DETAIL = 3;
2182 // Notification was clicked.
2183 TYPE_ACTION = 4;
2184 // Notification was dismissed.
2185 TYPE_DISMISS = 5;
2186 // Notification switched to summary mode. The enum value of 14 is to
2187 // match that of metrics_constants.
2188 TYPE_COLLAPSE = 14;
2189 }
2190 optional Type type = 1;
2191
2192 // Package name associated with the notification.
2193 optional string package_name = 2;
2194
2195 // Tag associated with notification.
2196 optional string tag = 3;
2197
2198 // Application-supplied ID associated with the notification.
2199 optional int32 id = 4;
2200
2201 // Index of notification in the notification panel.
2202 optional int32 shade_index = 5;
2203
2204 // The number of notifications in the notification panel.
2205 optional int32 shade_count = 6;
2206
2207 // Importance for the notification.
2208 optional int32 importance = 7;
2209
2210 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002211 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002212
2213 // Importance for the notification channel.
2214 optional int32 channel_importance = 9;
2215
Howard Ro183c2bd2018-10-18 13:52:10 -07002216 // Application-supplied ID associated with the notifications group.
2217 optional string group_id = 10;
2218
Howard Ro688ae182018-09-25 00:09:36 -07002219 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002220 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002221
Howard Ro183c2bd2018-10-18 13:52:10 -07002222 // Reason for dismissal of a notification. This field is only meaningful for
2223 // TYPE_DISMISS events.
2224 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002225
Howard Ro183c2bd2018-10-18 13:52:10 -07002226 // The first post time of notification, stable across updates.
2227 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002228
Howard Ro183c2bd2018-10-18 13:52:10 -07002229 // The most recent interruption time, or the creation time if no updates.
2230 // Differs from update_millis because updates are filtered based on whether
2231 // they actually interrupted the user.
2232 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002233
Howard Ro183c2bd2018-10-18 13:52:10 -07002234 // The most recent update time, or the creation time if no updates.
2235 optional int64 update_millis = 15;
2236
2237 // The most recent visibility event.
2238 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002239}
2240
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002241/*
Yangster-macb89807e2018-11-15 21:10:57 -08002242 * Logs when a flag flip state changes.
2243 * Logged in P/h.
2244 */
2245message PhenotypeFlagStateChanged {
2246 // Mendel configuration name.
2247 optional string mendel_config_name = 1;
2248 // State
2249 enum State {
2250 STATE_UNKNOWN = 0;
2251 COMMITTED = 1;
2252 }
2253 optional State state = 2;
2254}
2255
2256/*
2257 * Logs when a binary push state changes.
2258 * Logged in Play store
2259 */
2260message BinaryPushStateChanged {
2261 // Binary package name.
2262 optional string binary_name = 1;
2263 // Version code.
2264 optional int64 version = 2;
2265 // State
2266 enum State {
2267 STATE_UNKNOWN = 0;
2268 DOWNLOAD_START = 1;
2269 DOWNLOAD_DONE = 2;
2270 INSTALL_START = 3;
2271 INSTALL_DONE = 4;
2272 REBOOT_START = 5;
2273 REBOOT_DONE = 6;
2274 }
2275 optional State state = 3;
2276}
2277
2278/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002279 * Logs when a connection becomes available and lost.
2280 * Logged in StatsCompanionService.java
2281 */
2282message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002283 // Id of the network.
2284 optional int32 net_id = 1;
2285
2286 enum State {
2287 UNKNOWN = 0;
2288 CONNECTED = 1;
2289 DISCONNECTED = 2;
2290 }
2291 // Connected state of a network.
2292 optional State state = 2;
2293}
2294
2295/**
2296 * Logs when a service starts and stops.
2297 * Logged from:
2298 * services/core/java/com/android/server/am/ActiveServices.java
2299 */
2300message ServiceStateChanged {
2301
2302 optional int32 uid = 1 [(is_uid) = true];
2303
2304 optional string package_name = 2;
2305
2306 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002307
2308 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002309 START = 1;
2310 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002311 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07002312
2313 optional State state = 4;
2314}
2315
2316/**
2317 * Logs when a service is launched.
2318 * Logged from:
2319 * services/core/java/com/android/server/am/ActiveServices.java
2320 */
2321message ServiceLaunchReported {
2322
2323 optional int32 uid = 1 [(is_uid) = true];
2324
2325 optional string package_name = 2;
2326
2327 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002328}
Howard Ro688ae182018-09-25 00:09:36 -07002329
Chenjie Yubbcbc602018-02-05 16:51:52 -08002330//////////////////////////////////////////////////////////////////////
2331// Pulled atoms below this line //
2332//////////////////////////////////////////////////////////////////////
2333
2334/**
David Chenc8a43242017-10-17 16:23:28 -07002335 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2336 *
2337 * Pulled from:
2338 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2339 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002340message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002341 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002342
2343 optional int64 rx_bytes = 2;
2344
2345 optional int64 rx_packets = 3;
2346
2347 optional int64 tx_bytes = 4;
2348
2349 optional int64 tx_packets = 5;
2350}
2351
2352/**
2353 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2354 *
2355 * Pulled from:
2356 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2357 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002358message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002359 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002360
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002361 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2362 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002363
2364 optional int64 rx_bytes = 3;
2365
2366 optional int64 rx_packets = 4;
2367
2368 optional int64 tx_bytes = 5;
2369
2370 optional int64 tx_packets = 6;
2371}
2372
2373/**
2374 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2375 *
2376 * Pulled from:
2377 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2378 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002379message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002380 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002381
2382 optional int64 rx_bytes = 2;
2383
2384 optional int64 rx_packets = 3;
2385
2386 optional int64 tx_bytes = 4;
2387
2388 optional int64 tx_packets = 5;
2389}
2390
2391/**
2392 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2393 *
2394 * Pulled from:
2395 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2396 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002397message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002398 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002399
Yao Chenc40a19d2018-03-15 16:48:25 -07002400 // 1 denotes foreground and 0 denotes background. This is called Set in
2401 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002402 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002403
2404 optional int64 rx_bytes = 3;
2405
2406 optional int64 rx_packets = 4;
2407
2408 optional int64 tx_bytes = 5;
2409
2410 optional int64 tx_packets = 6;
2411}
2412
2413/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002414 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2415 *
2416 * Pulled from:
2417 * StatsCompanionService
2418 */
2419message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002420 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002421
2422 optional int64 rx_bytes = 2;
2423
2424 optional int64 tx_bytes = 3;
2425}
2426
2427/**
David Chenc8a43242017-10-17 16:23:28 -07002428 * Pulls the kernel wakelock durations. This atom is adapted from
2429 * android/internal/os/KernelWakelockStats.java
2430 *
2431 * Pulled from:
2432 * StatsCompanionService using KernelWakelockReader.
2433 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002434message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002435 optional string name = 1;
2436
2437 optional int32 count = 2;
2438
2439 optional int32 version = 3;
2440
Yangster-maca8a30442018-10-13 23:46:34 -07002441 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002442}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002443
Chenjie Yu05013b32017-11-21 10:21:41 -08002444/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002445 * Pulls low power state information. If power.stats HAL is not available, this
2446 * includes platform and subsystem sleep state information,
2447 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
2448 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002449 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002450 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002451 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
2452 * as defined in:
2453 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002454 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002455message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002456 // Subsystem name
2457 optional string subsystem_name = 1;
2458 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2459 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002460 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
2461 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002462 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002463 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002464 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002465 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002466 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002467}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002468
Chenjie Yu05013b32017-11-21 10:21:41 -08002469/**
Bookatz92da2832018-11-01 18:10:03 -07002470 * Pulls on-device power measurement information.
2471 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
2472 * Pulled from:
2473 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
2474 */
2475message OnDevicePowerMeasurement {
2476 // Name of the subsystem (to which the rail belongs).
2477 optional string subsystem_name = 1;
2478
2479 // Rail name. The rail lies within the subsystem.
2480 optional string rail_name = 2;
2481
2482 // Time (in ms since boot) at which the rail energy value was measured.
2483 // This may differ slightly from the time that statsd logs this information.
2484 optional uint64 measurement_timestamp_millis = 3;
2485
2486 // Accumulated energy used via the rail since device boot in uWs.
2487 optional uint64 energy_microwatt_secs = 4;
2488}
2489
2490/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002491 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002492 * Pulls the time the cpu spend on the frequency index. Frequency index
2493 * starts from highest to lowest. The value should be monotonically
2494 * increasing since boot. However, if there is a cpu
2495 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002496 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002497message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002498 optional uint32 cluster = 1;
2499 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002500 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002501}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002502
Chenjie Yu05013b32017-11-21 10:21:41 -08002503/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002504 * Pulls Cpu Time Per Uid.
2505 * Note that isolated process uid time should be attributed to host uids.
2506 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002507message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002508 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002509 optional uint64 user_time_micros = 2;
2510 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002511}
2512
2513/**
2514 * Pulls Cpu Time Per Uid per frequency.
2515 * Note that isolated process uid time should be attributed to host uids.
2516 * For each uid, we order the time by descending frequencies.
2517 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002518message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002519 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002520 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002521 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002522}
Hugo Benichi884970e2017-11-14 22:42:46 +09002523
Chenjie Yu05013b32017-11-21 10:21:41 -08002524/**
2525 * Pulls Wifi Controller Activity Energy Info
2526 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002527message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002528 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002529 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002530 // stack reported state
2531 // TODO: replace this with proto enum
2532 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002533 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002534 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002535 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002536 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002537 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002538 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002539 // product of current(mA), voltage(V) and time(ms)
2540 optional uint64 controller_energy_used = 6;
2541}
2542
2543/**
2544 * Pulls Modem Activity Energy Info
2545 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002546message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002547 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002548 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002549 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002550 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002551 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002552 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002553 /**
2554 * Tx power index
2555 * index 0 = tx_power < 0dBm
2556 * index 1 = 0dBm < tx_power < 5dBm
2557 * index 2 = 5dBm < tx_power < 15dBm
2558 * index 3 = 15dBm < tx_power < 20dBm
2559 * index 4 = tx_power > 20dBm
2560 */
2561 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002562 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002563 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002564 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002565 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002566 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002567 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002568 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002569 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002570 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002571 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002572 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002573 // product of current(mA), voltage(V) and time(ms)
2574 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002575}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002576
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002577/**
2578 * Pulls Bluetooth Activity Energy Info
2579 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2580 */
2581message BluetoothActivityInfo {
2582 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002583 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002584 // bluetooth stack state
2585 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002586 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002587 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002588 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002589 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002590 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002591 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002592 // product of current(mA), voltage(V) and time(ms)
2593 optional uint64 energy_used = 6;
2594}
2595
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002596/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002597 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002598 *
2599 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002600 */
2601message ProcessMemoryState {
2602 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002603 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002604
2605 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002606 // Usually package name, "system" for system server.
2607 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002608 optional string process_name = 2;
2609
Rafal Slawikda51b932018-12-13 16:31:33 +00002610 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07002611 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002612
2613 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002614 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002615
2616 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002617 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002618
Rajeev Kumar90235992018-01-29 11:06:48 -08002619 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002620 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
2621 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08002622 optional int64 rss_in_bytes = 6;
2623
2624 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00002625 // Value is read from memory.stat, field total_cache if per-app memory
2626 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002627 optional int64 cache_in_bytes = 7;
2628
2629 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00002630 // Value is read from memory.stat, field total_swap if per-app memory
2631 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002632 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002633
Rafal Slawikd03ae422018-11-20 11:27:45 +00002634 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002635 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00002636
2637 // Elapsed real time when the process started.
2638 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
2639 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002640}
2641
2642/*
Rafal Slawik08621582018-10-15 14:53:07 +01002643 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00002644 *
2645 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01002646 */
2647message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01002648 // The uid if available. -1 means not available.
2649 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01002650
Rafal Slawikbf67d072018-10-23 11:07:54 +01002651 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002652 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002653 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01002654
Rafal Slawikbf67d072018-10-23 11:07:54 +01002655 // # of page-faults
2656 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002657
Rafal Slawikbf67d072018-10-23 11:07:54 +01002658 // # of major page-faults
2659 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002660
Rafal Slawikbf67d072018-10-23 11:07:54 +01002661 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002662 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002663 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01002664
Rafal Slawikd03ae422018-11-20 11:27:45 +00002665 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002666 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01002667
2668 // Elapsed real time when the process started.
2669 // Value is read from /proc/PID/stat, field 22.
2670 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01002671}
2672
2673/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00002674 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002675 *
2676 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
2677 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00002678 *
2679 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002680 */
2681message ProcessMemoryHighWaterMark {
2682 // The uid if available. -1 means not available.
2683 optional int32 uid = 1 [(is_uid) = true];
2684
Rafal Slawikda51b932018-12-13 16:31:33 +00002685 // The process name.
2686 // Usually package name or process cmdline.
2687 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002688 optional string process_name = 2;
2689
2690 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
2691 // /proc/PID/status.
2692 optional int64 rss_high_water_mark_in_bytes = 3;
2693}
2694
2695/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002696 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002697 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002698message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002699 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002700}
2701
2702/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002703 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002704 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002705message SystemUptime {
2706 // Milliseconds since the system was booted.
2707 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2708 // for external input).
2709 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002710 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002711}
2712
2713/*
2714 * Reads from /proc/uid_concurrent_active_time which has the format:
2715 * active: X (X is # cores)
2716 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2717 * [uid1]: [time-0] [time-1] [time-2] ... ...
2718 * ...
2719 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2720 * The file contains a monotonically increasing count of time for a single boot.
2721 */
2722message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002723 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002724 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002725}
2726
2727/**
2728 * Reads from /proc/uid_concurrent_policy_time which has the format:
2729 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2730 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2731 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2732 * ...
2733 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2734 * The file contains a monotonically increasing count of time for a single boot.
2735 */
2736message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002737 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002738 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002739 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002740}
2741
2742/*
2743 * Pulls free disk space, for data, system partition and temporary directory.
2744 */
2745message DiskSpace {
2746 // available bytes in data partition
2747 optional uint64 data_available_bytes = 1;
2748 // available bytes in system partition
2749 optional uint64 system_available_bytes = 2;
2750 // available bytes in download cache or temp directories
2751 optional uint64 temp_available_bytes = 3;
2752}
Tej Singhbf972d92018-01-10 20:51:13 -08002753
2754/**
2755 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002756 * Pulled from:
2757 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002758 */
2759message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002760 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08002761}
2762
2763/**
2764 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002765 * Pulled from:
2766 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002767 */
2768message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002769 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08002770}
2771
2772/**
Bookatz17f0d8a2018-09-13 12:56:32 -07002773 * Pulls battery voltage.
2774 * Pulled from:
2775 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2776 */
2777message BatteryVoltage {
2778 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07002779 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07002780}
2781
2782/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08002783 * Pulls battery level (percent full, from 0 to 100).
2784 *
2785 * Pulled from:
2786 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2787 */
2788message BatteryLevel {
2789 // Battery level. Should be in [0, 100].
2790 optional int32 battery_level = 1;
2791}
2792
2793/**
Tej Singhd89137e2018-03-26 14:51:40 -07002794 * Pulls the temperature of various parts of the device.
2795 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002796 *
2797 * Pulled from:
2798 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2799 */
2800message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08002801 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08002802 optional android.os.TemperatureTypeEnum sensor_location = 1;
2803
2804 // The name of the temperature source. Eg. CPU0
2805 optional string sensor_name = 2;
2806
Tej Singhd89137e2018-03-26 14:51:40 -07002807 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08002808 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07002809 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08002810}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002811
2812/**
2813 * Pulls the statistics of calls to Binder.
2814 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01002815 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
2816 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002817 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002818 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002819 */
2820message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002821 // UID of the process responsible for the binder transaction. It will be set if the process
2822 // executing the binder transaction attribute the transaction to another uid using
2823 // Binder.setThreadWorkSource().
2824 //
2825 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002826 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002827 // UID of the process executing the binder transaction.
2828 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002829 // Fully qualified class name of the API call.
2830 //
2831 // This is a system server class name.
2832 //
2833 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
2834 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
2835 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
2836 // commonly used APIs.
2837 optional string service_class_name = 2;
2838 // Method name of the API call. It can also be a transaction code if we cannot
2839 // resolve it to a name. See Binder#getTransactionName.
2840 //
2841 // This is a system server method name.
2842 optional string service_method_name = 3;
2843 // Total number of API calls.
2844 optional int64 call_count = 4;
2845 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2846 optional bool screen_interactive = 13;
2847 // Total number of API calls we have data recorded for. If we collected data for all the calls,
2848 // call_count will be equal to recorded_call_count.
2849 //
2850 // If recorded_call_count is different than call_count, it means data collection has been
2851 // sampled. All the fields below will be sampled in this case.
2852 optional int64 recorded_call_count = 12;
2853 // Number of exceptions thrown by the API.
2854 optional int64 recorded_exception_count = 5;
2855 // Total latency of all API calls.
2856 // Average can be computed using total_latency_micros / recorded_call_count.
2857 optional int64 recorded_total_latency_micros = 6;
2858 // Maximum latency of one API call.
2859 optional int64 recorded_max_latency_micros = 7;
2860 // Total CPU usage of all API calls.
2861 // Average can be computed using total_cpu_micros / recorded_call_count.
2862 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
2863 optional int64 recorded_total_cpu_micros = 8;
2864 // Maximum CPU usage of one API call.
2865 optional int64 recorded_max_cpu_micros = 9;
2866 // Maximum parcel reply size of one API call.
2867 optional int64 recorded_max_reply_size_bytes = 10;
2868 // Maximum parcel request size of one API call.
2869 optional int64 recorded_max_request_size_bytes = 11;
2870}
2871
2872/**
2873 * Pulls the statistics of exceptions during calls to Binder.
2874 *
2875 * Binder stats are cumulative from boot unless somebody reset the data using
2876 * > adb shell dumpsys binder_calls_stats --reset
2877 */
2878message BinderCallsExceptions {
2879 // Exception class name, e.g. java.lang.IllegalArgumentException.
2880 //
2881 // This is an exception class name thrown by the system server.
2882 optional string exception_class_name = 1;
2883 // Total number of exceptions.
2884 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002885}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002886
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002887/**
2888 * Pulls the statistics of message dispatching on HandlerThreads.
2889 *
2890 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
2891 * config on the device.
2892 *
2893 * Next tag: 11
2894 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002895message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01002896 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002897 optional int32 uid = 1 [(is_uid) = true];
2898
2899 // Fully qualified class name of the handler target class.
2900 //
2901 // This field does not contain PII. This is a system server class name.
2902 optional string handler_class_name = 2;
2903
2904 // The name of the thread that runs the Looper.
2905 //
2906 // This field does not contain PII. This is a system server thread name.
2907 optional string looper_thread_name = 3;
2908
2909 // The name of the dispatched message.
2910 //
2911 // This field does not contain PII. This is a system server constant or class
2912 // name.
2913 optional string message_name = 4;
2914
2915 // Total number of successfully dispatched messages.
2916 optional int64 message_count = 5;
2917
2918 // Total number of messages that failed dispatching.
2919 optional int64 exception_count = 6;
2920
2921 // Total number of processed messages we have data recorded for. If we
2922 // collected data for all the messages, message_count will be equal to
2923 // recorded_message_count.
2924 //
2925 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01002926 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002927 optional int64 recorded_message_count = 7;
2928
2929 // Total latency of all processed messages.
2930 // Average can be computed using recorded_total_latency_micros /
2931 // recorded_message_count.
2932 optional int64 recorded_total_latency_micros = 8;
2933
2934 // Total CPU usage of all processed message.
2935 // Average can be computed using recorded_total_cpu_micros /
2936 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002937 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002938 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002939
2940 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2941 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01002942
2943 // Max recorded CPU usage of all processed messages.
2944 optional int64 recorded_max_cpu_micros = 11;
2945
2946 // Max recorded latency of all processed messages.
2947 optional int64 recorded_max_latency_micros = 12;
2948
2949 // Total number of messages we tracked the dispatching delay for. If we
2950 // collected data for all the messages, message_count will be equal to
2951 // recorded_delay_message_count.
2952 //
2953 // If recorded_delay_message_count is different than message_count, it means data
2954 // collection has been sampled or/and not all messages specified the target dispatch time.
2955 // The fields below will be sampled in this case.
2956 optional int64 recorded_delay_message_count = 13;
2957
2958 // Total dispatching delay of all processed messages.
2959 // Calculated as a difference between the target dispatching time (Message.when)
2960 // and the actual dispatching time.
2961 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
2962 optional int64 recorded_total_delay_millis = 14;
2963
2964 // Max dispatching delay of all processed messages.
2965 // Calculated as a difference between the target dispatching time (Message.when)
2966 // and the actual dispatching time.
2967 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002968}
Tej Singh86dc9db2018-09-06 00:39:57 +00002969
2970/**
2971 * Pulls disk information, such as write speed and latency.
2972 */
2973message DiskStats {
2974 // Time taken to open, write 512B to, and close a file.
2975 // -1 if error performing the check.
2976 optional int64 data_write_latency_millis = 1;
2977
2978 optional bool file_based_encryption = 2;
2979
2980 // Recent disk write speed in kB/s.
2981 // -1 if error querying storageed.
2982 // 0 if data is unavailable.
2983 optional int32 recent_disk_write_speed = 3;
2984}
2985
2986
2987/**
2988 * Free and total bytes of the Data, Cache, and System partition.
2989 */
2990message DirectoryUsage {
2991 enum Directory {
2992 UNKNOWN = 0;
2993 DATA = 1;
2994 CACHE = 2;
2995 SYSTEM = 3;
2996 }
2997 optional Directory directory = 1;
2998 optional int64 free_bytes = 2;
2999 optional int64 total_bytes = 3;
3000}
3001
3002
3003/**
3004 * Size of an application: apk size, data size, and cache size.
3005 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3006 * Information is only reported for apps with the primary user (user 0).
3007 * Sizes are aggregated by package name.
3008 */
3009message AppSize {
3010 // Including uids will involve modifying diskstats logic.
3011 optional string package_name = 1;
3012 // App size in bytes. -1 if unavailable.
3013 optional int64 app_size_bytes = 2;
3014 // App data size in bytes. -1 if unavailable.
3015 optional int64 app_data_size_bytes = 3;
3016 // App cache size in bytes. -1 if unavailable.
3017 optional int64 app_cache_size_bytes = 4;
3018 // Time that the cache file was produced.
3019 // Uses System.currentTimeMillis(), which is wall clock time.
3020 optional int64 cache_time_millis = 5;
3021}
3022
3023
3024/**
3025 * Size of a particular category. Eg: photos, videos.
3026 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3027 */
3028message CategorySize {
3029 enum Category {
3030 UNKNOWN = 0;
3031 APP_SIZE = 1;
3032 APP_DATA_SIZE = 2;
3033 APP_CACHE_SIZE = 3;
3034 PHOTOS = 4;
3035 VIDEOS = 5;
3036 AUDIO = 6;
3037 DOWNLOADS = 7;
3038 SYSTEM = 8;
3039 OTHER = 9;
3040 }
3041 optional Category category = 1;
3042 // Category size in bytes.
3043 optional int64 size_bytes = 2;
3044 // Time that the cache file was produced.
3045 // Uses System.currentTimeMillis(), which is wall clock time.
3046 optional int64 cache_time_millis = 3;
3047}
Tej Singhd6d6d772018-09-05 17:41:25 -07003048
3049/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003050 * Pulls per uid I/O stats. The stats are cumulative since boot.
3051 *
3052 * Read/write bytes are I/O events from a storage device
3053 * Read/write chars are data requested by read/write syscalls, and can be
3054 * satisfied by caching.
3055 *
3056 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3057 */
3058message DiskIo {
3059 optional int32 uid = 1 [(is_uid) = true];
3060 optional int64 fg_chars_read = 2;
3061 optional int64 fg_chars_write = 3;
3062 optional int64 fg_bytes_read = 4;
3063 optional int64 fg_bytes_write = 5;
3064 optional int64 bg_chars_read = 6;
3065 optional int64 bg_chars_write = 7;
3066 optional int64 bg_bytes_read = 8;
3067 optional int64 bg_bytes_write = 9;
3068 optional int64 fg_fsync = 10;
3069 optional int64 bg_fsync= 11;
3070}
3071
3072
3073/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003074 * Pulls the number of fingerprints for each user.
3075 *
3076 * Pulled from StatsCompanionService, which queries FingerprintManager.
3077 */
3078message NumFingerprints {
3079 // The associated user. Eg: 0 for owners, 10+ for others.
3080 // Defined in android/os/UserHandle.java
3081 optional int32 user = 1;
3082 // Number of fingerprints registered to that user.
3083 optional int32 num_fingerprints = 2;
3084}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003085
Yangsteraf9aee72018-10-12 09:26:16 -07003086message AggStats {
3087 optional int64 min = 1;
3088
3089 optional int64 average = 2;
3090
3091 optional int64 max = 3;
3092}
3093
3094message ProcessStatsStateProto {
3095 optional android.service.procstats.ScreenState screen_state = 1;
3096
3097 optional android.service.procstats.MemoryState memory_state = 2;
3098
3099 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3100 // and not frameworks/base/core/java/android/app/ActivityManager.java
3101 optional android.service.procstats.ProcessState process_state = 3;
3102
3103 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003104 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003105
3106 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003107 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003108
3109 // # of samples taken
3110 optional int32 sample_size = 5;
3111
3112 // PSS is memory reserved for this process
3113 optional AggStats pss = 6;
3114
3115 // USS is memory shared between processes, divided evenly for accounting
3116 optional AggStats uss = 7;
3117
3118 // RSS is memory resident for this process
3119 optional AggStats rss = 8;
3120}
3121
3122// Next Tag: 7
3123message ProcessStatsProto {
3124 // Name of process.
3125 optional string process = 1;
3126
3127 // Uid of the process.
3128 optional int32 uid = 2;
3129
3130 // Information about how often kills occurred
3131 message Kill {
3132 // Count of excessive CPU kills
3133 optional int32 cpu = 1;
3134
3135 // Count of kills when cached
3136 optional int32 cached = 2;
3137
3138 // PSS stats during cached kill
3139 optional AggStats cached_pss = 3;
3140 }
3141 optional Kill kill = 3;
3142
3143 // Time and memory spent in various states.
3144 repeated ProcessStatsStateProto states = 5;
3145
3146 // Total time process has been running... screen_state, memory_state, and process_state
3147 // will not be set.
3148 optional ProcessStatsStateProto total_running_state = 6;
3149}
3150
3151message PackageServiceOperationStatsProto {
3152 // Operate enum: Started, Foreground, Bound, Executing
3153 optional android.service.procstats.ServiceOperationState operation = 1;
3154
3155 // Number of times the service was in this operation.
3156 optional int32 count = 2;
3157
3158 // Information about a state the service can be in.
3159 message StateStats {
3160 // Screen state enum.
3161 optional android.service.procstats.ScreenState screen_state = 1;
3162 // Memory state enum.
3163 optional android.service.procstats.MemoryState memory_state = 2;
3164
3165 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07003166 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003167 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003168 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003169 }
3170 repeated StateStats state_stats = 3;
3171}
3172
3173message PackageServiceStatsProto {
3174 // Name of service component.
3175 optional string service_name = 1;
3176
3177 // The operation stats.
3178 // The package_name, package_uid, package_version, service_name will not be set to save space.
3179 repeated PackageServiceOperationStatsProto operation_stats = 2;
3180}
3181
3182message PackageAssociationSourceProcessStatsProto {
3183 // Uid of the process.
3184 optional int32 process_uid = 1;
3185 // Process name.
3186 optional string process_name = 2;
3187
3188 // Total count of the times this association appeared.
3189 optional int32 total_count = 3;
3190
3191 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07003192 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003193
3194 // Total count of the times this association became actively impacting its target process.
3195 optional int32 active_count = 5;
3196
3197 // Information on one source in this association.
3198 message StateStats {
3199 // Process state enum.
3200 optional android.service.procstats.ProcessState process_state = 1;
3201 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003202 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003203 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003204 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003205 }
3206 repeated StateStats active_state_stats = 6;
3207}
3208
3209message PackageAssociationProcessStatsProto {
3210 // Name of the target component.
3211 optional string component_name = 1;
3212 // Information on one source in this association.
3213 repeated PackageAssociationSourceProcessStatsProto sources = 2;
3214}
3215
3216
3217message ProcessStatsPackageProto {
3218 // Name of package.
3219 optional string package = 1;
3220
3221 // Uid of the package.
3222 optional int32 uid = 2;
3223
3224 // Version of the package.
3225 optional int64 version = 3;
3226
3227 // Stats for each process running with the package loaded in to it.
3228 repeated ProcessStatsProto process_stats = 4;
3229
3230 // Stats for each of the package's services.
3231 repeated PackageServiceStatsProto service_stats = 5;
3232
3233 // Stats for each association with the package.
3234 repeated PackageAssociationProcessStatsProto association_stats = 6;
3235}
3236
3237message ProcessStatsSectionProto {
3238 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003239 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07003240
3241 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003242 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003243
3244 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003245 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003246
3247 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003248 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003249
3250 // System runtime library. e.g. "libdvm.so", "libart.so".
3251 optional string runtime = 5;
3252
3253 // whether kernel reports swapped pss.
3254 optional bool has_swapped_pss = 6;
3255
3256 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
3257 enum Status {
3258 STATUS_UNKNOWN = 0;
3259 STATUS_COMPLETE = 1;
3260 STATUS_PARTIAL = 2;
3261 STATUS_SHUTDOWN = 3;
3262 STATUS_SYSPROPS = 4;
3263 }
3264 repeated Status status = 7;
3265
3266 // Stats for each process.
3267 repeated ProcessStatsProto process_stats = 8;
3268
3269 // Stats for each package.
3270 repeated ProcessStatsPackageProto package_stats = 9;
3271}
3272
Chenjie Yu12e5e672018-09-14 15:54:59 -07003273/**
3274 * Pulled from ProcessStatsService.java
3275 */
3276message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07003277 optional ProcessStatsSectionProto proc_stats_section = 1;
3278}
3279
Chenjie Yuf910b7802019-01-11 16:08:20 -08003280/**
3281 * Pulled from ProcessStatsService.java
3282 */
3283message ProcStatsPkgProc {
3284 optional ProcessStatsSectionProto proc_stats_section = 1;
3285}
3286
Yangsteraf9aee72018-10-12 09:26:16 -07003287message PowerProfileProto {
3288 optional double cpu_suspend = 1;
3289
3290 optional double cpu_idle = 2;
3291
3292 optional double cpu_active = 3;
3293
3294 message CpuCluster {
3295 optional int32 id = 1;
3296 optional double cluster_power = 2;
3297 optional int32 cores = 3;
3298 repeated int64 speed = 4;
3299 repeated double core_power = 5;
3300 }
3301
3302 repeated CpuCluster cpu_cluster = 40;
3303
3304 optional double wifi_scan = 4;
3305
3306 optional double wifi_on = 5;
3307
3308 optional double wifi_active = 6;
3309
3310 optional double wifi_controller_idle = 7;
3311
3312 optional double wifi_controller_rx = 8;
3313
3314 optional double wifi_controller_tx = 9;
3315
3316 repeated double wifi_controller_tx_levels = 10;
3317
3318 optional double wifi_controller_operating_voltage = 11;
3319
3320 optional double bluetooth_controller_idle = 12;
3321
3322 optional double bluetooth_controller_rx = 13;
3323
3324 optional double bluetooth_controller_tx = 14;
3325
3326 optional double bluetooth_controller_operating_voltage = 15;
3327
3328 optional double modem_controller_sleep = 16;
3329
3330 optional double modem_controller_idle = 17;
3331
3332 optional double modem_controller_rx = 18;
3333
3334 repeated double modem_controller_tx = 19;
3335
3336 optional double modem_controller_operating_voltage = 20;
3337
3338 optional double gps_on = 21;
3339
3340 repeated double gps_signal_quality_based = 22;
3341
3342 optional double gps_operating_voltage = 23;
3343
3344 optional double bluetooth_on = 24;
3345
3346 optional double bluetooth_active = 25;
3347
3348 optional double bluetooth_at_cmd = 26;
3349
3350 optional double ambient_display = 27;
3351
3352 optional double screen_on = 28;
3353
3354 optional double radio_on = 29;
3355
3356 optional double radio_scanning = 30;
3357
3358 optional double radio_active = 31;
3359
3360 optional double screen_full = 32;
3361
3362 optional double audio = 33;
3363
3364 optional double video = 34;
3365
3366 optional double flashlight = 35;
3367
3368 optional double memory = 36;
3369
3370 optional double camera = 37;
3371
3372 optional double wifi_batched_scan = 38;
3373
3374 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003375}
Chenjie Yuab530202018-09-26 12:39:20 -07003376
3377/**
3378 * power_profile.xml and other constants for power model calculations.
3379 * Pulled from PowerProfile.java
3380 */
3381message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003382 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003383}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003384
3385/**
arangelovd5db50e2018-10-12 20:24:39 +01003386 * Logs when a user restriction was added or removed.
3387 *
3388 * Logged from:
3389 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3390 */
3391message UserRestrictionChanged {
3392 // The raw string of the user restriction as defined in UserManager.
3393 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3394 optional string restriction = 1;
3395 // Whether the restriction is enabled or disabled.
3396 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07003397}
Yangster-mac308ea0c2018-10-22 13:10:25 -07003398
3399/**
3400 * Pulls process user time and system time. Puller takes a snapshot of all pids
3401 * in the system and returns cpu stats for those that are working at the time.
3402 * Dead pids will be dropped. Kernel processes are excluded.
3403 * Min cool-down is 5 sec.
3404 */
3405message ProcessCpuTime {
3406 optional int32 uid = 1 [(is_uid) = true];
3407
3408 optional string process_name = 2;
3409 // Process cpu time in user space, cumulative from boot/process start
3410 optional int64 user_time_millis = 3;
3411 // Process cpu time in system space, cumulative from boot/process start
3412 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01003413}
Misha Wagner5a51e002018-10-03 15:04:09 +01003414
3415/**
3416 * Pulls the CPU usage for each thread.
3417 *
3418 * Read from /proc/$PID/task/$TID/time_in_state files.
3419 *
3420 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
3421 * time_in_state files not being present on some phones, have not been addressed. These should be
3422 * considered before a public release.
3423 */
3424message CpuTimePerThreadFreq {
3425 // UID that owns the process.
3426 optional int32 uid = 1 [(is_uid) = true];
3427 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003428 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01003429 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003430 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01003431 // Name of the process taken from `/proc/$PID/cmdline`.
3432 optional string process_name = 4;
3433 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
3434 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00003435
3436 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
3437 // are given in KHz, and time is given in milliseconds since the thread started. All eight
3438 // frequencies are given here as the alternative is sending eight separate atoms. This method
3439 // significantly reduces the amount of data created
3440 optional int32 frequency1_khz = 6;
3441 optional int32 time1_millis = 7;
3442 optional int32 frequency2_khz = 8;
3443 optional int32 time2_millis = 9;
3444 optional int32 frequency3_khz = 10;
3445 optional int32 time3_millis = 11;
3446 optional int32 frequency4_khz = 12;
3447 optional int32 time4_millis = 13;
3448 optional int32 frequency5_khz = 14;
3449 optional int32 time5_millis = 15;
3450 optional int32 frequency6_khz = 16;
3451 optional int32 time6_millis = 17;
3452 optional int32 frequency7_khz = 18;
3453 optional int32 time7_millis = 19;
3454 optional int32 frequency8_khz = 20;
3455 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01003456}
Bookatz75ee6042018-11-09 12:27:37 -08003457
3458/**
Bookatz366a4432018-11-20 09:42:33 -08003459 * Pulls information about the device's build.
3460 */
3461message BuildInformation {
3462 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
3463 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
3464 optional string fingerprint = 1;
3465
3466 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
3467 optional string brand = 2;
3468
3469 // Build.PRODUCT. The name of the overall product.
3470 optional string product = 3;
3471
3472 // Build.DEVICE. The name of the industrial design.
3473 optional string device = 4;
3474
3475 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
3476 optional string version_release = 5;
3477
3478 // Build.ID. E.g. a label like "M4-rc20".
3479 optional string id = 6;
3480
3481 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
3482 // represent this build.
3483 optional string version_incremental = 7;
3484
3485 // Build.TYPE. The type of build, like "user" or "eng".
3486 optional string type = 8;
3487
3488 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
3489 optional string tags = 9;
3490}
3491
3492/**
Bookatz75ee6042018-11-09 12:27:37 -08003493 * Pulls on-device BatteryStats power use calculations for the overall device.
3494 */
3495message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08003496 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3497 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3498 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
3499 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08003500}
3501
3502/**
3503 * Pulls on-device BatteryStats power use calculations broken down by uid.
3504 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
3505 * that is attributed to non-uid items. They must all be included to get the total power use.
3506 */
3507message DeviceCalculatedPowerBlameUid {
3508 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
3509 optional int32 uid = 1 [(is_uid) = true];
3510
Bookatz3dbc13a2018-12-21 12:16:51 -08003511 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3512 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3513 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08003514}
3515
3516/**
3517 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
3518 * drain type.
3519 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
3520 * is attributed uids. They must all be included to get the total power use.
3521 */
3522message DeviceCalculatedPowerBlameOther {
3523 // The type of item whose power use is being reported.
3524 enum DrainType {
3525 AMBIENT_DISPLAY = 0;
3526 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
3527 BLUETOOTH = 2;
3528 CAMERA = 3;
3529 // Cell-standby
3530 CELL = 4;
3531 FLASHLIGHT = 5;
3532 IDLE = 6;
3533 MEMORY = 7;
3534 // Amount that total computed drain exceeded the drain estimated using the
3535 // battery level changes and capacity.
3536 OVERCOUNTED = 8;
3537 PHONE = 9;
3538 SCREEN = 10;
3539 // Amount that total computed drain was below the drain estimated using the
3540 // battery level changes and capacity.
3541 UNACCOUNTED = 11;
3542 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
3543 WIFI = 13;
3544 }
3545 optional DrainType drain_type = 1;
3546
Bookatz3dbc13a2018-12-21 12:16:51 -08003547 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3548 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3549 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00003550}
arangelov4e994062018-11-13 16:12:38 +00003551
3552/**
3553 * Logs device policy features.
3554 *
3555 * Logged from:
3556 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3557 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
3558 */
3559message DevicePolicyEvent {
3560 // The event id - unique for each event.
3561 optional android.stats.devicepolicy.EventId event_id = 1;
3562 // The admin package name.
3563 optional string admin_package_name = 2;
3564 // A generic integer parameter.
3565 optional int32 integer_value = 3;
3566 // A generic boolean parameter.
3567 optional bool boolean_value = 4;
3568 // A parameter specifying a time period in milliseconds.
3569 optional uint64 time_period_millis = 5;
3570 // A parameter specifying a list of package names, bundle extras or string parameters.
3571 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
3572}
shawnlinea5b66b2018-11-13 15:05:29 +08003573
3574/**
3575 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
3576 *
3577 * Logged from:
3578 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3579 */
3580message DocsUILaunchReported {
3581 optional android.stats.docsui.LaunchAction launch_action = 1;
3582 optional bool has_initial_uri = 2;
3583 optional android.stats.docsui.MimeType mime_type = 3;
3584 optional android.stats.docsui.Root initial_root = 4;
3585}
3586
3587/**
3588 * Logs root/app visited event in file managers/picker. Call this when the user
3589 * taps on root/app in hamburger menu.
3590 *
3591 * Logged from:
3592 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3593 */
3594message DocsUIRootVisitedReported {
3595 optional android.stats.docsui.ContextScope scope = 1;
3596 optional android.stats.docsui.Root root = 2;
3597}
3598
3599/**
3600 * Logs file operation stats. Call this when a file operation has completed.
3601 *
3602 * Logged from:
3603 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3604 */
3605message DocsUIFileOperationReported {
3606 optional android.stats.docsui.Provider provider = 1;
3607 optional android.stats.docsui.FileOperation file_op = 2;
3608}
3609
3610/**
3611 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
3612 * mode.
3613 *
3614 * Logged from:
3615 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3616 */
3617message DocsUIFileOperationCopyMoveModeReported {
3618 optional android.stats.docsui.FileOperation file_op = 1;
3619 optional android.stats.docsui.CopyMoveOpMode mode = 2;
3620}
3621
3622
3623/**
3624 * Logs file sub operation stats. Call this when a file operation has failed.
3625 *
3626 * Logged from:
3627 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3628 */
3629message DocsUIFileOperationFailureReported {
3630 optional android.stats.docsui.Authority authority = 1;
3631 optional android.stats.docsui.SubFileOperation sub_op = 2;
3632}
3633
3634/**
3635* Logs the cancellation of a file operation. Call this when a job is canceled
3636*
3637* Logged from:
3638* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3639*/
3640message DocsUIFileOperationCanceledReported {
3641 optional android.stats.docsui.FileOperation file_op = 1;
3642}
3643
3644/**
3645 * Logs startup time in milliseconds.
3646 *
3647 * Logged from:
3648 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3649 */
3650message DocsUIStartupMsReported {
3651 optional int32 startup_millis = 1;
3652}
3653
3654/**
3655 * Logs the action that was started by user.
3656 *
3657 * Logged from:
3658 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3659 */
3660message DocsUIUserActionReported {
3661 optional android.stats.docsui.UserAction action = 1;
3662}
3663
3664/**
3665 * Logs the invalid type when invalid scoped access is requested.
3666 *
3667 * Logged from:
3668 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
3669 */
3670message DocsUIInvalidScopedAccessRequestReported {
3671 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00003672}
Ben Murdochbab399f2018-12-06 11:01:38 +00003673
3674/**
shawnlina75e82d2019-01-07 10:31:12 +08003675 * Logs the package name that launches docsui picker mode.
3676 *
3677 * Logged from:
3678 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3679 */
3680message DocsUIPickerLaunchedFromReported {
3681 optional string package_name = 1;
3682}
3683
3684/**
3685 * Logs the search type.
3686 *
3687 * Logged from:
3688 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3689 */
3690message DocsUISearchTypeReported {
3691 optional android.stats.docsui.SearchType search_type = 1;
3692}
3693
3694/**
3695 * Logs the search mode.
3696 *
3697 * Logged from:
3698 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3699 */
3700message DocsUISearchModeReported {
3701 optional android.stats.docsui.SearchMode search_mode = 1;
3702}
3703
3704/**
3705 * Logs the pick result information.
3706 *
3707 * Logged from:
3708 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3709 */
3710message DocsUIPickResultReported {
3711 optional int32 total_action_count = 1;
3712 optional int64 duration_millis = 2;
3713 optional int32 file_count= 3;
3714 optional bool is_searching = 4;
3715 optional android.stats.docsui.Root picked_from = 5;
3716 optional android.stats.docsui.MimeType mime_type = 6;
3717 optional int32 repeatedly_pick_times = 7;
3718}
3719
3720/**
Ben Murdochbab399f2018-12-06 11:01:38 +00003721 * Logs when an app's memory is compacted.
3722 *
3723 * Logged from:
3724 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3725 */
3726message AppCompacted {
3727 // The pid of the process being compacted.
3728 optional int32 pid = 1;
3729
3730 // The name of the process being compacted.
3731 optional string process_name = 2;
3732
3733 // The type of compaction.
3734 enum Action {
3735 UNKNOWN = 0;
3736 SOME = 1;
3737 FULL = 2;
3738 }
Ben Murdoch01720b82018-12-19 18:03:44 +00003739 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00003740
3741 // Total RSS in kilobytes consumed by the process prior to compaction.
3742 optional int64 before_rss_total_kilobytes = 4;
3743
3744 // File RSS in kilobytes consumed by the process prior to compaction.
3745 optional int64 before_rss_file_kilobytes = 5;
3746
3747 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
3748 optional int64 before_rss_anon_kilobytes = 6;
3749
3750 // Swap in kilobytes consumed by the process prior to compaction.
3751 optional int64 before_swap_kilobytes = 7;
3752
3753 // Total RSS in kilobytes consumed by the process after compaction.
3754 optional int64 after_rss_total_kilobytes = 8;
3755
3756 // File RSS in kilobytes consumed by the process after compaction.
3757 optional int64 after_rss_file_kilobytes = 9;
3758
3759 // Anonymous RSS in kilobytes consumed by the process after compaction.
3760 optional int64 after_rss_anon_kilobytes = 10;
3761
3762 // Swap in kilobytes consumed by the process after compaction.
3763 optional int64 after_swap_kilobytes = 11;
3764
3765 // The time taken to perform compaction in milliseconds.
3766 optional int64 time_to_compact_millis = 12;
3767
3768 // The last compaction action performed for this app.
3769 optional Action last_action = 13;
3770
Ben Murdoch01720b82018-12-19 18:03:44 +00003771 // The last time that compaction was attempted on this process in milliseconds
3772 // since boot, not including sleep (see SystemClock.uptimeMillis()).
3773 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00003774
Ben Murdoch01720b82018-12-19 18:03:44 +00003775 // The oom_score_adj at the time of compaction.
3776 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00003777
3778 // The process state at the time of compaction.
3779 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
3780}
lifr157fc552018-12-12 16:38:04 +08003781
3782/**
3783 * Logs the latency period(in microseconds) and the return code of
3784 * the DNS(Domain Name System) lookups.
3785 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
3786 * to get info(address or hostname) from DNS server(or DNS cache).
3787 * Logged from:
3788 * /system/netd/server/DnsProxyListener.cpp
3789 */
3790message NetworkDnsEventReported {
3791 // The types of the DNS lookups, as defined in
3792 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
3793 enum EventType {
3794 EVENT_UNKNOWN = 0;
3795 EVENT_GETADDRINFO = 1;
3796 EVENT_GETHOSTBYNAME = 2;
3797 EVENT_GETHOSTBYADDR = 3;
3798 EVENT_RES_NSEND = 4;
3799 }
3800 optional EventType event_type = 1;
3801
3802 // The return value of the DNS resolver for each DNS lookups.
3803 //bionic/libc/include/netdb.h
3804 //system/netd/resolv/include/netd_resolv/resolv.h
3805 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08003806 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08003807 EAI_ADDRFAMILY = 1;
3808 EAI_AGAIN = 2;
3809 EAI_BADFLAGS = 3;
3810 EAI_FAIL = 4;
3811 EAI_FAMILY = 5;
3812 EAI_MEMORY = 6;
3813 EAI_NODATA = 7;
3814 EAI_NONAME = 8;
3815 EAI_SERVICE = 9;
3816 EAI_SOCKTYPE = 10;
3817 EAI_SYSTEM = 11;
3818 EAI_BADHINTS = 12;
3819 EAI_PROTOCOL = 13;
3820 EAI_OVERFLOW = 14;
3821 RESOLV_TIMEOUT = 255;
3822 EAI_MAX = 256;
3823 }
3824 optional ReturnCode return_code = 2;
3825
3826 // The latency period(in microseconds) it took for this DNS lookup to complete.
3827 optional int32 latency_micros = 3;
3828}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08003829
3830/**
3831 * Logs when a data stall event occurs.
3832 *
3833 * Log from:
3834 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
3835 */
3836message DataStallEvent {
3837 // Data stall evaluation type.
3838 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
3839 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
3840 optional int32 evaluation_type = 1;
3841 // See definition in data_stall_event.proto.
3842 optional com.android.server.connectivity.ProbeResult validation_result = 2;
3843 // See definition in data_stall_event.proto.
3844 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
3845 // See definition in data_stall_event.proto.
3846 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
3847 // See definition in data_stall_event.proto.
3848 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
3849 // See definition in data_stall_event.proto.
3850 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
3851}
Christian Brunschenf86039e2018-12-21 12:26:14 +00003852
3853/*
3854 * Logs when RescueParty resets some set of experiment flags.
3855 *
3856 * Logged from:
3857 * frameworks/base/services/core/java/com/android/server/RescueParty.java
3858 */
3859message RescuePartyResetReported {
3860 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
3861 optional int32 rescue_level = 1;
3862}
Mathew Inwoodb375be52019-01-04 11:36:25 +00003863
3864/**
3865 * Logs when signed config is received from an APK, and if that config was applied successfully.
3866 * Logged from:
3867 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
3868 */
3869message SignedConfigReported {
3870 enum Type {
3871 UNKNOWN_TYPE = 0;
3872 GLOBAL_SETTINGS = 1;
3873 }
3874 optional Type type = 1;
3875
3876 // The final status of the signed config received.
3877 enum Status {
3878 UNKNOWN_STATUS = 0;
3879 APPLIED = 1;
3880 BASE64_FAILURE_CONFIG = 2;
3881 BASE64_FAILURE_SIGNATURE = 3;
3882 SECURITY_EXCEPTION = 4;
3883 INVALID_CONFIG = 5;
3884 OLD_CONFIG = 6;
3885 SIGNATURE_CHECK_FAILED = 7;
3886 NOT_APPLICABLE = 8;
3887 }
3888 optional Status status = 2;
3889
3890 // The version of the signed config processed.
3891 optional int32 version = 3;
3892
3893 // The package name that the config was extracted from.
3894 optional string from_package = 4;
3895
3896 enum Key {
3897 NO_KEY = 0;
3898 DEBUG = 1;
3899 PRODUCTION = 2;
3900 }
3901 // Which key was used to verify the config.
3902 optional Key verified_with = 5;
3903}