blob: f4a17159b7227d8442008a980724e52bb807efb4 [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 Murdochbab399f62018-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;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800185 GnssNiEventReported gnss_ni_event_reported = 124;
Yao Chend54f9dd2017-10-17 17:37:48 +0000186 }
David Chenc8a43242017-10-17 16:23:28 -0700187
David Chen6e3e6cb2018-01-03 16:14:06 -0800188 // Pulled events will start at field 10000.
Rafal Slawik3bea8952018-11-15 12:39:33 +0000189 // Next: 10043
David Chenc8a43242017-10-17 16:23:28 -0700190 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800191 WifiBytesTransfer wifi_bytes_transfer = 10000;
192 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
193 MobileBytesTransfer mobile_bytes_transfer = 10002;
194 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800195 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800196 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800197 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800198 CpuTimePerFreq cpu_time_per_freq = 10008;
199 CpuTimePerUid cpu_time_per_uid = 10009;
200 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800201 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800202 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800203 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800204 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800205 SystemElapsedRealtime system_elapsed_realtime = 10014;
206 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800207 CpuActiveTime cpu_active_time = 10016;
208 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000209 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800210 RemainingBatteryCapacity remaining_battery_capacity = 10019;
211 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800212 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100213 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100214 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100215 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000216 DiskStats disk_stats = 10025;
217 DirectoryUsage directory_usage = 10026;
218 AppSize app_size = 10027;
219 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700220 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700221 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700222 NumFingerprints num_fingerprints = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700223 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700224 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800225 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700226 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100227 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100228 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700229 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800230 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
231 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
232 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000233 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800234 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800235 BuildInformation build_information = 10044;
David Chenc8a43242017-10-17 16:23:28 -0700236 }
yroa1fe77c2018-02-26 14:22:54 -0800237
Bookatz76aafcf2018-09-17 16:17:10 -0700238 // DO NOT USE field numbers above 100,000 in AOSP.
239 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
240 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700241}
242
Yao Chend54f9dd2017-10-17 17:37:48 +0000243/**
Yangster-mac20877162017-12-22 17:19:39 -0800244 * This proto represents a node of an attribution chain.
245 * Note: All attribution chains are represented as a repeated field of type
246 * AttributionNode. It is understood that in such arrays, the order is that
247 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000248 */
Yangster-mac20877162017-12-22 17:19:39 -0800249message AttributionNode {
250 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800251 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800252
Yangster-mac20877162017-12-22 17:19:39 -0800253 // The (optional) string tag for an element in the attribution chain. If the
254 // element has no tag, it is encoded as an empty string.
255 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700256}
257
Yangster-mac48b3d622018-08-18 12:38:11 -0700258message KeyValuePair {
259 optional int32 key = 1;
260 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700261 int32 value_int = 2;
262 int64 value_long = 3;
263 string value_str = 4;
264 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700265 }
266}
267
268message KeyValuePairsAtom {
269 optional int32 uid = 1;
270 repeated KeyValuePair pairs = 2;
271}
272
Yao Chend54f9dd2017-10-17 17:37:48 +0000273/*
274 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800275 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000276 *
277 * RULES:
278 * - The field ids for each atom must start at 1, and count upwards by 1.
279 * Skipping field ids is not allowed.
280 * - These form an API, so renaming, renumbering or removing fields is
281 * not allowed between android releases. (This is not currently enforced,
282 * but there will be a tool to enforce this restriction).
283 * - The types must be built-in protocol buffer types, namely, no sub-messages
284 * are allowed (yet). The bytes type is also not allowed.
285 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800286 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000287 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800288 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000289 * - A field that is a uid should be a string field, tagged with the [xxx]
290 * annotation. The generated code on android will be represented by UIDs,
291 * and those UIDs will be translated in xxx to those strings.
292 *
293 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700294 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000295 * - If there is a UID, it goes first. Think in an object-oriented fashion.
296 * *****************************************************************************
297 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700298
Yao Chend54f9dd2017-10-17 17:37:48 +0000299/**
Yangster-mace16189a2018-08-26 12:20:16 -0700300 * Logs when the Thermal service HAL notifies the throttling start/stop events.
301 *
302 * Logged from:
303 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
304 */
305message ThermalThrottlingStateChanged {
306 optional android.os.TemperatureTypeEnum sensor_type = 1;
307
308 enum State {
309 UNKNOWN = 0;
310 START = 1;
311 STOP = 2;
312 }
313
314 optional State state = 2;
315
316 optional float temperature = 3;
317}
318
319/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000320 * Logs when the screen state changes.
321 *
322 * Logged from:
323 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
324 */
325message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800326 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700327 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700328}
Yao Chend54f9dd2017-10-17 17:37:48 +0000329
330/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700331 * Logs that the process state of the uid, as determined by ActivityManager
332 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000333 *
334 * Logged from:
335 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
336 */
Bookatzc1a050a2017-10-10 15:49:28 -0700337message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700338 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000339
Bookatzdb026a22018-01-10 19:01:56 -0800340 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700341 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000342}
343
344/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700345 * Logs process state change of a process, as per the activity manager.
346 *
347 * Logged from:
348 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
349 */
350message ProcessStateChanged {
351 optional int32 uid = 1;
352 optional string process_name = 2;
353 optional string package_name = 3;
354 // TODO: remove this when validation is done
355 optional int64 version = 5;
356 // The state, from frameworks/base/core/proto/android/app/enums.proto.
357 optional android.app.ProcessStateEnum state = 4;
358}
359
360/**
361 * Logs when ActivityManagerService sleep state is changed.
362 *
363 * Logged from:
364 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
365 */
366message ActivityManagerSleepStateChanged {
367 // TODO: import frameworks proto
368 enum State {
369 UNKNOWN = 0;
370 ASLEEP = 1;
371 AWAKE = 2;
372 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700373 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700374}
375
376/**
377 * Logs when system memory state changes.
378 *
379 * Logged from:
380 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
381 */
382message MemoryFactorStateChanged {
383 // TODO: import frameworks proto
384 enum State {
385 MEMORY_UNKNOWN = 0;
386 NORMAL = 1; // normal.
387 MODERATE = 2; // moderate memory pressure.
388 LOW = 3; // low memory.
389 CRITICAL = 4; // critical memory.
390
391 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700392 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700393}
394
395/**
396 * Logs when app is using too much cpu, according to ActivityManagerService.
397 *
398 * Logged from:
399 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
400 */
401message ExcessiveCpuUsageReported {
402 optional int32 uid = 1;
403 optional string process_name = 2;
404 optional string package_name = 3;
405 // package version. TODO: remove this when validation is done
406 optional int64 version = 4;
407}
408
409/**
410 * Logs when a cached process is killed, along with its pss.
411 *
412 * Logged from:
413 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
414 */
415message CachedKillReported {
416 optional int32 uid = 1;
417 optional string process_name = 2;
418 optional string package_name = 3;
419 // TODO: remove this when validation is done
420 optional int64 version = 5;
421 optional int64 pss = 4;
422}
423
424/**
425 * Logs when memory stats of a process is reported.
426 *
427 * Logged from:
428 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
429 */
430message ProcessMemoryStatReported {
431 optional int32 uid = 1;
432 optional string process_name = 2;
433 optional string package_name = 3;
434 //TODO: remove this when validation is done
435 optional int64 version = 9;
436 optional int64 pss = 4;
437 optional int64 uss = 5;
438 optional int64 rss = 6;
439 enum Type {
440 ADD_PSS_INTERNAL_SINGLE = 0;
441 ADD_PSS_INTERNAL_ALL_MEM = 1;
442 ADD_PSS_INTERNAL_ALL_POLL = 2;
443 ADD_PSS_EXTERNAL = 3;
444 ADD_PSS_EXTERNAL_SLOW = 4;
445 }
446 optional Type type = 7;
447 optional int64 duration = 8;
448}
449
450/**
Bookatzc1a050a2017-10-10 15:49:28 -0700451 * Logs that a process started, finished, crashed, or ANRed.
452 *
453 * Logged from:
454 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
455 */
456message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700457 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700458
David Chen0b5c90c2018-01-25 16:51:49 -0800459 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800460 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700461
Bookatzddccf0a2017-11-28 16:48:14 -0800462 // What lifecycle state the process changed to.
463 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800464 enum State {
465 FINISHED = 0;
466 STARTED = 1;
467 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800468 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800469 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700470}
471
Bookatzc1a050a2017-10-10 15:49:28 -0700472/**
473 * Logs when the ble scan state changes.
474 *
475 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700476 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700477 */
478message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800479 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700480
481 enum State {
482 OFF = 0;
483 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700484 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
485 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700486 }
487 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700488
Bookatze5ec0b42018-03-26 13:34:56 -0700489 // Does the scan have a filter.
490 optional bool is_filtered = 3;
491 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
492 optional bool is_first_match = 4;
493 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
494 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700495}
496
497/**
498 * Logs reporting of a ble scan finding results.
499 *
500 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700501 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700502 */
Bookatzae6738e2018-09-13 11:38:56 -0700503// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700504message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800505 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700506
507 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800508 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700509}
510
511/**
512 * Logs when a sensor state changes.
513 *
514 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700515 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700516 */
517message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800518 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700519
Bookatzc1a050a2017-10-10 15:49:28 -0700520 // The id (int) of the sensor.
521 optional int32 sensor_id = 2;
522
523 enum State {
524 OFF = 0;
525 ON = 1;
526 }
527 optional State state = 3;
528}
529
Bookatzc1a050a2017-10-10 15:49:28 -0700530/**
531 * Logs when GPS state changes.
532 *
533 * Logged from:
534 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
535 */
536message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800537 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700538
539 enum State {
540 OFF = 0;
541 ON = 1;
542 }
543 optional State state = 2;
544}
545
Bookatz48d362e2018-11-06 15:49:08 -0800546/**
547 * Logs when GPS signal quality.
548 *
549 * Logged from:
550 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
551 */
552message GpsSignalQualityChanged {
553 optional android.server.location.GpsSignalQualityEnum level = 1;
554}
555
Bookatzc1a050a2017-10-10 15:49:28 -0700556
557/**
558 * Logs when a sync manager sync state changes.
559 *
560 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700561 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700562 */
563message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800564 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700565
David Chen0b5c90c2018-01-25 16:51:49 -0800566 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800567 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700568
569 enum State {
570 OFF = 0;
571 ON = 1;
572 }
573 optional State state = 3;
574}
575
Yangster-mac96353002018-09-05 11:18:55 -0700576/*
577 * Deferred job stats.
578 *
579 * Logged from:
580 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
581*/
582message DeferredJobStatsReported {
583 repeated AttributionNode attribution_node = 1;
584
585 // Number of jobs deferred.
586 optional int32 num_jobs_deferred = 2;
587
588 // Time since the last job runs.
589 optional int64 time_since_last_job_millis = 3;
590}
591
Bookatzc1a050a2017-10-10 15:49:28 -0700592/**
593 * Logs when a job scheduler job state changes.
594 *
595 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700596 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700597 */
598message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800599 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700600
601 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800602 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700603
604 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800605 FINISHED = 0;
606 STARTED = 1;
607 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700608 }
609 optional State state = 3;
610
Tej Singh33a412b2018-03-16 18:43:59 -0700611 // The reason a job has stopped.
612 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700613 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700614 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700615}
616
617/**
618 * Logs when the audio state changes.
619 *
620 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700621 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700622 */
623message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800624 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700625
626 enum State {
627 OFF = 0;
628 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700629 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
630 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700631 }
632 optional State state = 2;
633}
634
635/**
636 * Logs when the video codec state changes.
637 *
638 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700639 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700640 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800641message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800642 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700643
644 enum State {
645 OFF = 0;
646 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700647 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
648 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700649 }
650 optional State state = 2;
651}
652
653/**
654 * Logs when the flashlight state changes.
655 *
656 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700657 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700658 */
659message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800660 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700661
662 enum State {
663 OFF = 0;
664 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700665 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
666 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700667 }
668 optional State state = 2;
669}
670
671/**
672 * Logs when the camera state changes.
673 *
674 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700675 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700676 */
677message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800678 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700679
680 enum State {
681 OFF = 0;
682 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700683 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
684 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700685 }
686 optional State state = 2;
687}
688
689/**
690 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000691 *
692 * Logged from:
693 * TODO
694 */
Bookatzd6746242017-10-24 18:39:35 -0700695message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800696 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000697
Bookatz1a1b0462018-01-12 11:47:03 -0800698 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
699 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700700 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700701
702 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
703 optional string tag = 3;
704
705 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800706 RELEASE = 0;
707 ACQUIRE = 1;
708 CHANGE_RELEASE = 2;
709 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700710 }
711 optional State state = 4;
712}
713
714/**
Bookatzc1a050a2017-10-10 15:49:28 -0700715 * Logs when a partial wakelock is considered 'long' (over 1 min).
716 *
717 * Logged from:
718 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
719 */
720message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800721 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700722
Yao Chend54f9dd2017-10-17 17:37:48 +0000723 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
724 optional string tag = 2;
725
Bookatzc1a050a2017-10-10 15:49:28 -0700726 // TODO: I have no idea what this is.
727 optional string history_tag = 3;
728
729 enum State {
730 OFF = 0;
731 ON = 1;
732 }
733 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000734}
735
Bookatzc1a050a2017-10-10 15:49:28 -0700736/**
Bookatza66083f2018-09-20 17:24:00 -0700737 * Logs when the device is interactive, according to the PowerManager Notifier.
738 *
739 * Logged from:
740 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
741 */
742message InteractiveStateChanged {
743 enum State {
744 OFF = 0;
745 ON = 1;
746 }
747 optional State state = 1;
748}
749
750/**
Bookatzc1a050a2017-10-10 15:49:28 -0700751 * Logs Battery Saver state change.
752 *
753 * Logged from:
754 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
755 */
756message BatterySaverModeStateChanged {
757 enum State {
758 OFF = 0;
759 ON = 1;
760 }
761 optional State state = 1;
762}
763
764/**
765 * Logs Doze mode state change.
766 *
767 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800768 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700769 */
770message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800771 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800772}
773
774
775/**
776 * Logs state change of Doze mode including maintenance windows.
777 *
778 * Logged from:
779 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
780 */
781message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800782 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700783}
784
785/**
786 * Logs screen brightness level.
787 *
788 * Logged from:
789 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
790 */
791message ScreenBrightnessChanged {
792 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
793 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700794}
795
796/**
797 * Logs battery level (percent full, from 0 to 100).
798 *
799 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700800 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700801 */
802message BatteryLevelChanged {
803 // Battery level. Should be in [0, 100].
804 optional int32 battery_level = 1;
805}
806
807/**
808 * Logs change in charging status of the device.
809 *
810 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700811 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700812 */
813message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800814 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
815 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700816}
817
818/**
819 * Logs whether the device is plugged in, and what power source it is using.
820 *
821 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700822 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700823 */
824message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800825 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
826 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700827}
828
Bookatz8c6571b2017-10-24 15:04:41 -0700829/**
830 * Logs when an app's wakeup alarm fires.
831 *
832 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700833 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700834 */
835message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800836 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800837
838 // Name of the wakeup alarm.
839 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700840
841 // Name of source package (for historical reasons, since BatteryStats tracked it).
842 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800843}
844
845/**
846 * Logs when an an app causes the mobile radio to change state.
847 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
848 *
849 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700850 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800851 */
852message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800853 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800854
Bookatz1a1b0462018-01-12 11:47:03 -0800855 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
856 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800857}
858
859/**
860 * Logs when an an app causes the wifi radio to change state.
861 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
862 *
863 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700864 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800865 */
866message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800867 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800868
Bookatz1a1b0462018-01-12 11:47:03 -0800869 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
870 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700871}
872
873/**
874 * Logs kernel wakeup reasons and aborts.
875 *
876 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700877 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700878 */
879message KernelWakeupReported {
880 // Name of the kernel wakeup reason (or abort).
881 optional string wakeup_reason_name = 1;
882
883 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800884 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700885}
886
887/**
Bookatzda1798c2018-12-13 14:16:00 -0800888 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800889 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800890 *
891 * Logged from:
892 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
893 */
894message WifiEnabledStateChanged {
895 enum State {
896 OFF = 0;
897 ON = 1;
898 }
899 optional State state = 1;
900}
901
902/**
903 * 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 -0800904 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
905 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800906 *
907 * Logged from:
908 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
909 */
910message WifiRunningStateChanged {
911 repeated AttributionNode attribution_node = 1;
912
913 enum State {
914 OFF = 0;
915 ON = 1;
916 }
917 optional State state = 2;
918}
919
920/**
Bookatze5885242017-10-24 20:10:31 -0700921 * Logs wifi locks held by an app.
922 *
923 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700924 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700925 */
926message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800927 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700928
929 enum State {
930 OFF = 0;
931 ON = 1;
932 }
933 optional State state = 2;
934}
935
936/**
937 * Logs wifi signal strength changes.
938 *
939 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800940 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -0700941 */
942message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800943 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
944 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700945}
946
947/**
948 * Logs wifi scans performed by an app.
949 *
950 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800951 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -0700952 */
953message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800954 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700955
956 enum State {
957 OFF = 0;
958 ON = 1;
959 }
960 optional State state = 2;
961}
962
963/**
Tej Singh4503e102018-01-04 14:35:01 -0800964 * Logs wifi multicast locks held by an app
965 *
966 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800967 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -0800968 */
969message WifiMulticastLockStateChanged {
970 repeated AttributionNode attribution_node = 1;
971
972 enum State {
973 OFF = 0;
974 ON = 1;
975 }
976 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -0800977
978 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -0800979}
980
981/**
Tej Singh1ea42892018-01-19 09:27:00 -0800982 * Logs shutdown reason and duration on next boot.
983 *
984 * Logged from:
985 * frameworks/base/core/java/com/android/server/BootReceiver.java
986 */
987message ShutdownSequenceReported {
988 // True if shutdown is for a reboot. Default: false if we do not know.
989 optional bool reboot = 1;
990
991 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
992 optional string reason = 2;
993
994 // Beginning of shutdown time in ms using wall clock time since unix epoch.
995 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800996 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800997
998 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800999 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001000}
1001
Tej Singh6483ea42018-01-25 17:45:49 -08001002
1003/**
1004 * Logs boot reason and duration.
1005 *
1006 * Logged from:
1007 * system/core/bootstat/bootstat.cpp
1008 */
1009message BootSequenceReported {
1010 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1011 // Default: "<EMPTY>" if not available.
1012 optional string bootloader_reason = 1;
1013
1014 // Reason for system boot. Eg. bootloader, reboot,userrequested
1015 // Default: "<EMPTY>" if not available.
1016 optional string system_reason = 2;
1017
1018 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001019 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001020
1021 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001022 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001023
1024 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001025 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001026
1027 // Time since last boot in ms. Default: 0 if not available.
1028 optional int64 time_since_last_boot = 6;
1029}
1030
Tej Singhc477d9c2018-02-05 18:31:39 -08001031
1032/**
1033 * Logs call state and disconnect cause (if applicable).
1034 *
1035 * Logged from:
1036 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1037 */
1038message CallStateChanged {
1039 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1040 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1041 optional android.telecom.CallStateEnum call_state = 1;
1042
1043 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1044 // This value is only applicable when the call_state is DISCONNECTED, and
1045 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1046 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1047 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1048
1049 // True if the call is self-managed, which are apps that use the
1050 // telecom infrastructure to make their own calls.
1051 optional bool self_managed = 3;
1052
1053 // True if call is external. External calls are calls on connected Wear
1054 // devices but show up in Telecom so the user can pull them onto the device.
1055 optional bool external_call = 4;
1056}
1057
Tej Singh1ea42892018-01-19 09:27:00 -08001058/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001059 * Logs keyguard state. The keyguard is the lock screen.
1060 *
1061 * Logged from:
1062 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1063 */
1064message KeyguardStateChanged {
1065 enum State {
1066 UNKNOWN = 0;
1067 // The keyguard is hidden when the phone is unlocked.
1068 HIDDEN = 1;
1069 // The keyguard is shown when the phone is locked (screen turns off).
1070 SHOWN= 2;
1071 // The keyguard is occluded when something is overlaying the keyguard.
1072 // Eg. Opening the camera while on the lock screen.
1073 OCCLUDED = 3;
1074 }
1075 optional State state = 1;
1076}
1077
1078/**
1079 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1080 * prompts the user to enter a password (pattern, pin, etc).
1081 *
1082 * Logged from:
1083 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1084 */
1085
1086message KeyguardBouncerStateChanged {
1087 enum State {
1088 UNKNOWN = 0;
1089 // Bouncer is hidden, either as a result of successfully entering the
1090 // password, screen timing out, or user going back to lock screen.
1091 HIDDEN = 1;
1092 // This is when the user is being prompted to enter the password.
1093 SHOWN = 2;
1094 }
1095 optional State state = 1;
1096}
1097
1098/**
1099 * Logs the result of entering a password into the keyguard bouncer.
1100 *
1101 * Logged from:
1102 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1103 */
1104message KeyguardBouncerPasswordEntered {
1105 enum BouncerResult {
1106 UNKNOWN = 0;
1107 // The password entered was incorrect.
1108 FAILURE = 1;
1109 // The password entered was correct.
1110 SUCCESS = 2;
1111 }
1112 optional BouncerResult result = 1;
1113}
1114
Tej Singha883b372018-02-15 11:30:01 -08001115/*
1116 * Logs changes to the configuration of the device. The configuration is defined
1117 * in frameworks/base/core/java/android/content/res/Configuration.java
1118 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1119 * Please go there to interpret the possible values each field can be.
1120 *
1121 * Logged from:
1122 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1123 */
1124message ResourceConfigurationChanged {
1125 // Bit mask of color capabilities of the screen.
1126 // Contains information about the color gamut and hdr mode of the screen.
1127 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001128 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001129
1130 // The target screen density being rendered to.
1131 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001132 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001133
1134 // Current user preference for the scaling factor for fonts,
1135 // relative to the base density scaling.
1136 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001137 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001138
1139 // Flag indicating whether the hard keyboard is hidden.
1140 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001141 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001142
1143 // The type of keyboard attached to the device.
1144 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1145 optional int32 keyboard = 5;
1146
1147 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1148 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001149 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001150
1151 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1152 // 0 if undefined.
1153 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1154 optional int32 mcc = 7;
1155
1156 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1157 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1158 // MNC_ZERO symbol defined in Configuration.java.
1159 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1160 optional int32 mnc = 8;
1161
1162 // The kind of navigation available on the device.
1163 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1164 optional int32 navigation = 9;
1165
1166 // Flag indicating whether the navigation is available.
1167 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001168 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001169
1170 // Overall orientation of the screen.
1171 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1172 optional int32 orientation = 11;
1173
1174 // The current height of the available screen space, in dp units.
1175 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001176 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001177
1178 // Bit mask of overall layout of the screen.
1179 // Contains information about screen size, whether the screen is wider/taller
1180 // than normal, whether the screen layout is right-tl-left or left-to-right,
1181 // and whether the screen has a rounded shape.
1182 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001183 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001184
1185 // Current width of the available screen space, in dp units.
1186 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001187 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001188
1189 // The smallest screen size an application will see in normal operation.
1190 // This is the smallest value of both screenWidthDp and screenHeightDp
1191 // in portrait and landscape.
1192 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001193 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001194
1195 // The type of touch screen attached to the device.
1196 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1197 optional int32 touchscreen = 16;
1198
1199 // Bit mask of the ui mode.
1200 // Contains information about the overall ui mode of the device.
1201 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1202 // Also contains information about whether the device is in night mode.
1203 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001204 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001205}
1206
Tej Singheee317b2018-03-07 19:28:05 -08001207
1208/**
1209 * Logs changes in the connection state of the mobile radio.
1210 *
1211 * Logged from:
1212 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1213 */
1214message MobileConnectionStateChanged {
1215 // States are from the state machine DataConnection.java.
1216 enum State {
1217 UNKNOWN = 0;
1218 // The connection is inactive, or disconnected.
1219 INACTIVE = 1;
1220 // The connection is being activated, or connecting.
1221 ACTIVATING = 2;
1222 // The connection is active, or connected.
1223 ACTIVE = 3;
1224 // The connection is disconnecting.
1225 DISCONNECTING = 4;
1226 // The connection is disconnecting after creating a connection.
1227 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1228 }
1229 optional State state = 1;
1230 // For multi-sim phones, this distinguishes between the sim cards.
1231 optional int32 sim_slot_index = 2;
1232 // Used to identify the connection. Starts at 0 and increments by 1 for
1233 // every new network created. Resets whenever the device reboots.
1234 optional int32 data_connection_id = 3;
1235 // A bitmask for the capabilities of this connection.
1236 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1237 // Default value (if we have no information): 0
1238 optional int64 capabilities = 4;
1239 // If this connection has internet.
1240 // This just checks if the DEFAULT bit of capabilities is set.
1241 optional bool has_internet = 5;
1242}
1243
1244/**
1245 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1246 *
1247 * Logged from:
1248 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1249 */
1250message MobileRadioTechnologyChanged {
1251 optional android.telephony.NetworkTypeEnum state = 1;
1252 // For multi-sim phones, this distinguishes between the sim cards.
1253 optional int32 sim_slot_index = 2;
1254}
1255
Andrew Chantb56388b2018-03-22 21:07:33 -07001256/**
1257 * Logs the VID and PID of any connected USB devices.
1258 *
1259 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1260 *
1261 * Logged by Vendor.
1262 */
1263message UsbDeviceAttached {
1264 optional int32 vid = 1;
1265 optional int32 pid = 2;
1266 optional bool has_audio = 3;
1267 optional bool has_hid = 4;
1268 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001269 enum State {
1270 STATE_DISCONNECTED = 0;
1271 STATE_CONNECTED = 1;
1272 }
1273 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001274 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001275}
1276
Tej Singheee317b2018-03-07 19:28:05 -08001277
Tej Singhdd7bd352018-02-09 19:33:15 -08001278/**
Tej Singh5d991e12018-03-09 19:48:11 -08001279 * Logs when Bluetooth is enabled and disabled.
1280 *
1281 * Logged from:
1282 * services/core/java/com/android/server/BluetoothManagerService.java
1283 */
1284message BluetoothEnabledStateChanged {
1285 repeated AttributionNode attribution_node = 1;
1286 // Whether or not bluetooth is enabled on the device.
1287 enum State {
1288 UNKNOWN = 0;
1289 ENABLED = 1;
1290 DISABLED = 2;
1291 }
1292 optional State state = 2;
1293 // The reason for being enabled/disabled.
1294 // Eg. Airplane mode, crash, application request.
1295 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1296 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001297 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001298}
1299
1300/**
1301 * Logs when a Bluetooth device connects and disconnects.
1302 *
1303 * Logged from:
1304 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1305 */
1306message BluetoothConnectionStateChanged {
1307 // The state of the connection.
1308 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1309 optional android.bluetooth.ConnectionStateEnum state = 1;
1310 // An identifier that can be used to match connect and disconnect events.
1311 // Currently is last two bytes of a hash of a device level ID and
1312 // the mac address of the bluetooth device that is connected.
1313 optional int32 obfuscated_id = 2;
1314 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1315 // From android.bluetooth.BluetoothAdapter.java
1316 optional int32 bt_profile = 3;
1317}
1318
1319/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001320 * Logs when something is plugged into or removed from the USB-C connector.
1321 *
1322 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001323 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08001324 */
1325message UsbConnectorStateChanged {
1326 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001327 STATE_DISCONNECTED = 0;
1328 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08001329 }
1330 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001331 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08001332 // Last active session in ms.
1333 // 0 when the port is in connected state.
1334 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001335}
1336
1337/**
1338 * Logs the reported speaker impedance.
1339 *
1340 * Logged from:
1341 * Vendor audio implementation.
1342 */
1343message SpeakerImpedanceReported {
1344 optional int32 speaker_location = 1;
1345 optional int32 impedance = 2;
1346}
1347
1348/**
1349 * Logs the report of a failed hardware.
1350 *
1351 * Logged from:
1352 * Vendor HALs.
1353 *
1354 */
1355message HardwareFailed {
1356 enum HardwareType {
1357 HARDWARE_FAILED_UNKNOWN = 0;
1358 HARDWARE_FAILED_MICROPHONE = 1;
1359 HARDWARE_FAILED_CODEC = 2;
1360 HARDWARE_FAILED_SPEAKER = 3;
1361 HARDWARE_FAILED_FINGERPRINT = 4;
1362 }
1363 optional HardwareType hardware_type = 1;
1364
1365 /* hardware_location allows vendors to differentiate between multiple instances of
1366 * the same hardware_type. The specific locations are vendor defined integers,
1367 * referring to board-specific numbering schemes.
1368 */
1369 optional int32 hardware_location = 2;
1370
1371 /* failure_code is specific to the HardwareType of the failed hardware.
1372 * It should use the enum values defined below.
1373 */
1374 enum MicrophoneFailureCode {
1375 MICROPHONE_FAILURE_COMPLETE = 0;
1376 }
1377 enum CodecFailureCode {
1378 CODEC_FAILURE_COMPLETE = 0;
1379 }
1380 enum SpeakerFailureCode {
1381 SPEAKER_FAILURE_COMPLETE = 0;
1382 SPEAKER_FAILURE_HIGH_Z = 1;
1383 SPEAKER_FAILURE_SHORT = 2;
1384 }
1385 enum FingerprintFailureCode {
1386 FINGERPRINT_FAILURE_COMPLETE = 0;
1387 FINGERPRINT_SENSOR_BROKEN = 1;
1388 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1389 }
1390 optional int32 failure_code = 3;
1391}
1392
1393/**
1394 * Log an event when the device has been physically dropped.
1395 * Reported from the /vendor partition.
1396 */
1397message PhysicalDropDetected {
1398 // Confidence that the event was actually a drop, 0 -> 100
1399 optional int32 confidence_pctg = 1;
1400 // Peak acceleration of the drop, in 1/1000s of a g.
1401 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001402 // Duration of freefall in ms
1403 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001404}
1405
1406/**
1407 * Log bucketed battery charge cycles.
1408 *
1409 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08001410 * a given charge point. For example, if 10 cycle buckets are
1411 * initialized, bucket 1 is the lowest 1/10th of the battery,
1412 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08001413 *
1414 * Logged from:
1415 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1416 */
1417message ChargeCyclesReported {
1418 optional int32 cycle_bucket_1 = 1;
1419 optional int32 cycle_bucket_2 = 2;
1420 optional int32 cycle_bucket_3 = 3;
1421 optional int32 cycle_bucket_4 = 4;
1422 optional int32 cycle_bucket_5 = 5;
1423 optional int32 cycle_bucket_6 = 6;
1424 optional int32 cycle_bucket_7 = 7;
1425 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08001426 optional int32 cycle_bucket_9 = 9;
1427 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08001428}
1429
1430/**
Howard Roa46b6582018-09-18 16:45:02 -07001431 * Log battery health snapshot.
1432 *
1433 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1434 * are snapshotted periodically over 24hrs.
1435 */
1436message BatteryHealthSnapshot {
1437 enum BatterySnapshotType {
1438 UNKNOWN = 0;
1439 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1440 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1441 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1442 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1443 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1444 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1445 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1446 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1447 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1448 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1449 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1450 }
1451 optional BatterySnapshotType type = 1;
1452 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001453 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001454 // Voltage Battery Voltage, in microVolts.
1455 optional int32 voltage_micro_volt = 3;
1456 // Current Battery current, in microAmps.
1457 optional int32 current_micro_amps = 4;
1458 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1459 optional int32 open_circuit_micro_volt = 5;
1460 // Resistance Battery Resistance, in microOhms.
1461 optional int32 resistance_micro_ohm = 6;
1462 // Level Battery Level, as % of full.
1463 optional int32 level_percent = 7;
1464}
1465
1466/**
1467 * Log slow I/O operations on the primary storage.
1468 */
1469message SlowIo {
1470 // Classifications of IO Operations.
1471 enum IoOperation {
1472 UNKNOWN = 0;
1473 READ = 1;
1474 WRITE = 2;
1475 UNMAP = 3;
1476 SYNC = 4;
1477 }
1478 optional IoOperation operation = 1;
1479
1480 // The number of slow IO operations of this type over 24 hours.
1481 optional int32 count = 2;
1482}
1483
1484/**
1485 * Log battery caused shutdown with the last recorded voltage.
1486 */
1487message BatteryCausedShutdown {
1488 // The last recorded battery voltage prior to shutdown.
1489 optional int32 last_recorded_micro_volt = 1;
1490}
1491
1492/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001493 * Logs the duration of a davey (jank of >=700ms) when it occurs
1494 *
1495 * Logged from:
1496 * frameworks/base/libs/hwui/JankTracker.cpp
1497 */
1498message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001499 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001500 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001501
Tej Singhbb8554a2018-01-26 11:59:14 -08001502 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001503 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001504}
1505
1506/**
Bookatze5885242017-10-24 20:10:31 -07001507 * Logs phone signal strength changes.
1508 *
1509 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001510 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001511 */
1512message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001513 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1514 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001515}
1516
Yangster4ccebea2018-10-09 17:09:02 -07001517
1518/**
1519 * Logs when the phone state, sim state or signal strength changes
1520 *
1521 * Logged from:
1522 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1523 */
1524message PhoneServiceStateChanged {
1525 optional android.telephony.ServiceStateEnum state = 1;
1526 optional android.telephony.SimStateEnum sim_state = 2;
1527 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1528}
1529
1530/**
1531 * Logs when the phone becomes on or off.
1532 *
1533 * Logged from:
1534 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1535 */
1536message PhoneStateChanged {
1537 enum State {
1538 OFF = 0;
1539 ON = 1;
1540 }
1541 optional State state = 1;
1542}
1543
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001544message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07001545 optional android.stats.launcher.LauncherAction action = 1;
1546 optional android.stats.launcher.LauncherState src_state = 2;
1547 optional android.stats.launcher.LauncherState dst_state = 3;
1548 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001549 optional bool is_swipe_up_enabled = 5;
1550}
1551
David Chenc28b2bb2017-10-24 12:52:52 -07001552/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001553 * Logs when Settings UI has changed.
1554 *
1555 * Logged from:
1556 * packages/apps/Settings
1557 */
1558message SettingsUIChanged {
1559 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001560 * Where this SettingsUIChange event comes from. For example, if
1561 * it's a PAGE_VISIBLE event, where the page is opened from.
1562 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001563 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001564
1565 /**
1566 * What the UI action is.
1567 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001568 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001569
1570 /**
1571 * Where the action is happening
1572 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001573 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001574
1575 /**
1576 * What preference changed in this event.
1577 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001578 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07001579
1580 /**
1581 * The new value of the changed preference.
1582 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001583 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07001584}
1585
1586/**
David Chenc28b2bb2017-10-24 12:52:52 -07001587 * Logs that a setting was updated.
1588 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001589 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001590 * The tag and is_default allow resetting of settings to default values based on the specified
1591 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1592 */
1593message SettingChanged {
1594 // The name of the setting.
1595 optional string setting = 1;
1596
1597 // The change being imposed on this setting. May represent a number, eg "3".
1598 optional string value = 2;
1599
1600 // The new value of this setting. For most settings, this is same as value. For some settings,
1601 // value is +X or -X where X represents an element in a set. For example, if the previous value
1602 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1603 // The +/- feature is currently only used for location_providers_allowed.
1604 optional string new_value = 3;
1605
1606 // The previous value of this setting.
1607 optional string prev_value = 4;
1608
1609 // The tag used with the is_default for resetting sets of settings. This is generally null.
1610 optional string tag = 5;
1611
Bookatz90867622018-01-31 15:05:57 -08001612 // True if this setting with tag should be resettable.
1613 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001614
David Chenbd789912018-03-16 17:19:55 -07001615 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001616 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001617
1618 enum ChangeReason {
1619 UPDATED = 1; // Updated can be an insertion or an update.
1620 DELETED = 2;
1621 }
1622 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001623}
Chenjie Yub3dda412017-10-24 13:41:59 -07001624
Chenjie Yu05013b32017-11-21 10:21:41 -08001625/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001626 * Logs activity going to foreground or background
1627 *
1628 * Logged from:
1629 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1630 */
1631message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001632 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001633 optional string pkg_name = 2;
1634 optional string class_name = 3;
1635
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001636 enum State {
1637 BACKGROUND = 0;
1638 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001639 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001640 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001641}
David Chenc8a43242017-10-17 16:23:28 -07001642
1643/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001644 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001645 * Logged from:
1646 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1647 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001648message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001649 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001650
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001651 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001652
1653 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001654 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001655 optional string process_name = 3;
1656
1657 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001658 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07001659
1660 optional string package_name = 5;
1661
1662 enum InstantApp {
1663 UNAVAILABLE = 0;
1664 FALSE = 1;
1665 TRUE = 2;
1666 }
1667 optional InstantApp is_instant_app = 6;
1668
1669 enum ForegroundState {
1670 UNKNOWN = 0;
1671 BACKGROUND = 1;
1672 FOREGROUND = 2;
1673 }
1674 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08001675
1676 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001677}
David Chen9e3808c2017-11-20 17:25:34 -08001678
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001679/**
1680 * Logs when a WTF (What a Terrible Failure) happened.
1681 * Logged from:
1682 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1683 */
1684message WTFOccurred {
1685 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001686
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001687 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001688
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001689 // The name of the process.
1690 // system_server if it is not by an app
1691 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001692
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001693 // The pid if available. -1 means not available.
1694 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08001695
1696 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001697}
1698
1699/**
1700 * Logs when system server reports low memory.
1701 * Logged from:
1702 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1703 */
1704message LowMemReported {
1705}
1706
1707/**
1708 * Logs when an app ANR (App Not Responding) occurs.
1709 * Logged from:
1710 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1711 */
1712message ANROccurred {
1713 optional int32 uid = 1 [(is_uid) = true];
1714
1715 optional string process_name = 2;
1716
1717 optional string short_component_name = 3;
1718
1719 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07001720
1721 enum InstantApp {
1722 UNAVAILABLE = 0;
1723 FALSE = 1;
1724 TRUE = 2;
1725 }
1726 optional InstantApp is_instant_app = 5;
1727
1728 enum ForegroundState {
1729 UNKNOWN = 0;
1730 BACKGROUND = 1;
1731 FOREGROUND = 2;
1732 }
1733 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08001734
1735 optional android.server.ErrorSource error_source = 7;
1736
1737 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08001738}
1739
Bookatza7020bd2018-08-28 16:29:35 -07001740/**
1741 * Logs when the vibrator state changes.
1742 * Logged from:
1743 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1744 */
1745message VibratorStateChanged {
1746 repeated AttributionNode attribution_node = 1;
1747
1748 enum State {
1749 OFF = 0;
1750 ON = 1;
1751 }
1752 optional State state = 2;
1753
1754 // Duration (in milliseconds) requested to keep the vibrator on.
1755 // Only applicable for State == ON.
1756 optional int64 duration_millis = 3;
1757}
1758
David Chen0a368b22017-12-06 16:28:16 -08001759/*
1760 * Allows other apps to push events into statsd.
1761 * Logged from:
1762 * frameworks/base/core/java/android/util/StatsLog.java
1763 */
David Chen0b5c90c2018-01-25 16:51:49 -08001764message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001765 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001766 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001767
1768 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1769 optional int32 label = 2;
1770
1771 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1772 // predicates for the metrics).
1773 enum State {
1774 UNKNOWN = 0;
1775 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1776 STOP = 2;
1777 START = 3;
1778 }
1779 optional State state = 3;
1780}
1781
David Chen9e3808c2017-11-20 17:25:34 -08001782/**
Bookatz7948c872018-09-04 12:58:33 -07001783 * Logs the wall-clock time when a significant wall-clock time shift occurs.
1784 * For example, this could be due to the user manually changing the time.
1785 *
1786 * Logged from:
1787 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
1788 */
1789message WallClockTimeShifted {
1790 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
1791 optional int64 wall_clock_timestamp_millis = 1;
1792}
1793
1794/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001795 * Logs when statsd detects an anomaly.
1796 *
1797 * Logged from:
1798 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1799 */
1800message AnomalyDetected {
1801 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001802 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001803
Yangster-mac94e197c2018-01-02 16:03:03 -08001804 // Id of the config whose anomaly detection alert fired.
1805 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001806
Yangster-mac94e197c2018-01-02 16:03:03 -08001807 // Id of the alert (i.e. name of the anomaly that was detected).
1808 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001809}
1810
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001811message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001812 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001813 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001814
1815 // The app package name.
1816 optional string pkg_name = 2;
1817
1818 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001819 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001820 WARM = 1;
1821 HOT = 2;
1822 COLD = 3;
1823 }
1824 // The transition type.
1825 optional TransitionType type = 3;
1826
1827 // The activity name.
1828 optional string activity_name = 4;
1829
1830 // The name of the calling app. Empty if not set.
1831 optional string calling_pkg_name = 5;
1832
1833 // Whether the app is an instant app.
1834 optional bool is_instant_app = 6;
1835
1836 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001837 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001838
Bookatz80d11a02018-01-16 10:46:35 -08001839 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001840
David Chen0b5c90c2018-01-25 16:51:49 -08001841 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001842 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001843 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001844 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001845 optional int32 bind_application_delay_millis = 11;
1846 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001847
1848 // Empty if not set.
1849 optional string launch_token = 13;
1850
Calin Juravle759fbda2018-02-20 19:52:30 +00001851 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001852 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001853
1854 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001855 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001856}
1857
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001858message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001859 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001860 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001861
1862 // The app package name.
1863 optional string pkg_name = 2;
1864
1865 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001866 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001867 WARM = 1;
1868 HOT = 2;
1869 COLD = 3;
1870 }
1871 // The transition type.
1872 optional TransitionType type = 3;
1873
1874 // The activity name.
1875 optional string activity_name = 4;
1876}
1877
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001878message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001879 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001880 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001881
1882 // The app package name.
1883 optional string pkg_name = 2;
1884
1885 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001886 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001887 WITH_BUNDLE = 1;
1888 WITHOUT_BUNDLE = 2;
1889 }
1890 // The transition type.
1891 optional TransitionType type = 3;
1892
1893 // The activity name.
1894 optional string activity_name = 4;
1895
1896 optional bool transition_process_running = 5;
1897
1898 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001899 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001900}
1901
Bookatz8fcd09a2017-12-18 13:01:10 -08001902/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001903 * Logs a picture-in-picture action
1904 * Logged from:
1905 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1906 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1907 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1908 */
1909message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001910 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001911 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001912
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001913 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001914
Chenjie Yu52cacc62017-12-08 18:11:45 -08001915 enum State {
1916 ENTERED = 1;
1917 EXPANDED_TO_FULL_SCREEN = 2;
1918 MINIMIZED = 3;
1919 DISMISSED = 4;
1920 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001921 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001922}
1923
1924/**
Chenjie Yue8904192017-12-08 19:12:57 -08001925 * Logs overlay action
1926 * Logged from:
1927 * services/core/java/com/android/server/wm/Session.java
1928 */
1929message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001930 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001931
1932 optional string package_name = 2;
1933
1934 optional bool using_alert_window = 3;
1935
1936 enum State {
1937 ENTERED = 1;
1938 EXITED = 2;
1939 }
1940 optional State state = 4;
1941}
1942
Chenjie Yuccfe6452018-01-30 11:33:21 -08001943/*
1944 * Logs foreground service starts and stops.
1945 * Note that this is not when a service starts or stops, but when it is
1946 * considered foreground.
1947 * Logged from
1948 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1949 */
1950message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001951 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001952 // package_name + "/" + class_name
1953 optional string short_name = 2;
1954
1955 enum State {
1956 ENTER = 1;
1957 EXIT = 2;
1958 }
1959 optional State state = 3;
1960}
1961
Chenjie Yue8904192017-12-08 19:12:57 -08001962/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001963 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1964 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1965 * attributed back to the parent (host) uid. One example is Chrome.
1966 *
1967 * Logged from:
1968 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1969 */
1970message IsolatedUidChanged {
1971 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001972 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07001973 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001974 optional int32 parent_uid = 1;
1975
1976 optional int32 isolated_uid = 2;
1977
1978 // We expect an isolated uid to be removed before if it's used for another parent uid.
1979 enum Event {
1980 REMOVED = 0;
1981 CREATED = 1;
1982 }
1983 optional Event event = 3;
1984}
1985
1986/*
1987 * Logs the reception of an incoming network packet causing the main system to wake up for
1988 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1989 * and processed by WakeupController.cpp.
1990 */
1991message PacketWakeupOccurred {
1992 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1993 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001994 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001995 // The interface name on which the packet was received.
1996 optional string iface = 2;
1997 // The ethertype value of the packet.
1998 optional int32 ethertype = 3;
1999 // String representation of the destination MAC address of the packet.
2000 optional string destination_hardware_address = 4;
2001 // String representation of the source address of the packet if this was an IP packet.
2002 optional string source_ip = 5;
2003 // String representation of the destination address of the packet if this was an IP packet.
2004 optional string destination_ip = 6;
2005 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2006 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2007 // families.
2008 optional int32 ip_next_header = 7;
2009 // The source port if this was a TCP or UDP packet.
2010 optional int32 source_port = 8;
2011 // The destination port if this was a TCP or UDP packet.
2012 optional int32 destination_port = 9;
2013}
2014
2015/*
2016 * Logs the memory stats for an app on startup.
2017 * Logged from:
2018 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2019 */
2020message AppStartMemoryStateCaptured {
2021 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002022 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002023
2024 // The process name.
2025 optional string process_name = 2;
2026
2027 // The activity name.
2028 optional string activity_name = 3;
2029
2030 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002031 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002032
2033 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002034 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002035
2036 // RSS
2037 optional int64 rss_in_bytes = 6;
2038
2039 // CACHE
2040 optional int64 cache_in_bytes = 7;
2041
2042 // SWAP
2043 optional int64 swap_in_bytes = 8;
2044}
2045
2046/*
2047 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2048 * for LMK event.
2049 * Logged from:
2050 * system/core/lmkd/lmkd.c
2051 */
2052message LmkStateChanged {
2053 enum State {
2054 UNKNOWN = 0;
2055 START = 1;
2056 STOP = 2;
2057 }
2058 optional State state = 1;
2059}
2060
2061/*
2062 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2063 * Logged from:
2064 * system/core/lmkd/lmkd.c
2065 */
2066message LmkKillOccurred {
2067 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002068 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002069
2070 // The process name.
2071 optional string process_name = 2;
2072
2073 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002074 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002075
2076 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002077 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002078
2079 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002080 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002081
2082 // RSS
2083 optional int64 rss_in_bytes = 6;
2084
2085 // CACHE
2086 optional int64 cache_in_bytes = 7;
2087
2088 // SWAP
2089 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002090
2091 // The elapsed real time of start of the process.
2092 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002093}
2094
Rajeev Kumar51b54602018-03-01 12:18:26 -08002095/*
2096 * Logs when the ActivityManagerService detects that an app died.
2097 *
2098 * Logged from:
2099 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2100 */
2101message AppDied {
2102 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002103 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002104}
2105
Howard Ro21a039c2018-08-06 14:55:47 -07002106/**
2107 * An atom for generic metrics logging. Available from Android Q.
2108 */
2109message GenericAtom {
2110 // The uid of the application that sent this custom atom.
2111 optional int32 uid = 1 [(is_uid) = true];
2112
2113 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002114 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002115}
2116
Tej Singhd6d6d772018-09-05 17:41:25 -07002117/**
2118 * Logs when a fingerprint acquire event occurs.
2119 *
2120 * Logged from:
2121 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2122 */
2123message FingerprintAcquired {
2124 // The associated user. Eg: 0 for owners, 10+ for others.
2125 // Defined in android/os/UserHandle.java
2126 optional int32 user = 1;
2127 // If this acquire is for a crypto fingerprint.
2128 // e.g. Secure purchases, unlock password storage.
2129 optional bool is_crypto = 2;
2130}
2131
2132/**
2133 * Logs when a fingerprint authentication event occurs.
2134 *
2135 * Logged from:
2136 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2137 */
2138message FingerprintAuthenticated {
2139 // The associated user. Eg: 0 for owners, 10+ for others.
2140 // Defined in android/os/UserHandle.java
2141 optional int32 user = 1;
2142 // If this authentication is for a crypto fingerprint.
2143 // e.g. Secure purchases, unlock password storage.
2144 optional bool is_crypto = 2;
2145 // Whether or not this authentication was successful.
2146 optional bool is_authenticated = 3;
2147}
2148
2149/**
2150 * Logs when a fingerprint error occurs.
2151 *
2152 * Logged from:
2153 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2154 */
2155message FingerprintErrorOccurred {
2156 // The associated user. Eg: 0 for owners, 10+ for others.
2157 // Defined in android/os/UserHandle.java
2158 optional int32 user = 1;
2159 // If this error is for a crypto fingerprint.
2160 // e.g. Secure purchases, unlock password storage.
2161 optional bool is_crypto = 2;
2162
2163 enum Error {
2164 UNKNOWN = 0;
2165 LOCKOUT = 1;
2166 PERMANENT_LOCKOUT = 2;
2167 }
2168 // The type of error.
2169 optional Error error = 3;
2170}
Howard Ro688ae182018-09-25 00:09:36 -07002171
2172message Notification {
2173
2174 // Type of notification event.
2175 enum Type {
2176 TYPE_UNKNOWN = 0;
2177 // Notification became visible to the user.
2178 TYPE_OPEN = 1;
2179 // Notification became hidden.
2180 TYPE_CLOSE = 2;
2181 // Notification switched to detail mode.
2182 TYPE_DETAIL = 3;
2183 // Notification was clicked.
2184 TYPE_ACTION = 4;
2185 // Notification was dismissed.
2186 TYPE_DISMISS = 5;
2187 // Notification switched to summary mode. The enum value of 14 is to
2188 // match that of metrics_constants.
2189 TYPE_COLLAPSE = 14;
2190 }
2191 optional Type type = 1;
2192
2193 // Package name associated with the notification.
2194 optional string package_name = 2;
2195
2196 // Tag associated with notification.
2197 optional string tag = 3;
2198
2199 // Application-supplied ID associated with the notification.
2200 optional int32 id = 4;
2201
2202 // Index of notification in the notification panel.
2203 optional int32 shade_index = 5;
2204
2205 // The number of notifications in the notification panel.
2206 optional int32 shade_count = 6;
2207
2208 // Importance for the notification.
2209 optional int32 importance = 7;
2210
2211 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002212 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002213
2214 // Importance for the notification channel.
2215 optional int32 channel_importance = 9;
2216
Howard Ro183c2bd2018-10-18 13:52:10 -07002217 // Application-supplied ID associated with the notifications group.
2218 optional string group_id = 10;
2219
Howard Ro688ae182018-09-25 00:09:36 -07002220 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002221 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002222
Howard Ro183c2bd2018-10-18 13:52:10 -07002223 // Reason for dismissal of a notification. This field is only meaningful for
2224 // TYPE_DISMISS events.
2225 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002226
Howard Ro183c2bd2018-10-18 13:52:10 -07002227 // The first post time of notification, stable across updates.
2228 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002229
Howard Ro183c2bd2018-10-18 13:52:10 -07002230 // The most recent interruption time, or the creation time if no updates.
2231 // Differs from update_millis because updates are filtered based on whether
2232 // they actually interrupted the user.
2233 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002234
Howard Ro183c2bd2018-10-18 13:52:10 -07002235 // The most recent update time, or the creation time if no updates.
2236 optional int64 update_millis = 15;
2237
2238 // The most recent visibility event.
2239 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002240}
2241
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002242/*
Yangster-macb89807e2018-11-15 21:10:57 -08002243 * Logs when a flag flip state changes.
2244 * Logged in P/h.
2245 */
2246message PhenotypeFlagStateChanged {
2247 // Mendel configuration name.
2248 optional string mendel_config_name = 1;
2249 // State
2250 enum State {
2251 STATE_UNKNOWN = 0;
2252 COMMITTED = 1;
2253 }
2254 optional State state = 2;
2255}
2256
2257/*
2258 * Logs when a binary push state changes.
2259 * Logged in Play store
2260 */
2261message BinaryPushStateChanged {
2262 // Binary package name.
2263 optional string binary_name = 1;
2264 // Version code.
2265 optional int64 version = 2;
2266 // State
2267 enum State {
2268 STATE_UNKNOWN = 0;
2269 DOWNLOAD_START = 1;
2270 DOWNLOAD_DONE = 2;
2271 INSTALL_START = 3;
2272 INSTALL_DONE = 4;
2273 REBOOT_START = 5;
2274 REBOOT_DONE = 6;
2275 }
2276 optional State state = 3;
2277}
2278
2279/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002280 * Logs when a connection becomes available and lost.
2281 * Logged in StatsCompanionService.java
2282 */
2283message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002284 // Id of the network.
2285 optional int32 net_id = 1;
2286
2287 enum State {
2288 UNKNOWN = 0;
2289 CONNECTED = 1;
2290 DISCONNECTED = 2;
2291 }
2292 // Connected state of a network.
2293 optional State state = 2;
2294}
2295
2296/**
2297 * Logs when a service starts and stops.
2298 * Logged from:
2299 * services/core/java/com/android/server/am/ActiveServices.java
2300 */
2301message ServiceStateChanged {
2302
2303 optional int32 uid = 1 [(is_uid) = true];
2304
2305 optional string package_name = 2;
2306
2307 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002308
2309 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002310 START = 1;
2311 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002312 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07002313
2314 optional State state = 4;
2315}
2316
2317/**
2318 * Logs when a service is launched.
2319 * Logged from:
2320 * services/core/java/com/android/server/am/ActiveServices.java
2321 */
2322message ServiceLaunchReported {
2323
2324 optional int32 uid = 1 [(is_uid) = true];
2325
2326 optional string package_name = 2;
2327
2328 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002329}
Howard Ro688ae182018-09-25 00:09:36 -07002330
Chenjie Yubbcbc602018-02-05 16:51:52 -08002331//////////////////////////////////////////////////////////////////////
2332// Pulled atoms below this line //
2333//////////////////////////////////////////////////////////////////////
2334
2335/**
David Chenc8a43242017-10-17 16:23:28 -07002336 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2337 *
2338 * Pulled from:
2339 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2340 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002341message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002342 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002343
2344 optional int64 rx_bytes = 2;
2345
2346 optional int64 rx_packets = 3;
2347
2348 optional int64 tx_bytes = 4;
2349
2350 optional int64 tx_packets = 5;
2351}
2352
2353/**
2354 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2355 *
2356 * Pulled from:
2357 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2358 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002359message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002360 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002361
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002362 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2363 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002364
2365 optional int64 rx_bytes = 3;
2366
2367 optional int64 rx_packets = 4;
2368
2369 optional int64 tx_bytes = 5;
2370
2371 optional int64 tx_packets = 6;
2372}
2373
2374/**
2375 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2376 *
2377 * Pulled from:
2378 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2379 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002380message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002381 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002382
2383 optional int64 rx_bytes = 2;
2384
2385 optional int64 rx_packets = 3;
2386
2387 optional int64 tx_bytes = 4;
2388
2389 optional int64 tx_packets = 5;
2390}
2391
2392/**
2393 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2394 *
2395 * Pulled from:
2396 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2397 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002398message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002399 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002400
Yao Chenc40a19d2018-03-15 16:48:25 -07002401 // 1 denotes foreground and 0 denotes background. This is called Set in
2402 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002403 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002404
2405 optional int64 rx_bytes = 3;
2406
2407 optional int64 rx_packets = 4;
2408
2409 optional int64 tx_bytes = 5;
2410
2411 optional int64 tx_packets = 6;
2412}
2413
2414/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002415 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2416 *
2417 * Pulled from:
2418 * StatsCompanionService
2419 */
2420message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002421 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002422
2423 optional int64 rx_bytes = 2;
2424
2425 optional int64 tx_bytes = 3;
2426}
2427
2428/**
David Chenc8a43242017-10-17 16:23:28 -07002429 * Pulls the kernel wakelock durations. This atom is adapted from
2430 * android/internal/os/KernelWakelockStats.java
2431 *
2432 * Pulled from:
2433 * StatsCompanionService using KernelWakelockReader.
2434 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002435message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002436 optional string name = 1;
2437
2438 optional int32 count = 2;
2439
2440 optional int32 version = 3;
2441
Yangster-maca8a30442018-10-13 23:46:34 -07002442 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002443}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002444
Chenjie Yu05013b32017-11-21 10:21:41 -08002445/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002446 * Pulls low power state information. If power.stats HAL is not available, this
2447 * includes platform and subsystem sleep state information,
2448 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
2449 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002450 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002451 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002452 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
2453 * as defined in:
2454 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002455 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002456message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002457 // Subsystem name
2458 optional string subsystem_name = 1;
2459 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2460 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002461 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
2462 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002463 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002464 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002465 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002466 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002467 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002468}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002469
Chenjie Yu05013b32017-11-21 10:21:41 -08002470/**
Bookatz92da2832018-11-01 18:10:03 -07002471 * Pulls on-device power measurement information.
2472 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
2473 * Pulled from:
2474 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
2475 */
2476message OnDevicePowerMeasurement {
2477 // Name of the subsystem (to which the rail belongs).
2478 optional string subsystem_name = 1;
2479
2480 // Rail name. The rail lies within the subsystem.
2481 optional string rail_name = 2;
2482
2483 // Time (in ms since boot) at which the rail energy value was measured.
2484 // This may differ slightly from the time that statsd logs this information.
2485 optional uint64 measurement_timestamp_millis = 3;
2486
2487 // Accumulated energy used via the rail since device boot in uWs.
2488 optional uint64 energy_microwatt_secs = 4;
2489}
2490
2491/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002492 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002493 * Pulls the time the cpu spend on the frequency index. Frequency index
2494 * starts from highest to lowest. The value should be monotonically
2495 * increasing since boot. However, if there is a cpu
2496 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002497 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002498message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002499 optional uint32 cluster = 1;
2500 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002501 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002502}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002503
Chenjie Yu05013b32017-11-21 10:21:41 -08002504/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002505 * Pulls Cpu Time Per Uid.
2506 * Note that isolated process uid time should be attributed to host uids.
2507 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002508message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002509 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002510 optional uint64 user_time_micros = 2;
2511 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002512}
2513
2514/**
2515 * Pulls Cpu Time Per Uid per frequency.
2516 * Note that isolated process uid time should be attributed to host uids.
2517 * For each uid, we order the time by descending frequencies.
2518 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002519message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002520 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002521 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002522 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002523}
Hugo Benichi884970e2017-11-14 22:42:46 +09002524
Chenjie Yu05013b32017-11-21 10:21:41 -08002525/**
2526 * Pulls Wifi Controller Activity Energy Info
2527 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002528message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002529 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002530 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002531 // stack reported state
2532 // TODO: replace this with proto enum
2533 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002534 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002535 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002536 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002537 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002538 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002539 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002540 // product of current(mA), voltage(V) and time(ms)
2541 optional uint64 controller_energy_used = 6;
2542}
2543
2544/**
2545 * Pulls Modem Activity Energy Info
2546 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002547message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002548 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002549 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002550 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002551 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002552 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002553 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002554 /**
2555 * Tx power index
2556 * index 0 = tx_power < 0dBm
2557 * index 1 = 0dBm < tx_power < 5dBm
2558 * index 2 = 5dBm < tx_power < 15dBm
2559 * index 3 = 15dBm < tx_power < 20dBm
2560 * index 4 = tx_power > 20dBm
2561 */
2562 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002563 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002564 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002565 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002566 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002567 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002568 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002569 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002570 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002571 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002572 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002573 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002574 // product of current(mA), voltage(V) and time(ms)
2575 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002576}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002577
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002578/**
2579 * Pulls Bluetooth Activity Energy Info
2580 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2581 */
2582message BluetoothActivityInfo {
2583 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002584 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002585 // bluetooth stack state
2586 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002587 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002588 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002589 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002590 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002591 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002592 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002593 // product of current(mA), voltage(V) and time(ms)
2594 optional uint64 energy_used = 6;
2595}
2596
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002597/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002598 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002599 *
2600 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002601 */
2602message ProcessMemoryState {
2603 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002604 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002605
2606 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002607 // Usually package name, "system" for system server.
2608 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002609 optional string process_name = 2;
2610
Rafal Slawikda51b932018-12-13 16:31:33 +00002611 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07002612 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002613
2614 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002615 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002616
2617 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002618 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002619
Rajeev Kumar90235992018-01-29 11:06:48 -08002620 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002621 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
2622 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08002623 optional int64 rss_in_bytes = 6;
2624
2625 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00002626 // Value is read from memory.stat, field total_cache if per-app memory
2627 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002628 optional int64 cache_in_bytes = 7;
2629
2630 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00002631 // Value is read from memory.stat, field total_swap if per-app memory
2632 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002633 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002634
Rafal Slawikd03ae422018-11-20 11:27:45 +00002635 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002636 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00002637
2638 // Elapsed real time when the process started.
2639 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
2640 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002641}
2642
2643/*
Rafal Slawik08621582018-10-15 14:53:07 +01002644 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00002645 *
2646 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01002647 */
2648message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01002649 // The uid if available. -1 means not available.
2650 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01002651
Rafal Slawikbf67d072018-10-23 11:07:54 +01002652 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002653 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002654 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01002655
Rafal Slawikbf67d072018-10-23 11:07:54 +01002656 // # of page-faults
2657 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002658
Rafal Slawikbf67d072018-10-23 11:07:54 +01002659 // # of major page-faults
2660 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002661
Rafal Slawikbf67d072018-10-23 11:07:54 +01002662 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002663 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002664 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01002665
Rafal Slawikd03ae422018-11-20 11:27:45 +00002666 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002667 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01002668
2669 // Elapsed real time when the process started.
2670 // Value is read from /proc/PID/stat, field 22.
2671 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01002672}
2673
2674/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00002675 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002676 *
2677 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
2678 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00002679 *
2680 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002681 */
2682message ProcessMemoryHighWaterMark {
2683 // The uid if available. -1 means not available.
2684 optional int32 uid = 1 [(is_uid) = true];
2685
Rafal Slawikda51b932018-12-13 16:31:33 +00002686 // The process name.
2687 // Usually package name or process cmdline.
2688 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002689 optional string process_name = 2;
2690
2691 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
2692 // /proc/PID/status.
2693 optional int64 rss_high_water_mark_in_bytes = 3;
2694}
2695
2696/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002697 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002698 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002699message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002700 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002701}
2702
2703/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002704 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002705 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002706message SystemUptime {
2707 // Milliseconds since the system was booted.
2708 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2709 // for external input).
2710 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002711 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002712}
2713
2714/*
2715 * Reads from /proc/uid_concurrent_active_time which has the format:
2716 * active: X (X is # cores)
2717 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2718 * [uid1]: [time-0] [time-1] [time-2] ... ...
2719 * ...
2720 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2721 * The file contains a monotonically increasing count of time for a single boot.
2722 */
2723message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002724 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002725 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002726}
2727
2728/**
2729 * Reads from /proc/uid_concurrent_policy_time which has the format:
2730 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2731 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2732 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2733 * ...
2734 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2735 * The file contains a monotonically increasing count of time for a single boot.
2736 */
2737message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002738 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002739 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002740 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002741}
2742
2743/*
2744 * Pulls free disk space, for data, system partition and temporary directory.
2745 */
2746message DiskSpace {
2747 // available bytes in data partition
2748 optional uint64 data_available_bytes = 1;
2749 // available bytes in system partition
2750 optional uint64 system_available_bytes = 2;
2751 // available bytes in download cache or temp directories
2752 optional uint64 temp_available_bytes = 3;
2753}
Tej Singhbf972d92018-01-10 20:51:13 -08002754
2755/**
2756 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002757 * Pulled from:
2758 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002759 */
2760message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002761 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08002762}
2763
2764/**
2765 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002766 * Pulled from:
2767 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002768 */
2769message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002770 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08002771}
2772
2773/**
Bookatz17f0d8a2018-09-13 12:56:32 -07002774 * Pulls battery voltage.
2775 * Pulled from:
2776 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2777 */
2778message BatteryVoltage {
2779 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07002780 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07002781}
2782
2783/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08002784 * Pulls battery level (percent full, from 0 to 100).
2785 *
2786 * Pulled from:
2787 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2788 */
2789message BatteryLevel {
2790 // Battery level. Should be in [0, 100].
2791 optional int32 battery_level = 1;
2792}
2793
2794/**
Tej Singhd89137e2018-03-26 14:51:40 -07002795 * Pulls the temperature of various parts of the device.
2796 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002797 *
2798 * Pulled from:
2799 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2800 */
2801message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08002802 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08002803 optional android.os.TemperatureTypeEnum sensor_location = 1;
2804
2805 // The name of the temperature source. Eg. CPU0
2806 optional string sensor_name = 2;
2807
Tej Singhd89137e2018-03-26 14:51:40 -07002808 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08002809 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07002810 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08002811}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002812
2813/**
2814 * Pulls the statistics of calls to Binder.
2815 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01002816 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
2817 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002818 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002819 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002820 */
2821message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002822 // UID of the process responsible for the binder transaction. It will be set if the process
2823 // executing the binder transaction attribute the transaction to another uid using
2824 // Binder.setThreadWorkSource().
2825 //
2826 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002827 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002828 // UID of the process executing the binder transaction.
2829 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002830 // Fully qualified class name of the API call.
2831 //
2832 // This is a system server class name.
2833 //
2834 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
2835 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
2836 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
2837 // commonly used APIs.
2838 optional string service_class_name = 2;
2839 // Method name of the API call. It can also be a transaction code if we cannot
2840 // resolve it to a name. See Binder#getTransactionName.
2841 //
2842 // This is a system server method name.
2843 optional string service_method_name = 3;
2844 // Total number of API calls.
2845 optional int64 call_count = 4;
2846 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2847 optional bool screen_interactive = 13;
2848 // Total number of API calls we have data recorded for. If we collected data for all the calls,
2849 // call_count will be equal to recorded_call_count.
2850 //
2851 // If recorded_call_count is different than call_count, it means data collection has been
2852 // sampled. All the fields below will be sampled in this case.
2853 optional int64 recorded_call_count = 12;
2854 // Number of exceptions thrown by the API.
2855 optional int64 recorded_exception_count = 5;
2856 // Total latency of all API calls.
2857 // Average can be computed using total_latency_micros / recorded_call_count.
2858 optional int64 recorded_total_latency_micros = 6;
2859 // Maximum latency of one API call.
2860 optional int64 recorded_max_latency_micros = 7;
2861 // Total CPU usage of all API calls.
2862 // Average can be computed using total_cpu_micros / recorded_call_count.
2863 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
2864 optional int64 recorded_total_cpu_micros = 8;
2865 // Maximum CPU usage of one API call.
2866 optional int64 recorded_max_cpu_micros = 9;
2867 // Maximum parcel reply size of one API call.
2868 optional int64 recorded_max_reply_size_bytes = 10;
2869 // Maximum parcel request size of one API call.
2870 optional int64 recorded_max_request_size_bytes = 11;
2871}
2872
2873/**
2874 * Pulls the statistics of exceptions during calls to Binder.
2875 *
2876 * Binder stats are cumulative from boot unless somebody reset the data using
2877 * > adb shell dumpsys binder_calls_stats --reset
2878 */
2879message BinderCallsExceptions {
2880 // Exception class name, e.g. java.lang.IllegalArgumentException.
2881 //
2882 // This is an exception class name thrown by the system server.
2883 optional string exception_class_name = 1;
2884 // Total number of exceptions.
2885 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002886}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002887
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002888/**
2889 * Pulls the statistics of message dispatching on HandlerThreads.
2890 *
2891 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
2892 * config on the device.
2893 *
2894 * Next tag: 11
2895 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002896message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01002897 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002898 optional int32 uid = 1 [(is_uid) = true];
2899
2900 // Fully qualified class name of the handler target class.
2901 //
2902 // This field does not contain PII. This is a system server class name.
2903 optional string handler_class_name = 2;
2904
2905 // The name of the thread that runs the Looper.
2906 //
2907 // This field does not contain PII. This is a system server thread name.
2908 optional string looper_thread_name = 3;
2909
2910 // The name of the dispatched message.
2911 //
2912 // This field does not contain PII. This is a system server constant or class
2913 // name.
2914 optional string message_name = 4;
2915
2916 // Total number of successfully dispatched messages.
2917 optional int64 message_count = 5;
2918
2919 // Total number of messages that failed dispatching.
2920 optional int64 exception_count = 6;
2921
2922 // Total number of processed messages we have data recorded for. If we
2923 // collected data for all the messages, message_count will be equal to
2924 // recorded_message_count.
2925 //
2926 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01002927 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002928 optional int64 recorded_message_count = 7;
2929
2930 // Total latency of all processed messages.
2931 // Average can be computed using recorded_total_latency_micros /
2932 // recorded_message_count.
2933 optional int64 recorded_total_latency_micros = 8;
2934
2935 // Total CPU usage of all processed message.
2936 // Average can be computed using recorded_total_cpu_micros /
2937 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002938 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002939 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002940
2941 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2942 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01002943
2944 // Max recorded CPU usage of all processed messages.
2945 optional int64 recorded_max_cpu_micros = 11;
2946
2947 // Max recorded latency of all processed messages.
2948 optional int64 recorded_max_latency_micros = 12;
2949
2950 // Total number of messages we tracked the dispatching delay for. If we
2951 // collected data for all the messages, message_count will be equal to
2952 // recorded_delay_message_count.
2953 //
2954 // If recorded_delay_message_count is different than message_count, it means data
2955 // collection has been sampled or/and not all messages specified the target dispatch time.
2956 // The fields below will be sampled in this case.
2957 optional int64 recorded_delay_message_count = 13;
2958
2959 // Total dispatching delay of all processed messages.
2960 // Calculated as a difference between the target dispatching time (Message.when)
2961 // and the actual dispatching time.
2962 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
2963 optional int64 recorded_total_delay_millis = 14;
2964
2965 // Max dispatching delay of all processed messages.
2966 // Calculated as a difference between the target dispatching time (Message.when)
2967 // and the actual dispatching time.
2968 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002969}
Tej Singh86dc9db2018-09-06 00:39:57 +00002970
2971/**
2972 * Pulls disk information, such as write speed and latency.
2973 */
2974message DiskStats {
2975 // Time taken to open, write 512B to, and close a file.
2976 // -1 if error performing the check.
2977 optional int64 data_write_latency_millis = 1;
2978
2979 optional bool file_based_encryption = 2;
2980
2981 // Recent disk write speed in kB/s.
2982 // -1 if error querying storageed.
2983 // 0 if data is unavailable.
2984 optional int32 recent_disk_write_speed = 3;
2985}
2986
2987
2988/**
2989 * Free and total bytes of the Data, Cache, and System partition.
2990 */
2991message DirectoryUsage {
2992 enum Directory {
2993 UNKNOWN = 0;
2994 DATA = 1;
2995 CACHE = 2;
2996 SYSTEM = 3;
2997 }
2998 optional Directory directory = 1;
2999 optional int64 free_bytes = 2;
3000 optional int64 total_bytes = 3;
3001}
3002
3003
3004/**
3005 * Size of an application: apk size, data size, and cache size.
3006 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3007 * Information is only reported for apps with the primary user (user 0).
3008 * Sizes are aggregated by package name.
3009 */
3010message AppSize {
3011 // Including uids will involve modifying diskstats logic.
3012 optional string package_name = 1;
3013 // App size in bytes. -1 if unavailable.
3014 optional int64 app_size_bytes = 2;
3015 // App data size in bytes. -1 if unavailable.
3016 optional int64 app_data_size_bytes = 3;
3017 // App cache size in bytes. -1 if unavailable.
3018 optional int64 app_cache_size_bytes = 4;
3019 // Time that the cache file was produced.
3020 // Uses System.currentTimeMillis(), which is wall clock time.
3021 optional int64 cache_time_millis = 5;
3022}
3023
3024
3025/**
3026 * Size of a particular category. Eg: photos, videos.
3027 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3028 */
3029message CategorySize {
3030 enum Category {
3031 UNKNOWN = 0;
3032 APP_SIZE = 1;
3033 APP_DATA_SIZE = 2;
3034 APP_CACHE_SIZE = 3;
3035 PHOTOS = 4;
3036 VIDEOS = 5;
3037 AUDIO = 6;
3038 DOWNLOADS = 7;
3039 SYSTEM = 8;
3040 OTHER = 9;
3041 }
3042 optional Category category = 1;
3043 // Category size in bytes.
3044 optional int64 size_bytes = 2;
3045 // Time that the cache file was produced.
3046 // Uses System.currentTimeMillis(), which is wall clock time.
3047 optional int64 cache_time_millis = 3;
3048}
Tej Singhd6d6d772018-09-05 17:41:25 -07003049
3050/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003051 * Pulls per uid I/O stats. The stats are cumulative since boot.
3052 *
3053 * Read/write bytes are I/O events from a storage device
3054 * Read/write chars are data requested by read/write syscalls, and can be
3055 * satisfied by caching.
3056 *
3057 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3058 */
3059message DiskIo {
3060 optional int32 uid = 1 [(is_uid) = true];
3061 optional int64 fg_chars_read = 2;
3062 optional int64 fg_chars_write = 3;
3063 optional int64 fg_bytes_read = 4;
3064 optional int64 fg_bytes_write = 5;
3065 optional int64 bg_chars_read = 6;
3066 optional int64 bg_chars_write = 7;
3067 optional int64 bg_bytes_read = 8;
3068 optional int64 bg_bytes_write = 9;
3069 optional int64 fg_fsync = 10;
3070 optional int64 bg_fsync= 11;
3071}
3072
3073
3074/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003075 * Pulls the number of fingerprints for each user.
3076 *
3077 * Pulled from StatsCompanionService, which queries FingerprintManager.
3078 */
3079message NumFingerprints {
3080 // The associated user. Eg: 0 for owners, 10+ for others.
3081 // Defined in android/os/UserHandle.java
3082 optional int32 user = 1;
3083 // Number of fingerprints registered to that user.
3084 optional int32 num_fingerprints = 2;
3085}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003086
Yangsteraf9aee72018-10-12 09:26:16 -07003087message AggStats {
3088 optional int64 min = 1;
3089
3090 optional int64 average = 2;
3091
3092 optional int64 max = 3;
3093}
3094
3095message ProcessStatsStateProto {
3096 optional android.service.procstats.ScreenState screen_state = 1;
3097
3098 optional android.service.procstats.MemoryState memory_state = 2;
3099
3100 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3101 // and not frameworks/base/core/java/android/app/ActivityManager.java
3102 optional android.service.procstats.ProcessState process_state = 3;
3103
3104 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003105 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003106
3107 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003108 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003109
3110 // # of samples taken
3111 optional int32 sample_size = 5;
3112
3113 // PSS is memory reserved for this process
3114 optional AggStats pss = 6;
3115
3116 // USS is memory shared between processes, divided evenly for accounting
3117 optional AggStats uss = 7;
3118
3119 // RSS is memory resident for this process
3120 optional AggStats rss = 8;
3121}
3122
3123// Next Tag: 7
3124message ProcessStatsProto {
3125 // Name of process.
3126 optional string process = 1;
3127
3128 // Uid of the process.
3129 optional int32 uid = 2;
3130
3131 // Information about how often kills occurred
3132 message Kill {
3133 // Count of excessive CPU kills
3134 optional int32 cpu = 1;
3135
3136 // Count of kills when cached
3137 optional int32 cached = 2;
3138
3139 // PSS stats during cached kill
3140 optional AggStats cached_pss = 3;
3141 }
3142 optional Kill kill = 3;
3143
3144 // Time and memory spent in various states.
3145 repeated ProcessStatsStateProto states = 5;
3146
3147 // Total time process has been running... screen_state, memory_state, and process_state
3148 // will not be set.
3149 optional ProcessStatsStateProto total_running_state = 6;
3150}
3151
3152message PackageServiceOperationStatsProto {
3153 // Operate enum: Started, Foreground, Bound, Executing
3154 optional android.service.procstats.ServiceOperationState operation = 1;
3155
3156 // Number of times the service was in this operation.
3157 optional int32 count = 2;
3158
3159 // Information about a state the service can be in.
3160 message StateStats {
3161 // Screen state enum.
3162 optional android.service.procstats.ScreenState screen_state = 1;
3163 // Memory state enum.
3164 optional android.service.procstats.MemoryState memory_state = 2;
3165
3166 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07003167 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003168 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003169 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003170 }
3171 repeated StateStats state_stats = 3;
3172}
3173
3174message PackageServiceStatsProto {
3175 // Name of service component.
3176 optional string service_name = 1;
3177
3178 // The operation stats.
3179 // The package_name, package_uid, package_version, service_name will not be set to save space.
3180 repeated PackageServiceOperationStatsProto operation_stats = 2;
3181}
3182
3183message PackageAssociationSourceProcessStatsProto {
3184 // Uid of the process.
3185 optional int32 process_uid = 1;
3186 // Process name.
3187 optional string process_name = 2;
3188
3189 // Total count of the times this association appeared.
3190 optional int32 total_count = 3;
3191
3192 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07003193 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003194
3195 // Total count of the times this association became actively impacting its target process.
3196 optional int32 active_count = 5;
3197
3198 // Information on one source in this association.
3199 message StateStats {
3200 // Process state enum.
3201 optional android.service.procstats.ProcessState process_state = 1;
3202 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003203 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003204 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003205 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003206 }
3207 repeated StateStats active_state_stats = 6;
3208}
3209
3210message PackageAssociationProcessStatsProto {
3211 // Name of the target component.
3212 optional string component_name = 1;
3213 // Information on one source in this association.
3214 repeated PackageAssociationSourceProcessStatsProto sources = 2;
3215}
3216
3217
3218message ProcessStatsPackageProto {
3219 // Name of package.
3220 optional string package = 1;
3221
3222 // Uid of the package.
3223 optional int32 uid = 2;
3224
3225 // Version of the package.
3226 optional int64 version = 3;
3227
3228 // Stats for each process running with the package loaded in to it.
3229 repeated ProcessStatsProto process_stats = 4;
3230
3231 // Stats for each of the package's services.
3232 repeated PackageServiceStatsProto service_stats = 5;
3233
3234 // Stats for each association with the package.
3235 repeated PackageAssociationProcessStatsProto association_stats = 6;
3236}
3237
3238message ProcessStatsSectionProto {
3239 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003240 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07003241
3242 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003243 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003244
3245 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003246 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003247
3248 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003249 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003250
3251 // System runtime library. e.g. "libdvm.so", "libart.so".
3252 optional string runtime = 5;
3253
3254 // whether kernel reports swapped pss.
3255 optional bool has_swapped_pss = 6;
3256
3257 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
3258 enum Status {
3259 STATUS_UNKNOWN = 0;
3260 STATUS_COMPLETE = 1;
3261 STATUS_PARTIAL = 2;
3262 STATUS_SHUTDOWN = 3;
3263 STATUS_SYSPROPS = 4;
3264 }
3265 repeated Status status = 7;
3266
3267 // Stats for each process.
3268 repeated ProcessStatsProto process_stats = 8;
3269
3270 // Stats for each package.
3271 repeated ProcessStatsPackageProto package_stats = 9;
3272}
3273
Chenjie Yu12e5e672018-09-14 15:54:59 -07003274/**
3275 * Pulled from ProcessStatsService.java
3276 */
3277message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07003278 optional ProcessStatsSectionProto proc_stats_section = 1;
3279}
3280
Chenjie Yuf910b7802019-01-11 16:08:20 -08003281/**
3282 * Pulled from ProcessStatsService.java
3283 */
3284message ProcStatsPkgProc {
3285 optional ProcessStatsSectionProto proc_stats_section = 1;
3286}
3287
Yangsteraf9aee72018-10-12 09:26:16 -07003288message PowerProfileProto {
3289 optional double cpu_suspend = 1;
3290
3291 optional double cpu_idle = 2;
3292
3293 optional double cpu_active = 3;
3294
3295 message CpuCluster {
3296 optional int32 id = 1;
3297 optional double cluster_power = 2;
3298 optional int32 cores = 3;
3299 repeated int64 speed = 4;
3300 repeated double core_power = 5;
3301 }
3302
3303 repeated CpuCluster cpu_cluster = 40;
3304
3305 optional double wifi_scan = 4;
3306
3307 optional double wifi_on = 5;
3308
3309 optional double wifi_active = 6;
3310
3311 optional double wifi_controller_idle = 7;
3312
3313 optional double wifi_controller_rx = 8;
3314
3315 optional double wifi_controller_tx = 9;
3316
3317 repeated double wifi_controller_tx_levels = 10;
3318
3319 optional double wifi_controller_operating_voltage = 11;
3320
3321 optional double bluetooth_controller_idle = 12;
3322
3323 optional double bluetooth_controller_rx = 13;
3324
3325 optional double bluetooth_controller_tx = 14;
3326
3327 optional double bluetooth_controller_operating_voltage = 15;
3328
3329 optional double modem_controller_sleep = 16;
3330
3331 optional double modem_controller_idle = 17;
3332
3333 optional double modem_controller_rx = 18;
3334
3335 repeated double modem_controller_tx = 19;
3336
3337 optional double modem_controller_operating_voltage = 20;
3338
3339 optional double gps_on = 21;
3340
3341 repeated double gps_signal_quality_based = 22;
3342
3343 optional double gps_operating_voltage = 23;
3344
3345 optional double bluetooth_on = 24;
3346
3347 optional double bluetooth_active = 25;
3348
3349 optional double bluetooth_at_cmd = 26;
3350
3351 optional double ambient_display = 27;
3352
3353 optional double screen_on = 28;
3354
3355 optional double radio_on = 29;
3356
3357 optional double radio_scanning = 30;
3358
3359 optional double radio_active = 31;
3360
3361 optional double screen_full = 32;
3362
3363 optional double audio = 33;
3364
3365 optional double video = 34;
3366
3367 optional double flashlight = 35;
3368
3369 optional double memory = 36;
3370
3371 optional double camera = 37;
3372
3373 optional double wifi_batched_scan = 38;
3374
3375 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003376}
Chenjie Yuab530202018-09-26 12:39:20 -07003377
3378/**
3379 * power_profile.xml and other constants for power model calculations.
3380 * Pulled from PowerProfile.java
3381 */
3382message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003383 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003384}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003385
3386/**
arangelovd5db50e2018-10-12 20:24:39 +01003387 * Logs when a user restriction was added or removed.
3388 *
3389 * Logged from:
3390 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3391 */
3392message UserRestrictionChanged {
3393 // The raw string of the user restriction as defined in UserManager.
3394 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3395 optional string restriction = 1;
3396 // Whether the restriction is enabled or disabled.
3397 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07003398}
Yangster-mac308ea0c2018-10-22 13:10:25 -07003399
3400/**
3401 * Pulls process user time and system time. Puller takes a snapshot of all pids
3402 * in the system and returns cpu stats for those that are working at the time.
3403 * Dead pids will be dropped. Kernel processes are excluded.
3404 * Min cool-down is 5 sec.
3405 */
3406message ProcessCpuTime {
3407 optional int32 uid = 1 [(is_uid) = true];
3408
3409 optional string process_name = 2;
3410 // Process cpu time in user space, cumulative from boot/process start
3411 optional int64 user_time_millis = 3;
3412 // Process cpu time in system space, cumulative from boot/process start
3413 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01003414}
Misha Wagner5a51e002018-10-03 15:04:09 +01003415
3416/**
3417 * Pulls the CPU usage for each thread.
3418 *
3419 * Read from /proc/$PID/task/$TID/time_in_state files.
3420 *
3421 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
3422 * time_in_state files not being present on some phones, have not been addressed. These should be
3423 * considered before a public release.
3424 */
3425message CpuTimePerThreadFreq {
3426 // UID that owns the process.
3427 optional int32 uid = 1 [(is_uid) = true];
3428 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003429 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01003430 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003431 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01003432 // Name of the process taken from `/proc/$PID/cmdline`.
3433 optional string process_name = 4;
3434 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
3435 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00003436
3437 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
3438 // are given in KHz, and time is given in milliseconds since the thread started. All eight
3439 // frequencies are given here as the alternative is sending eight separate atoms. This method
3440 // significantly reduces the amount of data created
3441 optional int32 frequency1_khz = 6;
3442 optional int32 time1_millis = 7;
3443 optional int32 frequency2_khz = 8;
3444 optional int32 time2_millis = 9;
3445 optional int32 frequency3_khz = 10;
3446 optional int32 time3_millis = 11;
3447 optional int32 frequency4_khz = 12;
3448 optional int32 time4_millis = 13;
3449 optional int32 frequency5_khz = 14;
3450 optional int32 time5_millis = 15;
3451 optional int32 frequency6_khz = 16;
3452 optional int32 time6_millis = 17;
3453 optional int32 frequency7_khz = 18;
3454 optional int32 time7_millis = 19;
3455 optional int32 frequency8_khz = 20;
3456 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01003457}
Bookatz75ee60422018-11-09 12:27:37 -08003458
3459/**
Bookatz366a4432018-11-20 09:42:33 -08003460 * Pulls information about the device's build.
3461 */
3462message BuildInformation {
3463 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
3464 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
3465 optional string fingerprint = 1;
3466
3467 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
3468 optional string brand = 2;
3469
3470 // Build.PRODUCT. The name of the overall product.
3471 optional string product = 3;
3472
3473 // Build.DEVICE. The name of the industrial design.
3474 optional string device = 4;
3475
3476 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
3477 optional string version_release = 5;
3478
3479 // Build.ID. E.g. a label like "M4-rc20".
3480 optional string id = 6;
3481
3482 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
3483 // represent this build.
3484 optional string version_incremental = 7;
3485
3486 // Build.TYPE. The type of build, like "user" or "eng".
3487 optional string type = 8;
3488
3489 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
3490 optional string tags = 9;
3491}
3492
3493/**
Bookatz75ee60422018-11-09 12:27:37 -08003494 * Pulls on-device BatteryStats power use calculations for the overall device.
3495 */
3496message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08003497 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3498 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3499 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
3500 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08003501}
3502
3503/**
3504 * Pulls on-device BatteryStats power use calculations broken down by uid.
3505 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
3506 * that is attributed to non-uid items. They must all be included to get the total power use.
3507 */
3508message DeviceCalculatedPowerBlameUid {
3509 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
3510 optional int32 uid = 1 [(is_uid) = true];
3511
Bookatz3dbc13a2018-12-21 12:16:51 -08003512 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3513 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3514 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08003515}
3516
3517/**
3518 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
3519 * drain type.
3520 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
3521 * is attributed uids. They must all be included to get the total power use.
3522 */
3523message DeviceCalculatedPowerBlameOther {
3524 // The type of item whose power use is being reported.
3525 enum DrainType {
3526 AMBIENT_DISPLAY = 0;
3527 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
3528 BLUETOOTH = 2;
3529 CAMERA = 3;
3530 // Cell-standby
3531 CELL = 4;
3532 FLASHLIGHT = 5;
3533 IDLE = 6;
3534 MEMORY = 7;
3535 // Amount that total computed drain exceeded the drain estimated using the
3536 // battery level changes and capacity.
3537 OVERCOUNTED = 8;
3538 PHONE = 9;
3539 SCREEN = 10;
3540 // Amount that total computed drain was below the drain estimated using the
3541 // battery level changes and capacity.
3542 UNACCOUNTED = 11;
3543 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
3544 WIFI = 13;
3545 }
3546 optional DrainType drain_type = 1;
3547
Bookatz3dbc13a2018-12-21 12:16:51 -08003548 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3549 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3550 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00003551}
arangelov4e994062018-11-13 16:12:38 +00003552
3553/**
3554 * Logs device policy features.
3555 *
3556 * Logged from:
3557 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3558 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
3559 */
3560message DevicePolicyEvent {
3561 // The event id - unique for each event.
3562 optional android.stats.devicepolicy.EventId event_id = 1;
3563 // The admin package name.
3564 optional string admin_package_name = 2;
3565 // A generic integer parameter.
3566 optional int32 integer_value = 3;
3567 // A generic boolean parameter.
3568 optional bool boolean_value = 4;
3569 // A parameter specifying a time period in milliseconds.
3570 optional uint64 time_period_millis = 5;
3571 // A parameter specifying a list of package names, bundle extras or string parameters.
3572 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
3573}
shawnlinea5b66b2018-11-13 15:05:29 +08003574
3575/**
3576 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
3577 *
3578 * Logged from:
3579 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3580 */
3581message DocsUILaunchReported {
3582 optional android.stats.docsui.LaunchAction launch_action = 1;
3583 optional bool has_initial_uri = 2;
3584 optional android.stats.docsui.MimeType mime_type = 3;
3585 optional android.stats.docsui.Root initial_root = 4;
3586}
3587
3588/**
3589 * Logs root/app visited event in file managers/picker. Call this when the user
3590 * taps on root/app in hamburger menu.
3591 *
3592 * Logged from:
3593 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3594 */
3595message DocsUIRootVisitedReported {
3596 optional android.stats.docsui.ContextScope scope = 1;
3597 optional android.stats.docsui.Root root = 2;
3598}
3599
3600/**
3601 * Logs file operation stats. Call this when a file operation has completed.
3602 *
3603 * Logged from:
3604 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3605 */
3606message DocsUIFileOperationReported {
3607 optional android.stats.docsui.Provider provider = 1;
3608 optional android.stats.docsui.FileOperation file_op = 2;
3609}
3610
3611/**
3612 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
3613 * mode.
3614 *
3615 * Logged from:
3616 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3617 */
3618message DocsUIFileOperationCopyMoveModeReported {
3619 optional android.stats.docsui.FileOperation file_op = 1;
3620 optional android.stats.docsui.CopyMoveOpMode mode = 2;
3621}
3622
3623
3624/**
3625 * Logs file sub operation stats. Call this when a file operation has failed.
3626 *
3627 * Logged from:
3628 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3629 */
3630message DocsUIFileOperationFailureReported {
3631 optional android.stats.docsui.Authority authority = 1;
3632 optional android.stats.docsui.SubFileOperation sub_op = 2;
3633}
3634
3635/**
3636* Logs the cancellation of a file operation. Call this when a job is canceled
3637*
3638* Logged from:
3639* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3640*/
3641message DocsUIFileOperationCanceledReported {
3642 optional android.stats.docsui.FileOperation file_op = 1;
3643}
3644
3645/**
3646 * Logs startup time in milliseconds.
3647 *
3648 * Logged from:
3649 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3650 */
3651message DocsUIStartupMsReported {
3652 optional int32 startup_millis = 1;
3653}
3654
3655/**
3656 * Logs the action that was started by user.
3657 *
3658 * Logged from:
3659 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3660 */
3661message DocsUIUserActionReported {
3662 optional android.stats.docsui.UserAction action = 1;
3663}
3664
3665/**
3666 * Logs the invalid type when invalid scoped access is requested.
3667 *
3668 * Logged from:
3669 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
3670 */
3671message DocsUIInvalidScopedAccessRequestReported {
3672 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00003673}
Ben Murdochbab399f62018-12-06 11:01:38 +00003674
3675/**
shawnlina75e82d2019-01-07 10:31:12 +08003676 * Logs the package name that launches docsui picker mode.
3677 *
3678 * Logged from:
3679 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3680 */
3681message DocsUIPickerLaunchedFromReported {
3682 optional string package_name = 1;
3683}
3684
3685/**
3686 * Logs the search type.
3687 *
3688 * Logged from:
3689 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3690 */
3691message DocsUISearchTypeReported {
3692 optional android.stats.docsui.SearchType search_type = 1;
3693}
3694
3695/**
3696 * Logs the search mode.
3697 *
3698 * Logged from:
3699 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3700 */
3701message DocsUISearchModeReported {
3702 optional android.stats.docsui.SearchMode search_mode = 1;
3703}
3704
3705/**
3706 * Logs the pick result information.
3707 *
3708 * Logged from:
3709 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3710 */
3711message DocsUIPickResultReported {
3712 optional int32 total_action_count = 1;
3713 optional int64 duration_millis = 2;
3714 optional int32 file_count= 3;
3715 optional bool is_searching = 4;
3716 optional android.stats.docsui.Root picked_from = 5;
3717 optional android.stats.docsui.MimeType mime_type = 6;
3718 optional int32 repeatedly_pick_times = 7;
3719}
3720
3721/**
Ben Murdochbab399f62018-12-06 11:01:38 +00003722 * Logs when an app's memory is compacted.
3723 *
3724 * Logged from:
3725 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3726 */
3727message AppCompacted {
3728 // The pid of the process being compacted.
3729 optional int32 pid = 1;
3730
3731 // The name of the process being compacted.
3732 optional string process_name = 2;
3733
3734 // The type of compaction.
3735 enum Action {
3736 UNKNOWN = 0;
3737 SOME = 1;
3738 FULL = 2;
3739 }
Ben Murdoch01720b82018-12-19 18:03:44 +00003740 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00003741
3742 // Total RSS in kilobytes consumed by the process prior to compaction.
3743 optional int64 before_rss_total_kilobytes = 4;
3744
3745 // File RSS in kilobytes consumed by the process prior to compaction.
3746 optional int64 before_rss_file_kilobytes = 5;
3747
3748 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
3749 optional int64 before_rss_anon_kilobytes = 6;
3750
3751 // Swap in kilobytes consumed by the process prior to compaction.
3752 optional int64 before_swap_kilobytes = 7;
3753
3754 // Total RSS in kilobytes consumed by the process after compaction.
3755 optional int64 after_rss_total_kilobytes = 8;
3756
3757 // File RSS in kilobytes consumed by the process after compaction.
3758 optional int64 after_rss_file_kilobytes = 9;
3759
3760 // Anonymous RSS in kilobytes consumed by the process after compaction.
3761 optional int64 after_rss_anon_kilobytes = 10;
3762
3763 // Swap in kilobytes consumed by the process after compaction.
3764 optional int64 after_swap_kilobytes = 11;
3765
3766 // The time taken to perform compaction in milliseconds.
3767 optional int64 time_to_compact_millis = 12;
3768
3769 // The last compaction action performed for this app.
3770 optional Action last_action = 13;
3771
Ben Murdoch01720b82018-12-19 18:03:44 +00003772 // The last time that compaction was attempted on this process in milliseconds
3773 // since boot, not including sleep (see SystemClock.uptimeMillis()).
3774 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00003775
Ben Murdoch01720b82018-12-19 18:03:44 +00003776 // The oom_score_adj at the time of compaction.
3777 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00003778
3779 // The process state at the time of compaction.
3780 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
3781}
lifr157fc552018-12-12 16:38:04 +08003782
3783/**
3784 * Logs the latency period(in microseconds) and the return code of
3785 * the DNS(Domain Name System) lookups.
3786 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
3787 * to get info(address or hostname) from DNS server(or DNS cache).
3788 * Logged from:
3789 * /system/netd/server/DnsProxyListener.cpp
3790 */
3791message NetworkDnsEventReported {
3792 // The types of the DNS lookups, as defined in
3793 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
3794 enum EventType {
3795 EVENT_UNKNOWN = 0;
3796 EVENT_GETADDRINFO = 1;
3797 EVENT_GETHOSTBYNAME = 2;
3798 EVENT_GETHOSTBYADDR = 3;
3799 EVENT_RES_NSEND = 4;
3800 }
3801 optional EventType event_type = 1;
3802
3803 // The return value of the DNS resolver for each DNS lookups.
3804 //bionic/libc/include/netdb.h
3805 //system/netd/resolv/include/netd_resolv/resolv.h
3806 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08003807 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08003808 EAI_ADDRFAMILY = 1;
3809 EAI_AGAIN = 2;
3810 EAI_BADFLAGS = 3;
3811 EAI_FAIL = 4;
3812 EAI_FAMILY = 5;
3813 EAI_MEMORY = 6;
3814 EAI_NODATA = 7;
3815 EAI_NONAME = 8;
3816 EAI_SERVICE = 9;
3817 EAI_SOCKTYPE = 10;
3818 EAI_SYSTEM = 11;
3819 EAI_BADHINTS = 12;
3820 EAI_PROTOCOL = 13;
3821 EAI_OVERFLOW = 14;
3822 RESOLV_TIMEOUT = 255;
3823 EAI_MAX = 256;
3824 }
3825 optional ReturnCode return_code = 2;
3826
3827 // The latency period(in microseconds) it took for this DNS lookup to complete.
3828 optional int32 latency_micros = 3;
3829}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08003830
3831/**
3832 * Logs when a data stall event occurs.
3833 *
3834 * Log from:
3835 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
3836 */
3837message DataStallEvent {
3838 // Data stall evaluation type.
3839 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
3840 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
3841 optional int32 evaluation_type = 1;
3842 // See definition in data_stall_event.proto.
3843 optional com.android.server.connectivity.ProbeResult validation_result = 2;
3844 // See definition in data_stall_event.proto.
3845 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
3846 // See definition in data_stall_event.proto.
3847 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
3848 // See definition in data_stall_event.proto.
3849 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
3850 // See definition in data_stall_event.proto.
3851 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
3852}
Christian Brunschenf86039e2018-12-21 12:26:14 +00003853
3854/*
3855 * Logs when RescueParty resets some set of experiment flags.
3856 *
3857 * Logged from:
3858 * frameworks/base/services/core/java/com/android/server/RescueParty.java
3859 */
3860message RescuePartyResetReported {
3861 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
3862 optional int32 rescue_level = 1;
3863}
Mathew Inwoodb375be52019-01-04 11:36:25 +00003864
3865/**
3866 * Logs when signed config is received from an APK, and if that config was applied successfully.
3867 * Logged from:
3868 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
3869 */
3870message SignedConfigReported {
3871 enum Type {
3872 UNKNOWN_TYPE = 0;
3873 GLOBAL_SETTINGS = 1;
3874 }
3875 optional Type type = 1;
3876
3877 // The final status of the signed config received.
3878 enum Status {
3879 UNKNOWN_STATUS = 0;
3880 APPLIED = 1;
3881 BASE64_FAILURE_CONFIG = 2;
3882 BASE64_FAILURE_SIGNATURE = 3;
3883 SECURITY_EXCEPTION = 4;
3884 INVALID_CONFIG = 5;
3885 OLD_CONFIG = 6;
3886 SIGNATURE_CHECK_FAILED = 7;
3887 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00003888 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00003889 }
3890 optional Status status = 2;
3891
3892 // The version of the signed config processed.
3893 optional int32 version = 3;
3894
3895 // The package name that the config was extracted from.
3896 optional string from_package = 4;
3897
3898 enum Key {
3899 NO_KEY = 0;
3900 DEBUG = 1;
3901 PRODUCTION = 2;
3902 }
3903 // Which key was used to verify the config.
3904 optional Key verified_with = 5;
3905}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08003906
3907/*
3908 * Logs GNSS Network-Initiated (NI) location events.
3909 *
3910 * Logged from:
3911 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
3912 */
3913message GnssNiEventReported {
3914 // The type of GnssNiEvent.
3915 enum EventType {
3916 UNKNOWN = 0;
3917 NI_REQUEST = 1;
3918 NI_RESPONSE = 2;
3919 }
3920 optional EventType event_type = 1;
3921
3922 // An ID generated by HAL to associate NI notifications and UI responses.
3923 optional int32 notification_id = 2;
3924
3925 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
3926 optional int32 ni_type = 3;
3927
3928 // NI requires notification.
3929 optional bool need_notify = 4;
3930
3931 // NI requires verification.
3932 optional bool need_verify = 5;
3933
3934 // NI requires privacy override, no notification/minimal trace.
3935 optional bool privacy_override = 6;
3936
3937 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
3938 // seconds.
3939 optional int32 timeout = 7;
3940
3941 // Default response when timeout.
3942 optional int32 default_response = 8;
3943
3944 // String representing the requester of the network inititated location request.
3945 optional string requestor_id = 9;
3946
3947 // Notification message text string representing the service(for eg. SUPL-service) who sent the
3948 // network initiated location request.
3949 optional string text = 10;
3950
3951 // requestorId decoding scheme.
3952 optional int32 requestor_id_encoding = 11;
3953
3954 // Notification message text decoding scheme.
3955 optional int32 text_encoding = 12;
3956
3957 // True if SUPL ES is enabled.
3958 optional bool is_supl_es_enabled = 13;
3959
3960 // True if GNSS location is enabled.
3961 optional bool is_location_enabled = 14;
3962
3963 // GNSS NI responses which define the response in NI structures.
3964 optional int32 user_response = 15;
3965}