blob: 66127c95d1c2ed287436b582355f8e1e37afc8d5 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Fan Zhangf837b8e2018-10-23 12:38:30 -070025import "frameworks/base/core/proto/android/app/settings_enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070026import "frameworks/base/core/proto/android/app/job/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080027import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080028import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080029import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080030import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080031import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080032import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080033import "frameworks/base/core/proto/android/server/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080034import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070035import "frameworks/base/core/proto/android/service/procstats_enum.proto";
36import "frameworks/base/core/proto/android/stats/enums.proto";
shawnlinea5b66b2018-11-13 15:05:29 +080037import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070038import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080039import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080040import "frameworks/base/core/proto/android/telephony/enums.proto";
41import "frameworks/base/core/proto/android/view/enums.proto";
arangelov4e994062018-11-13 16:12:38 +000042import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
43import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080044
Yao Chend54f9dd2017-10-17 17:37:48 +000045/**
Stefan Lafonae2df012017-11-14 09:17:21 -080046 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000047 * raw stats log events from the Android system, also known as "atoms."
48 *
49 * This field contains a single oneof with all of the available messages.
50 * The stats-log-api-gen tool runs as part of the Android build and
51 * generates the android.util.StatsLog class, which contains the constants
52 * and methods that Android uses to log.
53 *
Stefan Lafonae2df012017-11-14 09:17:21 -080054 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000055 * Instead, statsd on Android constructs these messages synthetically,
56 * in the format defined here and in stats_log.proto.
57 */
Stefan Lafonae2df012017-11-14 09:17:21 -080058message Atom {
59 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070060 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070061 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
62 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070063 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070064 BleScanResultReceived ble_scan_result_received = 4;
65 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080066 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070067 SyncStateChanged sync_state_changed = 7;
68 ScheduledJobStateChanged scheduled_job_state_changed = 8;
69 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070070 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080071 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
72 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
73 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070074 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
75 MemoryFactorStateChanged memory_factor_state_changed = 15;
76 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
77 CachedKillReported cached_kill_reported = 17;
78 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070079 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080080 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
81 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
82 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070083 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080084 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070085 CameraStateChanged camera_state_changed = 25;
86 FlashlightStateChanged flashlight_state_changed = 26;
87 UidProcessStateChanged uid_process_state_changed = 27;
88 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
89 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070090 BatteryLevelChanged battery_level_changed = 30;
91 ChargingStateChanged charging_state_changed = 31;
92 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070093 InteractiveStateChanged interactive_state_changed = 33;
94 // 34 is available
Bookatz8c6571b2017-10-24 15:04:41 -070095 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
96 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070097 WifiLockStateChanged wifi_lock_state_changed = 37;
98 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
99 WifiScanStateChanged wifi_scan_state_changed = 39;
100 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700101 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700102 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700103 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900104 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700105 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800106 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -0800107 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800108 AppStartOccurred app_start_occurred = 48;
109 AppStartCanceled app_start_canceled = 49;
110 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800111 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800112 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800113 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800114 LmkStateChanged lmk_state_changed = 54;
115 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800116 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800117 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800118 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800119 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800120 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800121 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800122 KeyguardStateChanged keyguard_state_changed = 62;
123 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
124 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800125 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800126 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800127 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
128 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800129 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700130 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800131 SpeakerImpedanceReported speaker_impedance_reported = 71;
132 HardwareFailed hardware_failed = 72;
133 PhysicalDropDetected physical_drop_detected = 73;
134 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800135 MobileConnectionStateChanged mobile_connection_state_changed = 75;
136 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700137 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800138 AppCrashOccurred app_crash_occurred = 78;
139 ANROccurred anr_occurred = 79;
140 WTFOccurred wtf_occurred = 80;
141 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700142 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700143 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700144 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700145 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700146 ThermalThrottlingStateChanged thermal_throttling = 86;
Tej Singhd6d6d772018-09-05 17:41:25 -0700147 FingerprintAcquired fingerprint_acquired = 87;
148 FingerprintAuthenticated fingerprint_authenticated = 88;
149 FingerprintErrorOccurred fingerprint_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700150 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700151 BatteryHealthSnapshot battery_health_snapshot = 91;
152 SlowIo slow_io = 92;
153 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700154 PhoneServiceStateChanged phone_service_state_changed = 94;
155 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100156 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700157 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700158 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700159 // TODO: service state change is very noisy shortly after boot, as well
160 // as at other transitions - coming out of doze, device plugged in, etc.
161 // Consider removing this if it becomes a problem
162 ServiceStateChanged service_state_changed = 99;
163 ServiceLaunchReported service_launch_reported = 100;
Yangster-macb89807e2018-11-15 21:10:57 -0800164 PhenotypeFlagStateChanged phenotype_flag_state_changed = 101;
165 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000166 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800167 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
168 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
169 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
170 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
171 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
172 DocsUILaunchReported docs_ui_launch_reported = 109;
173 DocsUIRootVisitedReported docs_ui_root_visited = 110;
174 DocsUIStartupMsReported docs_ui_startup_ms = 111;
175 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800176 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
177 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000178 AppCompacted app_compacted = 115;
lifr030d23a2019-01-11 16:54:51 +0800179 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800180 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
181 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
182 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
183 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800184 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000185 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000186 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800187 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800188 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800189 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
190 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000191 AppDowngraded app_downgraded = 128;
192 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
193 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800194 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
195 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800196 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Yao Chend54f9dd2017-10-17 17:37:48 +0000197 }
David Chenc8a43242017-10-17 16:23:28 -0700198
David Chen6e3e6cb2018-01-03 16:14:06 -0800199 // Pulled events will start at field 10000.
Rafal Slawik3bea8952018-11-15 12:39:33 +0000200 // Next: 10043
David Chenc8a43242017-10-17 16:23:28 -0700201 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800202 WifiBytesTransfer wifi_bytes_transfer = 10000;
203 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
204 MobileBytesTransfer mobile_bytes_transfer = 10002;
205 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800206 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800207 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800208 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800209 CpuTimePerFreq cpu_time_per_freq = 10008;
210 CpuTimePerUid cpu_time_per_uid = 10009;
211 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800212 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800213 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800214 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800215 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800216 SystemElapsedRealtime system_elapsed_realtime = 10014;
217 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800218 CpuActiveTime cpu_active_time = 10016;
219 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000220 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800221 RemainingBatteryCapacity remaining_battery_capacity = 10019;
222 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800223 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100224 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100225 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100226 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000227 DiskStats disk_stats = 10025;
228 DirectoryUsage directory_usage = 10026;
229 AppSize app_size = 10027;
230 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700231 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700232 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700233 NumFingerprints num_fingerprints = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700234 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700235 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800236 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700237 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100238 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100239 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700240 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800241 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
242 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
243 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000244 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800245 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800246 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800247 BatteryCycleCount battery_cycle_count = 10045;
David Chenc8a43242017-10-17 16:23:28 -0700248 }
yroa1fe77c2018-02-26 14:22:54 -0800249
Bookatz76aafcf2018-09-17 16:17:10 -0700250 // DO NOT USE field numbers above 100,000 in AOSP.
251 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
252 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700253}
254
Yao Chend54f9dd2017-10-17 17:37:48 +0000255/**
Yangster-mac20877162017-12-22 17:19:39 -0800256 * This proto represents a node of an attribution chain.
257 * Note: All attribution chains are represented as a repeated field of type
258 * AttributionNode. It is understood that in such arrays, the order is that
259 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000260 */
Yangster-mac20877162017-12-22 17:19:39 -0800261message AttributionNode {
262 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800263 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800264
Yangster-mac20877162017-12-22 17:19:39 -0800265 // The (optional) string tag for an element in the attribution chain. If the
266 // element has no tag, it is encoded as an empty string.
267 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700268}
269
Yangster-mac48b3d622018-08-18 12:38:11 -0700270message KeyValuePair {
271 optional int32 key = 1;
272 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700273 int32 value_int = 2;
274 int64 value_long = 3;
275 string value_str = 4;
276 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700277 }
278}
279
280message KeyValuePairsAtom {
281 optional int32 uid = 1;
282 repeated KeyValuePair pairs = 2;
283}
284
Yao Chend54f9dd2017-10-17 17:37:48 +0000285/*
286 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800287 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000288 *
289 * RULES:
290 * - The field ids for each atom must start at 1, and count upwards by 1.
291 * Skipping field ids is not allowed.
292 * - These form an API, so renaming, renumbering or removing fields is
293 * not allowed between android releases. (This is not currently enforced,
294 * but there will be a tool to enforce this restriction).
295 * - The types must be built-in protocol buffer types, namely, no sub-messages
296 * are allowed (yet). The bytes type is also not allowed.
297 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800298 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000299 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800300 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000301 * - A field that is a uid should be a string field, tagged with the [xxx]
302 * annotation. The generated code on android will be represented by UIDs,
303 * and those UIDs will be translated in xxx to those strings.
304 *
305 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700306 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000307 * - If there is a UID, it goes first. Think in an object-oriented fashion.
308 * *****************************************************************************
309 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700310
Yao Chend54f9dd2017-10-17 17:37:48 +0000311/**
Yangster-mace16189a2018-08-26 12:20:16 -0700312 * Logs when the Thermal service HAL notifies the throttling start/stop events.
313 *
314 * Logged from:
315 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
316 */
317message ThermalThrottlingStateChanged {
318 optional android.os.TemperatureTypeEnum sensor_type = 1;
319
320 enum State {
321 UNKNOWN = 0;
322 START = 1;
323 STOP = 2;
324 }
325
326 optional State state = 2;
327
328 optional float temperature = 3;
329}
330
331/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000332 * Logs when the screen state changes.
333 *
334 * Logged from:
335 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
336 */
337message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800338 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700339 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700340}
Yao Chend54f9dd2017-10-17 17:37:48 +0000341
342/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700343 * Logs that the process state of the uid, as determined by ActivityManager
344 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000345 *
346 * Logged from:
347 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
348 */
Bookatzc1a050a2017-10-10 15:49:28 -0700349message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700350 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000351
Bookatzdb026a22018-01-10 19:01:56 -0800352 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700353 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000354}
355
356/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700357 * Logs process state change of a process, as per the activity manager.
358 *
359 * Logged from:
360 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
361 */
362message ProcessStateChanged {
363 optional int32 uid = 1;
364 optional string process_name = 2;
365 optional string package_name = 3;
366 // TODO: remove this when validation is done
367 optional int64 version = 5;
368 // The state, from frameworks/base/core/proto/android/app/enums.proto.
369 optional android.app.ProcessStateEnum state = 4;
370}
371
372/**
373 * Logs when ActivityManagerService sleep state is changed.
374 *
375 * Logged from:
376 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
377 */
378message ActivityManagerSleepStateChanged {
379 // TODO: import frameworks proto
380 enum State {
381 UNKNOWN = 0;
382 ASLEEP = 1;
383 AWAKE = 2;
384 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700385 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700386}
387
388/**
389 * Logs when system memory state changes.
390 *
391 * Logged from:
392 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
393 */
394message MemoryFactorStateChanged {
395 // TODO: import frameworks proto
396 enum State {
397 MEMORY_UNKNOWN = 0;
398 NORMAL = 1; // normal.
399 MODERATE = 2; // moderate memory pressure.
400 LOW = 3; // low memory.
401 CRITICAL = 4; // critical memory.
402
403 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700404 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700405}
406
407/**
408 * Logs when app is using too much cpu, according to ActivityManagerService.
409 *
410 * Logged from:
411 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
412 */
413message ExcessiveCpuUsageReported {
414 optional int32 uid = 1;
415 optional string process_name = 2;
416 optional string package_name = 3;
417 // package version. TODO: remove this when validation is done
418 optional int64 version = 4;
419}
420
421/**
422 * Logs when a cached process is killed, along with its pss.
423 *
424 * Logged from:
425 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
426 */
427message CachedKillReported {
428 optional int32 uid = 1;
429 optional string process_name = 2;
430 optional string package_name = 3;
431 // TODO: remove this when validation is done
432 optional int64 version = 5;
433 optional int64 pss = 4;
434}
435
436/**
437 * Logs when memory stats of a process is reported.
438 *
439 * Logged from:
440 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
441 */
442message ProcessMemoryStatReported {
443 optional int32 uid = 1;
444 optional string process_name = 2;
445 optional string package_name = 3;
446 //TODO: remove this when validation is done
447 optional int64 version = 9;
448 optional int64 pss = 4;
449 optional int64 uss = 5;
450 optional int64 rss = 6;
451 enum Type {
452 ADD_PSS_INTERNAL_SINGLE = 0;
453 ADD_PSS_INTERNAL_ALL_MEM = 1;
454 ADD_PSS_INTERNAL_ALL_POLL = 2;
455 ADD_PSS_EXTERNAL = 3;
456 ADD_PSS_EXTERNAL_SLOW = 4;
457 }
458 optional Type type = 7;
459 optional int64 duration = 8;
460}
461
462/**
Bookatzc1a050a2017-10-10 15:49:28 -0700463 * Logs that a process started, finished, crashed, or ANRed.
464 *
465 * Logged from:
466 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
467 */
468message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700469 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700470
David Chen0b5c90c2018-01-25 16:51:49 -0800471 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800472 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700473
Bookatzddccf0a2017-11-28 16:48:14 -0800474 // What lifecycle state the process changed to.
475 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800476 enum State {
477 FINISHED = 0;
478 STARTED = 1;
479 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800480 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800481 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700482}
483
Bookatzc1a050a2017-10-10 15:49:28 -0700484/**
485 * Logs when the ble scan state changes.
486 *
487 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700488 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700489 */
490message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800491 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700492
493 enum State {
494 OFF = 0;
495 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700496 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
497 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700498 }
499 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700500
Bookatze5ec0b42018-03-26 13:34:56 -0700501 // Does the scan have a filter.
502 optional bool is_filtered = 3;
503 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
504 optional bool is_first_match = 4;
505 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
506 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700507}
508
509/**
510 * Logs reporting of a ble scan finding results.
511 *
512 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700513 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700514 */
Bookatzae6738e2018-09-13 11:38:56 -0700515// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700516message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800517 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700518
519 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800520 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700521}
522
523/**
524 * Logs when a sensor state changes.
525 *
526 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700527 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700528 */
529message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800530 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700531
Bookatzc1a050a2017-10-10 15:49:28 -0700532 // The id (int) of the sensor.
533 optional int32 sensor_id = 2;
534
535 enum State {
536 OFF = 0;
537 ON = 1;
538 }
539 optional State state = 3;
540}
541
Bookatzc1a050a2017-10-10 15:49:28 -0700542/**
543 * Logs when GPS state changes.
544 *
545 * Logged from:
546 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
547 */
548message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800549 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700550
551 enum State {
552 OFF = 0;
553 ON = 1;
554 }
555 optional State state = 2;
556}
557
Bookatz48d362e2018-11-06 15:49:08 -0800558/**
559 * Logs when GPS signal quality.
560 *
561 * Logged from:
562 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
563 */
564message GpsSignalQualityChanged {
565 optional android.server.location.GpsSignalQualityEnum level = 1;
566}
567
Bookatzc1a050a2017-10-10 15:49:28 -0700568
569/**
570 * Logs when a sync manager sync state changes.
571 *
572 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700573 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700574 */
575message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800576 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700577
David Chen0b5c90c2018-01-25 16:51:49 -0800578 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800579 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700580
581 enum State {
582 OFF = 0;
583 ON = 1;
584 }
585 optional State state = 3;
586}
587
Yangster-mac96353002018-09-05 11:18:55 -0700588/*
589 * Deferred job stats.
590 *
591 * Logged from:
592 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
593*/
594message DeferredJobStatsReported {
595 repeated AttributionNode attribution_node = 1;
596
597 // Number of jobs deferred.
598 optional int32 num_jobs_deferred = 2;
599
600 // Time since the last job runs.
601 optional int64 time_since_last_job_millis = 3;
602}
603
Bookatzc1a050a2017-10-10 15:49:28 -0700604/**
605 * Logs when a job scheduler job state changes.
606 *
607 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700608 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700609 */
610message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800611 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700612
613 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800614 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700615
616 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800617 FINISHED = 0;
618 STARTED = 1;
619 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700620 }
621 optional State state = 3;
622
Tej Singh33a412b2018-03-16 18:43:59 -0700623 // The reason a job has stopped.
624 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700625 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700626 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700627}
628
629/**
630 * Logs when the audio state changes.
631 *
632 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700633 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700634 */
635message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800636 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700637
638 enum State {
639 OFF = 0;
640 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700641 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
642 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700643 }
644 optional State state = 2;
645}
646
647/**
648 * Logs when the video codec state changes.
649 *
650 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700651 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700652 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800653message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800654 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700655
656 enum State {
657 OFF = 0;
658 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700659 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
660 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700661 }
662 optional State state = 2;
663}
664
665/**
666 * Logs when the flashlight state changes.
667 *
668 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700669 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700670 */
671message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800672 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700673
674 enum State {
675 OFF = 0;
676 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700677 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
678 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700679 }
680 optional State state = 2;
681}
682
683/**
684 * Logs when the camera state changes.
685 *
686 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700687 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700688 */
689message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800690 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700691
692 enum State {
693 OFF = 0;
694 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700695 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
696 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700697 }
698 optional State state = 2;
699}
700
701/**
702 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000703 *
704 * Logged from:
705 * TODO
706 */
Bookatzd6746242017-10-24 18:39:35 -0700707message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800708 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000709
Bookatz1a1b0462018-01-12 11:47:03 -0800710 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
711 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700712 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700713
714 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
715 optional string tag = 3;
716
717 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800718 RELEASE = 0;
719 ACQUIRE = 1;
720 CHANGE_RELEASE = 2;
721 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700722 }
723 optional State state = 4;
724}
725
726/**
Bookatzc1a050a2017-10-10 15:49:28 -0700727 * Logs when a partial wakelock is considered 'long' (over 1 min).
728 *
729 * Logged from:
730 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
731 */
732message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800733 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700734
Yao Chend54f9dd2017-10-17 17:37:48 +0000735 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
736 optional string tag = 2;
737
Bookatzc1a050a2017-10-10 15:49:28 -0700738 // TODO: I have no idea what this is.
739 optional string history_tag = 3;
740
741 enum State {
742 OFF = 0;
743 ON = 1;
744 }
745 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000746}
747
Bookatzc1a050a2017-10-10 15:49:28 -0700748/**
Bookatza66083f2018-09-20 17:24:00 -0700749 * Logs when the device is interactive, according to the PowerManager Notifier.
750 *
751 * Logged from:
752 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
753 */
754message InteractiveStateChanged {
755 enum State {
756 OFF = 0;
757 ON = 1;
758 }
759 optional State state = 1;
760}
761
762/**
Bookatzc1a050a2017-10-10 15:49:28 -0700763 * Logs Battery Saver state change.
764 *
765 * Logged from:
766 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
767 */
768message BatterySaverModeStateChanged {
769 enum State {
770 OFF = 0;
771 ON = 1;
772 }
773 optional State state = 1;
774}
775
776/**
777 * Logs Doze mode state change.
778 *
779 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800780 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700781 */
782message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800783 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800784}
785
786
787/**
788 * Logs state change of Doze mode including maintenance windows.
789 *
790 * Logged from:
791 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
792 */
793message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800794 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700795}
796
797/**
798 * Logs screen brightness level.
799 *
800 * Logged from:
801 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
802 */
803message ScreenBrightnessChanged {
804 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
805 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700806}
807
808/**
809 * Logs battery level (percent full, from 0 to 100).
810 *
811 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700812 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700813 */
814message BatteryLevelChanged {
815 // Battery level. Should be in [0, 100].
816 optional int32 battery_level = 1;
817}
818
819/**
820 * Logs change in charging status of the device.
821 *
822 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700823 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700824 */
825message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800826 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
827 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700828}
829
830/**
831 * Logs whether the device is plugged in, and what power source it is using.
832 *
833 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700834 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700835 */
836message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800837 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
838 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700839}
840
Bookatz8c6571b2017-10-24 15:04:41 -0700841/**
842 * Logs when an app's wakeup alarm fires.
843 *
844 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700845 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700846 */
847message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800848 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800849
850 // Name of the wakeup alarm.
851 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700852
853 // Name of source package (for historical reasons, since BatteryStats tracked it).
854 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800855}
856
857/**
858 * Logs when an an app causes the mobile radio to change state.
859 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
860 *
861 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700862 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800863 */
864message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800865 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800866
Bookatz1a1b0462018-01-12 11:47:03 -0800867 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
868 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800869}
870
871/**
872 * Logs when an an app causes the wifi radio to change state.
873 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
874 *
875 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700876 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800877 */
878message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800879 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800880
Bookatz1a1b0462018-01-12 11:47:03 -0800881 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
882 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700883}
884
885/**
886 * Logs kernel wakeup reasons and aborts.
887 *
888 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700889 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700890 */
891message KernelWakeupReported {
892 // Name of the kernel wakeup reason (or abort).
893 optional string wakeup_reason_name = 1;
894
895 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800896 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700897}
898
899/**
Bookatzda1798c2018-12-13 14:16:00 -0800900 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800901 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800902 *
903 * Logged from:
904 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
905 */
906message WifiEnabledStateChanged {
907 enum State {
908 OFF = 0;
909 ON = 1;
910 }
911 optional State state = 1;
912}
913
914/**
915 * 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 -0800916 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
917 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800918 *
919 * Logged from:
920 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
921 */
922message WifiRunningStateChanged {
923 repeated AttributionNode attribution_node = 1;
924
925 enum State {
926 OFF = 0;
927 ON = 1;
928 }
929 optional State state = 2;
930}
931
932/**
Bookatze5885242017-10-24 20:10:31 -0700933 * Logs wifi locks held by an app.
934 *
935 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700936 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700937 */
938message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800939 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700940
941 enum State {
942 OFF = 0;
943 ON = 1;
944 }
945 optional State state = 2;
946}
947
948/**
949 * Logs wifi signal strength changes.
950 *
951 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800952 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -0700953 */
954message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800955 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
956 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700957}
958
959/**
960 * Logs wifi scans performed by an app.
961 *
962 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800963 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -0700964 */
965message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800966 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700967
968 enum State {
969 OFF = 0;
970 ON = 1;
971 }
972 optional State state = 2;
973}
974
975/**
Tej Singh4503e102018-01-04 14:35:01 -0800976 * Logs wifi multicast locks held by an app
977 *
978 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800979 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -0800980 */
981message WifiMulticastLockStateChanged {
982 repeated AttributionNode attribution_node = 1;
983
984 enum State {
985 OFF = 0;
986 ON = 1;
987 }
988 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -0800989
990 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -0800991}
992
993/**
Tej Singh1ea42892018-01-19 09:27:00 -0800994 * Logs shutdown reason and duration on next boot.
995 *
996 * Logged from:
997 * frameworks/base/core/java/com/android/server/BootReceiver.java
998 */
999message ShutdownSequenceReported {
1000 // True if shutdown is for a reboot. Default: false if we do not know.
1001 optional bool reboot = 1;
1002
1003 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1004 optional string reason = 2;
1005
1006 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1007 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001008 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001009
1010 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001011 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001012}
1013
Tej Singh6483ea42018-01-25 17:45:49 -08001014
1015/**
1016 * Logs boot reason and duration.
1017 *
1018 * Logged from:
1019 * system/core/bootstat/bootstat.cpp
1020 */
1021message BootSequenceReported {
1022 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1023 // Default: "<EMPTY>" if not available.
1024 optional string bootloader_reason = 1;
1025
1026 // Reason for system boot. Eg. bootloader, reboot,userrequested
1027 // Default: "<EMPTY>" if not available.
1028 optional string system_reason = 2;
1029
1030 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001031 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001032
1033 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001034 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001035
1036 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001037 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001038
1039 // Time since last boot in ms. Default: 0 if not available.
1040 optional int64 time_since_last_boot = 6;
1041}
1042
Tej Singhc477d9c2018-02-05 18:31:39 -08001043
1044/**
1045 * Logs call state and disconnect cause (if applicable).
1046 *
1047 * Logged from:
1048 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1049 */
1050message CallStateChanged {
1051 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1052 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1053 optional android.telecom.CallStateEnum call_state = 1;
1054
1055 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1056 // This value is only applicable when the call_state is DISCONNECTED, and
1057 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1058 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1059 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1060
1061 // True if the call is self-managed, which are apps that use the
1062 // telecom infrastructure to make their own calls.
1063 optional bool self_managed = 3;
1064
1065 // True if call is external. External calls are calls on connected Wear
1066 // devices but show up in Telecom so the user can pull them onto the device.
1067 optional bool external_call = 4;
1068}
1069
Tej Singh1ea42892018-01-19 09:27:00 -08001070/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001071 * Logs keyguard state. The keyguard is the lock screen.
1072 *
1073 * Logged from:
1074 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1075 */
1076message KeyguardStateChanged {
1077 enum State {
1078 UNKNOWN = 0;
1079 // The keyguard is hidden when the phone is unlocked.
1080 HIDDEN = 1;
1081 // The keyguard is shown when the phone is locked (screen turns off).
1082 SHOWN= 2;
1083 // The keyguard is occluded when something is overlaying the keyguard.
1084 // Eg. Opening the camera while on the lock screen.
1085 OCCLUDED = 3;
1086 }
1087 optional State state = 1;
1088}
1089
1090/**
1091 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1092 * prompts the user to enter a password (pattern, pin, etc).
1093 *
1094 * Logged from:
1095 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1096 */
1097
1098message KeyguardBouncerStateChanged {
1099 enum State {
1100 UNKNOWN = 0;
1101 // Bouncer is hidden, either as a result of successfully entering the
1102 // password, screen timing out, or user going back to lock screen.
1103 HIDDEN = 1;
1104 // This is when the user is being prompted to enter the password.
1105 SHOWN = 2;
1106 }
1107 optional State state = 1;
1108}
1109
1110/**
1111 * Logs the result of entering a password into the keyguard bouncer.
1112 *
1113 * Logged from:
1114 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1115 */
1116message KeyguardBouncerPasswordEntered {
1117 enum BouncerResult {
1118 UNKNOWN = 0;
1119 // The password entered was incorrect.
1120 FAILURE = 1;
1121 // The password entered was correct.
1122 SUCCESS = 2;
1123 }
1124 optional BouncerResult result = 1;
1125}
1126
Tej Singha883b372018-02-15 11:30:01 -08001127/*
1128 * Logs changes to the configuration of the device. The configuration is defined
1129 * in frameworks/base/core/java/android/content/res/Configuration.java
1130 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1131 * Please go there to interpret the possible values each field can be.
1132 *
1133 * Logged from:
1134 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1135 */
1136message ResourceConfigurationChanged {
1137 // Bit mask of color capabilities of the screen.
1138 // Contains information about the color gamut and hdr mode of the screen.
1139 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001140 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001141
1142 // The target screen density being rendered to.
1143 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001144 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001145
1146 // Current user preference for the scaling factor for fonts,
1147 // relative to the base density scaling.
1148 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001149 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001150
1151 // Flag indicating whether the hard keyboard is hidden.
1152 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001153 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001154
1155 // The type of keyboard attached to the device.
1156 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1157 optional int32 keyboard = 5;
1158
1159 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1160 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001161 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001162
1163 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1164 // 0 if undefined.
1165 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1166 optional int32 mcc = 7;
1167
1168 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1169 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1170 // MNC_ZERO symbol defined in Configuration.java.
1171 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1172 optional int32 mnc = 8;
1173
1174 // The kind of navigation available on the device.
1175 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1176 optional int32 navigation = 9;
1177
1178 // Flag indicating whether the navigation is available.
1179 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001180 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001181
1182 // Overall orientation of the screen.
1183 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1184 optional int32 orientation = 11;
1185
1186 // The current height of the available screen space, in dp units.
1187 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001188 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001189
1190 // Bit mask of overall layout of the screen.
1191 // Contains information about screen size, whether the screen is wider/taller
1192 // than normal, whether the screen layout is right-tl-left or left-to-right,
1193 // and whether the screen has a rounded shape.
1194 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001195 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001196
1197 // Current width of the available screen space, in dp units.
1198 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001199 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001200
1201 // The smallest screen size an application will see in normal operation.
1202 // This is the smallest value of both screenWidthDp and screenHeightDp
1203 // in portrait and landscape.
1204 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001205 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001206
1207 // The type of touch screen attached to the device.
1208 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1209 optional int32 touchscreen = 16;
1210
1211 // Bit mask of the ui mode.
1212 // Contains information about the overall ui mode of the device.
1213 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1214 // Also contains information about whether the device is in night mode.
1215 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001216 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001217}
1218
Tej Singheee317b2018-03-07 19:28:05 -08001219
1220/**
1221 * Logs changes in the connection state of the mobile radio.
1222 *
1223 * Logged from:
1224 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1225 */
1226message MobileConnectionStateChanged {
1227 // States are from the state machine DataConnection.java.
1228 enum State {
1229 UNKNOWN = 0;
1230 // The connection is inactive, or disconnected.
1231 INACTIVE = 1;
1232 // The connection is being activated, or connecting.
1233 ACTIVATING = 2;
1234 // The connection is active, or connected.
1235 ACTIVE = 3;
1236 // The connection is disconnecting.
1237 DISCONNECTING = 4;
1238 // The connection is disconnecting after creating a connection.
1239 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1240 }
1241 optional State state = 1;
1242 // For multi-sim phones, this distinguishes between the sim cards.
1243 optional int32 sim_slot_index = 2;
1244 // Used to identify the connection. Starts at 0 and increments by 1 for
1245 // every new network created. Resets whenever the device reboots.
1246 optional int32 data_connection_id = 3;
1247 // A bitmask for the capabilities of this connection.
1248 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1249 // Default value (if we have no information): 0
1250 optional int64 capabilities = 4;
1251 // If this connection has internet.
1252 // This just checks if the DEFAULT bit of capabilities is set.
1253 optional bool has_internet = 5;
1254}
1255
1256/**
1257 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1258 *
1259 * Logged from:
1260 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1261 */
1262message MobileRadioTechnologyChanged {
1263 optional android.telephony.NetworkTypeEnum state = 1;
1264 // For multi-sim phones, this distinguishes between the sim cards.
1265 optional int32 sim_slot_index = 2;
1266}
1267
Andrew Chantb56388b2018-03-22 21:07:33 -07001268/**
1269 * Logs the VID and PID of any connected USB devices.
1270 *
1271 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1272 *
1273 * Logged by Vendor.
1274 */
1275message UsbDeviceAttached {
1276 optional int32 vid = 1;
1277 optional int32 pid = 2;
1278 optional bool has_audio = 3;
1279 optional bool has_hid = 4;
1280 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001281 enum State {
1282 STATE_DISCONNECTED = 0;
1283 STATE_CONNECTED = 1;
1284 }
1285 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001286 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001287}
1288
Tej Singheee317b2018-03-07 19:28:05 -08001289
Tej Singhdd7bd352018-02-09 19:33:15 -08001290/**
Tej Singh5d991e12018-03-09 19:48:11 -08001291 * Logs when Bluetooth is enabled and disabled.
1292 *
1293 * Logged from:
1294 * services/core/java/com/android/server/BluetoothManagerService.java
1295 */
1296message BluetoothEnabledStateChanged {
1297 repeated AttributionNode attribution_node = 1;
1298 // Whether or not bluetooth is enabled on the device.
1299 enum State {
1300 UNKNOWN = 0;
1301 ENABLED = 1;
1302 DISABLED = 2;
1303 }
1304 optional State state = 2;
1305 // The reason for being enabled/disabled.
1306 // Eg. Airplane mode, crash, application request.
1307 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1308 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001309 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001310}
1311
1312/**
Jack Hed9837c82019-01-09 01:19:13 -08001313 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001314 *
1315 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001316 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1317 *
1318 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001319 */
1320message BluetoothConnectionStateChanged {
1321 // The state of the connection.
1322 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1323 optional android.bluetooth.ConnectionStateEnum state = 1;
1324 // An identifier that can be used to match connect and disconnect events.
1325 // Currently is last two bytes of a hash of a device level ID and
1326 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001327 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1328 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001329 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1330 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001331 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001332 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001333 // An identifier that can be used to match events for this device.
1334 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1335 // Salt: Randomly generated 256 bit value
1336 // Hash algorithm: HMAC-SHA256
1337 // Size: 32 byte
1338 // Default: null or empty if the device identifier is not known
1339 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1340}
1341
1342/**
1343 * Logs when a Bluetooth device connects and disconnects over ACL
1344 *
1345 * Logged from:
1346 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1347 *
1348 * Next Tag: 3
1349 */
1350message BluetoothAclConnectionStateChanged {
1351 // An identifier that can be used to match events for this device.
1352 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1353 // Salt: Randomly generated 256 bit value
1354 // Hash algorithm: HMAC-SHA256
1355 // Size: 32 byte
1356 // Default: null or empty if the device identifier is not known
1357 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1358 // The state of the connection.
1359 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1360 optional android.bluetooth.ConnectionStateEnum state = 2;
1361}
1362
1363/**
1364 * Logs when a Bluetooth device connects and disconnects over SCO
1365 *
1366 * Logged from:
1367 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1368 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1369 *
1370 * Next Tag: 4
1371 */
1372message BluetoothScoConnectionStateChanged {
1373 // An identifier that can be used to match events for this device.
1374 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1375 // Salt: Randomly generated 256 bit value
1376 // Hash algorithm: HMAC-SHA256
1377 // Size: 32 byte
1378 // Default: null or empty if the device identifier is not known
1379 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1380 // The state of the connection.
1381 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1382 optional android.bluetooth.ConnectionStateEnum state = 2;
1383 // Codec used for this SCO connection
1384 // Default: UNKNOWN
1385 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001386}
1387
Jack Heab86dbd22018-12-18 15:43:27 -08001388// Logs when there is an event affecting Bluetooth device's link layer connection.
1389// - This event is triggered when there is a related HCI command or event
1390// - Users of this metrics can deduce Bluetooth device's connection state from these events
1391// - HCI commands are logged before the command is sent, after receiving command status, and after
1392// receiving command complete
1393// - HCI events are logged when they arrive
1394//
1395// Low level log from system/bt
1396//
1397// Bluetooth classic commands:
1398// - CMD_CREATE_CONNECTION
1399// - CMD_DISCONNECT
1400// - CMD_CREATE_CONNECTION_CANCEL
1401// - CMD_ACCEPT_CONNECTION_REQUEST
1402// - CMD_REJECT_CONNECTION_REQUEST
1403// - CMD_SETUP_ESCO_CONNECTION
1404// - CMD_ACCEPT_ESCO_CONNECTION
1405// - CMD_REJECT_ESCO_CONNECTION
1406// - CMD_ENH_SETUP_ESCO_CONNECTION
1407// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1408//
1409// Bluetooth low energy commands:
1410// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1411// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1412// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1413// - CMD_BLE_CLEAR_WHITE_LIST
1414// - CMD_BLE_ADD_WHITE_LIST
1415// - CMD_BLE_REMOVE_WHITE_LIST
1416//
1417// Bluetooth classic events:
1418// - EVT_CONNECTION_COMP
1419// - EVT_CONNECTION_REQUEST
1420// - EVT_DISCONNECTION_COMP
1421// - EVT_ESCO_CONNECTION_COMP
1422// - EVT_ESCO_CONNECTION_CHANGED
1423//
1424// Bluetooth low energy meta events:
1425// - BLE_EVT_CONN_COMPLETE_EVT
1426// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1427//
1428// Next tag: 10
1429message BluetoothLinkLayerConnectionEvent {
1430 // An identifier that can be used to match events for this device.
1431 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1432 // Salt: Randomly generated 256 bit value
1433 // Hash algorithm: HMAC-SHA256
1434 // Size: 32 byte
1435 // Default: null or empty if the device identifier is not known
1436 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1437 // Connection handle of this connection if available
1438 // Range: 0x0000 - 0x0EFF (12 bits)
1439 // Default: 0xFFFF if the handle is unknown
1440 optional int32 connection_handle = 2;
1441 // Direction of the link
1442 // Default: DIRECTION_UNKNOWN
1443 optional android.bluetooth.DirectionEnum direction = 3;
1444 // Type of this link
1445 // Default: LINK_TYPE_UNKNOWN
1446 optional android.bluetooth.LinkTypeEnum type = 4;
1447
1448 // Reason metadata for this link layer connection event, rules for interpretation:
1449 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1450 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1451 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1452 // set and valid, ignore hci_ble_event
1453
1454 // HCI command associated with this event
1455 // Default: CMD_UNKNOWN
1456 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1457 // HCI event associated with this event
1458 // Default: EVT_UNKNOWN
1459 optional android.bluetooth.hci.EventEnum hci_event = 6;
1460 // HCI BLE meta event associated with this event
1461 // Default: BLE_EVT_UNKNOWN
1462 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1463 // HCI command status code if this is triggerred by hci_cmd
1464 // Default: STATUS_UNKNOWN
1465 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1466 // HCI reason code associated with this event
1467 // Default: STATUS_UNKNOWN
1468 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1469}
1470
1471
Tej Singh5d991e12018-03-09 19:48:11 -08001472/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001473 * Logs when something is plugged into or removed from the USB-C connector.
1474 *
1475 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001476 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08001477 */
1478message UsbConnectorStateChanged {
1479 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001480 STATE_DISCONNECTED = 0;
1481 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08001482 }
1483 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001484 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08001485 // Last active session in ms.
1486 // 0 when the port is in connected state.
1487 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001488}
1489
1490/**
1491 * Logs the reported speaker impedance.
1492 *
1493 * Logged from:
1494 * Vendor audio implementation.
1495 */
1496message SpeakerImpedanceReported {
1497 optional int32 speaker_location = 1;
1498 optional int32 impedance = 2;
1499}
1500
1501/**
1502 * Logs the report of a failed hardware.
1503 *
1504 * Logged from:
1505 * Vendor HALs.
1506 *
1507 */
1508message HardwareFailed {
1509 enum HardwareType {
1510 HARDWARE_FAILED_UNKNOWN = 0;
1511 HARDWARE_FAILED_MICROPHONE = 1;
1512 HARDWARE_FAILED_CODEC = 2;
1513 HARDWARE_FAILED_SPEAKER = 3;
1514 HARDWARE_FAILED_FINGERPRINT = 4;
1515 }
1516 optional HardwareType hardware_type = 1;
1517
1518 /* hardware_location allows vendors to differentiate between multiple instances of
1519 * the same hardware_type. The specific locations are vendor defined integers,
1520 * referring to board-specific numbering schemes.
1521 */
1522 optional int32 hardware_location = 2;
1523
1524 /* failure_code is specific to the HardwareType of the failed hardware.
1525 * It should use the enum values defined below.
1526 */
1527 enum MicrophoneFailureCode {
1528 MICROPHONE_FAILURE_COMPLETE = 0;
1529 }
1530 enum CodecFailureCode {
1531 CODEC_FAILURE_COMPLETE = 0;
1532 }
1533 enum SpeakerFailureCode {
1534 SPEAKER_FAILURE_COMPLETE = 0;
1535 SPEAKER_FAILURE_HIGH_Z = 1;
1536 SPEAKER_FAILURE_SHORT = 2;
1537 }
1538 enum FingerprintFailureCode {
1539 FINGERPRINT_FAILURE_COMPLETE = 0;
1540 FINGERPRINT_SENSOR_BROKEN = 1;
1541 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1542 }
1543 optional int32 failure_code = 3;
1544}
1545
1546/**
1547 * Log an event when the device has been physically dropped.
1548 * Reported from the /vendor partition.
1549 */
1550message PhysicalDropDetected {
1551 // Confidence that the event was actually a drop, 0 -> 100
1552 optional int32 confidence_pctg = 1;
1553 // Peak acceleration of the drop, in 1/1000s of a g.
1554 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001555 // Duration of freefall in ms
1556 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001557}
1558
1559/**
1560 * Log bucketed battery charge cycles.
1561 *
1562 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08001563 * a given charge point. For example, if 10 cycle buckets are
1564 * initialized, bucket 1 is the lowest 1/10th of the battery,
1565 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08001566 *
1567 * Logged from:
1568 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1569 */
1570message ChargeCyclesReported {
1571 optional int32 cycle_bucket_1 = 1;
1572 optional int32 cycle_bucket_2 = 2;
1573 optional int32 cycle_bucket_3 = 3;
1574 optional int32 cycle_bucket_4 = 4;
1575 optional int32 cycle_bucket_5 = 5;
1576 optional int32 cycle_bucket_6 = 6;
1577 optional int32 cycle_bucket_7 = 7;
1578 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08001579 optional int32 cycle_bucket_9 = 9;
1580 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08001581}
1582
1583/**
Howard Roa46b6582018-09-18 16:45:02 -07001584 * Log battery health snapshot.
1585 *
1586 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1587 * are snapshotted periodically over 24hrs.
1588 */
1589message BatteryHealthSnapshot {
1590 enum BatterySnapshotType {
1591 UNKNOWN = 0;
1592 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1593 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1594 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1595 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1596 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1597 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1598 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1599 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1600 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1601 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1602 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1603 }
1604 optional BatterySnapshotType type = 1;
1605 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001606 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001607 // Voltage Battery Voltage, in microVolts.
1608 optional int32 voltage_micro_volt = 3;
1609 // Current Battery current, in microAmps.
1610 optional int32 current_micro_amps = 4;
1611 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1612 optional int32 open_circuit_micro_volt = 5;
1613 // Resistance Battery Resistance, in microOhms.
1614 optional int32 resistance_micro_ohm = 6;
1615 // Level Battery Level, as % of full.
1616 optional int32 level_percent = 7;
1617}
1618
1619/**
1620 * Log slow I/O operations on the primary storage.
1621 */
1622message SlowIo {
1623 // Classifications of IO Operations.
1624 enum IoOperation {
1625 UNKNOWN = 0;
1626 READ = 1;
1627 WRITE = 2;
1628 UNMAP = 3;
1629 SYNC = 4;
1630 }
1631 optional IoOperation operation = 1;
1632
1633 // The number of slow IO operations of this type over 24 hours.
1634 optional int32 count = 2;
1635}
1636
1637/**
1638 * Log battery caused shutdown with the last recorded voltage.
1639 */
1640message BatteryCausedShutdown {
1641 // The last recorded battery voltage prior to shutdown.
1642 optional int32 last_recorded_micro_volt = 1;
1643}
1644
1645/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001646 * Logs the duration of a davey (jank of >=700ms) when it occurs
1647 *
1648 * Logged from:
1649 * frameworks/base/libs/hwui/JankTracker.cpp
1650 */
1651message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001652 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001653 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001654
Tej Singhbb8554a2018-01-26 11:59:14 -08001655 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001656 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001657}
1658
1659/**
Bookatze5885242017-10-24 20:10:31 -07001660 * Logs phone signal strength changes.
1661 *
1662 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001663 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001664 */
1665message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001666 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1667 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001668}
1669
Yangster4ccebea2018-10-09 17:09:02 -07001670
1671/**
1672 * Logs when the phone state, sim state or signal strength changes
1673 *
1674 * Logged from:
1675 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1676 */
1677message PhoneServiceStateChanged {
1678 optional android.telephony.ServiceStateEnum state = 1;
1679 optional android.telephony.SimStateEnum sim_state = 2;
1680 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1681}
1682
1683/**
1684 * Logs when the phone becomes on or off.
1685 *
1686 * Logged from:
1687 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1688 */
1689message PhoneStateChanged {
1690 enum State {
1691 OFF = 0;
1692 ON = 1;
1693 }
1694 optional State state = 1;
1695}
1696
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001697message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07001698 optional android.stats.launcher.LauncherAction action = 1;
1699 optional android.stats.launcher.LauncherState src_state = 2;
1700 optional android.stats.launcher.LauncherState dst_state = 3;
1701 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001702 optional bool is_swipe_up_enabled = 5;
1703}
1704
David Chenc28b2bb2017-10-24 12:52:52 -07001705/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001706 * Logs when Settings UI has changed.
1707 *
1708 * Logged from:
1709 * packages/apps/Settings
1710 */
1711message SettingsUIChanged {
1712 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001713 * Where this SettingsUIChange event comes from. For example, if
1714 * it's a PAGE_VISIBLE event, where the page is opened from.
1715 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001716 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001717
1718 /**
1719 * What the UI action is.
1720 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001721 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001722
1723 /**
1724 * Where the action is happening
1725 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001726 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001727
1728 /**
1729 * What preference changed in this event.
1730 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001731 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07001732
1733 /**
1734 * The new value of the changed preference.
1735 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001736 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07001737}
1738
1739/**
David Chenc28b2bb2017-10-24 12:52:52 -07001740 * Logs that a setting was updated.
1741 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001742 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001743 * The tag and is_default allow resetting of settings to default values based on the specified
1744 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1745 */
1746message SettingChanged {
1747 // The name of the setting.
1748 optional string setting = 1;
1749
1750 // The change being imposed on this setting. May represent a number, eg "3".
1751 optional string value = 2;
1752
1753 // The new value of this setting. For most settings, this is same as value. For some settings,
1754 // value is +X or -X where X represents an element in a set. For example, if the previous value
1755 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1756 // The +/- feature is currently only used for location_providers_allowed.
1757 optional string new_value = 3;
1758
1759 // The previous value of this setting.
1760 optional string prev_value = 4;
1761
1762 // The tag used with the is_default for resetting sets of settings. This is generally null.
1763 optional string tag = 5;
1764
Bookatz90867622018-01-31 15:05:57 -08001765 // True if this setting with tag should be resettable.
1766 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001767
David Chenbd789912018-03-16 17:19:55 -07001768 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001769 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001770
1771 enum ChangeReason {
1772 UPDATED = 1; // Updated can be an insertion or an update.
1773 DELETED = 2;
1774 }
1775 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001776}
Chenjie Yub3dda412017-10-24 13:41:59 -07001777
Chenjie Yu05013b32017-11-21 10:21:41 -08001778/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001779 * Logs activity going to foreground or background
1780 *
1781 * Logged from:
1782 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1783 */
1784message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001785 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001786 optional string pkg_name = 2;
1787 optional string class_name = 3;
1788
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001789 enum State {
1790 BACKGROUND = 0;
1791 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001792 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001793 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001794}
David Chenc8a43242017-10-17 16:23:28 -07001795
1796/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00001797 * Logs when a volume entered low Storage state.
1798 * Logged from:
1799 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
1800 */
1801message LowStorageStateChanged {
1802 // Volume that ran out of storage.
1803 optional string volume_description = 1;
1804
1805 enum State {
1806 UNKNOWN = 0;
1807 OFF = 1;
1808 ON = 2;
1809 }
1810 optional State state = 2;
1811}
1812
1813/**
1814 * Logs when an app is downgraded.
1815 * Logged from:
1816 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
1817 */
1818message AppDowngraded {
1819 optional string package_name = 1;
1820 // Size of the package (all data) before being downgraded.
1821 optional int64 size_in_bytes_before = 2;
1822 // Size of the package (all data) after being downgraded.
1823 optional int64 size_in_bytes_after = 3;
1824
1825 optional bool aggressive = 4;
1826}
1827
1828/**
1829 * Logs when an app is optimized after being downgraded.
1830 * Logged from:
1831 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
1832 */
1833message AppOptimizedAfterDowngraded {
1834 optional string package_name = 1;
1835}
1836
1837/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001838 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001839 * Logged from:
1840 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1841 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001842message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001843 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001844
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001845 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001846
1847 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001848 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001849 optional string process_name = 3;
1850
1851 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001852 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001853
1854 optional string package_name = 5;
1855
1856 enum InstantApp {
1857 UNAVAILABLE = 0;
1858 FALSE = 1;
1859 TRUE = 2;
1860 }
1861 optional InstantApp is_instant_app = 6;
1862
1863 enum ForegroundState {
1864 UNKNOWN = 0;
1865 BACKGROUND = 1;
1866 FOREGROUND = 2;
1867 }
1868 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08001869
1870 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001871}
David Chen9e3808c2017-11-20 17:25:34 -08001872
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001873/**
1874 * Logs when a WTF (What a Terrible Failure) happened.
1875 * Logged from:
1876 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1877 */
1878message WTFOccurred {
1879 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001880
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001881 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001882
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001883 // The name of the process.
1884 // system_server if it is not by an app
1885 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001886
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001887 // The pid if available. -1 means not available.
1888 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08001889
1890 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001891}
1892
1893/**
1894 * Logs when system server reports low memory.
1895 * Logged from:
1896 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1897 */
1898message LowMemReported {
1899}
1900
1901/**
1902 * Logs when an app ANR (App Not Responding) occurs.
1903 * Logged from:
1904 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1905 */
1906message ANROccurred {
1907 optional int32 uid = 1 [(is_uid) = true];
1908
1909 optional string process_name = 2;
1910
1911 optional string short_component_name = 3;
1912
1913 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001914
1915 enum InstantApp {
1916 UNAVAILABLE = 0;
1917 FALSE = 1;
1918 TRUE = 2;
1919 }
1920 optional InstantApp is_instant_app = 5;
1921
1922 enum ForegroundState {
1923 UNKNOWN = 0;
1924 BACKGROUND = 1;
1925 FOREGROUND = 2;
1926 }
1927 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08001928
1929 optional android.server.ErrorSource error_source = 7;
1930
1931 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08001932}
1933
Bookatza7020bd2018-08-28 16:29:35 -07001934/**
1935 * Logs when the vibrator state changes.
1936 * Logged from:
1937 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1938 */
1939message VibratorStateChanged {
1940 repeated AttributionNode attribution_node = 1;
1941
1942 enum State {
1943 OFF = 0;
1944 ON = 1;
1945 }
1946 optional State state = 2;
1947
1948 // Duration (in milliseconds) requested to keep the vibrator on.
1949 // Only applicable for State == ON.
1950 optional int64 duration_millis = 3;
1951}
1952
David Chen0a368b22017-12-06 16:28:16 -08001953/*
1954 * Allows other apps to push events into statsd.
1955 * Logged from:
1956 * frameworks/base/core/java/android/util/StatsLog.java
1957 */
David Chen0b5c90c2018-01-25 16:51:49 -08001958message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001959 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001960 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001961
1962 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1963 optional int32 label = 2;
1964
1965 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1966 // predicates for the metrics).
1967 enum State {
1968 UNKNOWN = 0;
1969 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1970 STOP = 2;
1971 START = 3;
1972 }
1973 optional State state = 3;
1974}
1975
David Chen9e3808c2017-11-20 17:25:34 -08001976/**
Bookatz7948c872018-09-04 12:58:33 -07001977 * Logs the wall-clock time when a significant wall-clock time shift occurs.
1978 * For example, this could be due to the user manually changing the time.
1979 *
1980 * Logged from:
1981 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
1982 */
1983message WallClockTimeShifted {
1984 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
1985 optional int64 wall_clock_timestamp_millis = 1;
1986}
1987
1988/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001989 * Logs when statsd detects an anomaly.
1990 *
1991 * Logged from:
1992 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1993 */
1994message AnomalyDetected {
1995 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001996 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001997
Yangster-mac94e197c2018-01-02 16:03:03 -08001998 // Id of the config whose anomaly detection alert fired.
1999 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002000
Yangster-mac94e197c2018-01-02 16:03:03 -08002001 // Id of the alert (i.e. name of the anomaly that was detected).
2002 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002003}
2004
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002005message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002006 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002007 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002008
2009 // The app package name.
2010 optional string pkg_name = 2;
2011
2012 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002013 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002014 WARM = 1;
2015 HOT = 2;
2016 COLD = 3;
2017 }
2018 // The transition type.
2019 optional TransitionType type = 3;
2020
2021 // The activity name.
2022 optional string activity_name = 4;
2023
2024 // The name of the calling app. Empty if not set.
2025 optional string calling_pkg_name = 5;
2026
2027 // Whether the app is an instant app.
2028 optional bool is_instant_app = 6;
2029
2030 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002031 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002032
Bookatz80d11a02018-01-16 10:46:35 -08002033 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002034
David Chen0b5c90c2018-01-25 16:51:49 -08002035 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002036 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002037 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002038 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002039 optional int32 bind_application_delay_millis = 11;
2040 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002041
2042 // Empty if not set.
2043 optional string launch_token = 13;
2044
Calin Juravle759fbda2018-02-20 19:52:30 +00002045 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002046 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002047
2048 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002049 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002050}
2051
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002052message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002053 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002054 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002055
2056 // The app package name.
2057 optional string pkg_name = 2;
2058
2059 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002060 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002061 WARM = 1;
2062 HOT = 2;
2063 COLD = 3;
2064 }
2065 // The transition type.
2066 optional TransitionType type = 3;
2067
2068 // The activity name.
2069 optional string activity_name = 4;
2070}
2071
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002072message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002073 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002074 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002075
2076 // The app package name.
2077 optional string pkg_name = 2;
2078
2079 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002080 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002081 WITH_BUNDLE = 1;
2082 WITHOUT_BUNDLE = 2;
2083 }
2084 // The transition type.
2085 optional TransitionType type = 3;
2086
2087 // The activity name.
2088 optional string activity_name = 4;
2089
2090 optional bool transition_process_running = 5;
2091
2092 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002093 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002094}
2095
Bookatz8fcd09a2017-12-18 13:01:10 -08002096/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002097 * Logs a picture-in-picture action
2098 * Logged from:
2099 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2100 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2101 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2102 */
2103message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002104 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002105 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002106
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002107 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002108
Chenjie Yu52cacc62017-12-08 18:11:45 -08002109 enum State {
2110 ENTERED = 1;
2111 EXPANDED_TO_FULL_SCREEN = 2;
2112 MINIMIZED = 3;
2113 DISMISSED = 4;
2114 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002115 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002116}
2117
2118/**
Chenjie Yue8904192017-12-08 19:12:57 -08002119 * Logs overlay action
2120 * Logged from:
2121 * services/core/java/com/android/server/wm/Session.java
2122 */
2123message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002124 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002125
2126 optional string package_name = 2;
2127
2128 optional bool using_alert_window = 3;
2129
2130 enum State {
2131 ENTERED = 1;
2132 EXITED = 2;
2133 }
2134 optional State state = 4;
2135}
2136
Chenjie Yuccfe6452018-01-30 11:33:21 -08002137/*
2138 * Logs foreground service starts and stops.
2139 * Note that this is not when a service starts or stops, but when it is
2140 * considered foreground.
2141 * Logged from
2142 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2143 */
2144message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002145 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002146 // package_name + "/" + class_name
2147 optional string short_name = 2;
2148
2149 enum State {
2150 ENTER = 1;
2151 EXIT = 2;
2152 }
2153 optional State state = 3;
2154}
2155
Chenjie Yue8904192017-12-08 19:12:57 -08002156/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002157 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2158 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2159 * attributed back to the parent (host) uid. One example is Chrome.
2160 *
2161 * Logged from:
2162 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2163 */
2164message IsolatedUidChanged {
2165 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002166 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002167 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002168 optional int32 parent_uid = 1;
2169
2170 optional int32 isolated_uid = 2;
2171
2172 // We expect an isolated uid to be removed before if it's used for another parent uid.
2173 enum Event {
2174 REMOVED = 0;
2175 CREATED = 1;
2176 }
2177 optional Event event = 3;
2178}
2179
2180/*
2181 * Logs the reception of an incoming network packet causing the main system to wake up for
2182 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2183 * and processed by WakeupController.cpp.
2184 */
2185message PacketWakeupOccurred {
2186 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2187 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002188 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002189 // The interface name on which the packet was received.
2190 optional string iface = 2;
2191 // The ethertype value of the packet.
2192 optional int32 ethertype = 3;
2193 // String representation of the destination MAC address of the packet.
2194 optional string destination_hardware_address = 4;
2195 // String representation of the source address of the packet if this was an IP packet.
2196 optional string source_ip = 5;
2197 // String representation of the destination address of the packet if this was an IP packet.
2198 optional string destination_ip = 6;
2199 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2200 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2201 // families.
2202 optional int32 ip_next_header = 7;
2203 // The source port if this was a TCP or UDP packet.
2204 optional int32 source_port = 8;
2205 // The destination port if this was a TCP or UDP packet.
2206 optional int32 destination_port = 9;
2207}
2208
2209/*
2210 * Logs the memory stats for an app on startup.
2211 * Logged from:
2212 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2213 */
2214message AppStartMemoryStateCaptured {
2215 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002216 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002217
2218 // The process name.
2219 optional string process_name = 2;
2220
2221 // The activity name.
2222 optional string activity_name = 3;
2223
2224 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002225 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002226
2227 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002228 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002229
2230 // RSS
2231 optional int64 rss_in_bytes = 6;
2232
2233 // CACHE
2234 optional int64 cache_in_bytes = 7;
2235
2236 // SWAP
2237 optional int64 swap_in_bytes = 8;
2238}
2239
2240/*
2241 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2242 * for LMK event.
2243 * Logged from:
2244 * system/core/lmkd/lmkd.c
2245 */
2246message LmkStateChanged {
2247 enum State {
2248 UNKNOWN = 0;
2249 START = 1;
2250 STOP = 2;
2251 }
2252 optional State state = 1;
2253}
2254
2255/*
2256 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2257 * Logged from:
2258 * system/core/lmkd/lmkd.c
2259 */
2260message LmkKillOccurred {
2261 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002262 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002263
2264 // The process name.
2265 optional string process_name = 2;
2266
2267 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002268 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002269
2270 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002271 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002272
2273 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002274 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002275
2276 // RSS
2277 optional int64 rss_in_bytes = 6;
2278
2279 // CACHE
2280 optional int64 cache_in_bytes = 7;
2281
2282 // SWAP
2283 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002284
2285 // The elapsed real time of start of the process.
2286 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002287}
2288
Rajeev Kumar51b54602018-03-01 12:18:26 -08002289/*
2290 * Logs when the ActivityManagerService detects that an app died.
2291 *
2292 * Logged from:
2293 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2294 */
2295message AppDied {
2296 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002297 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002298}
2299
Howard Ro21a039c2018-08-06 14:55:47 -07002300/**
2301 * An atom for generic metrics logging. Available from Android Q.
2302 */
2303message GenericAtom {
2304 // The uid of the application that sent this custom atom.
2305 optional int32 uid = 1 [(is_uid) = true];
2306
2307 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002308 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002309}
2310
Tej Singhd6d6d772018-09-05 17:41:25 -07002311/**
2312 * Logs when a fingerprint acquire event occurs.
2313 *
2314 * Logged from:
2315 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2316 */
2317message FingerprintAcquired {
2318 // The associated user. Eg: 0 for owners, 10+ for others.
2319 // Defined in android/os/UserHandle.java
2320 optional int32 user = 1;
2321 // If this acquire is for a crypto fingerprint.
2322 // e.g. Secure purchases, unlock password storage.
2323 optional bool is_crypto = 2;
2324}
2325
2326/**
2327 * Logs when a fingerprint authentication event occurs.
2328 *
2329 * Logged from:
2330 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2331 */
2332message FingerprintAuthenticated {
2333 // The associated user. Eg: 0 for owners, 10+ for others.
2334 // Defined in android/os/UserHandle.java
2335 optional int32 user = 1;
2336 // If this authentication is for a crypto fingerprint.
2337 // e.g. Secure purchases, unlock password storage.
2338 optional bool is_crypto = 2;
2339 // Whether or not this authentication was successful.
2340 optional bool is_authenticated = 3;
2341}
2342
2343/**
2344 * Logs when a fingerprint error occurs.
2345 *
2346 * Logged from:
2347 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2348 */
2349message FingerprintErrorOccurred {
2350 // The associated user. Eg: 0 for owners, 10+ for others.
2351 // Defined in android/os/UserHandle.java
2352 optional int32 user = 1;
2353 // If this error is for a crypto fingerprint.
2354 // e.g. Secure purchases, unlock password storage.
2355 optional bool is_crypto = 2;
2356
2357 enum Error {
2358 UNKNOWN = 0;
2359 LOCKOUT = 1;
2360 PERMANENT_LOCKOUT = 2;
2361 }
2362 // The type of error.
2363 optional Error error = 3;
2364}
Howard Ro688ae182018-09-25 00:09:36 -07002365
2366message Notification {
2367
2368 // Type of notification event.
2369 enum Type {
2370 TYPE_UNKNOWN = 0;
2371 // Notification became visible to the user.
2372 TYPE_OPEN = 1;
2373 // Notification became hidden.
2374 TYPE_CLOSE = 2;
2375 // Notification switched to detail mode.
2376 TYPE_DETAIL = 3;
2377 // Notification was clicked.
2378 TYPE_ACTION = 4;
2379 // Notification was dismissed.
2380 TYPE_DISMISS = 5;
2381 // Notification switched to summary mode. The enum value of 14 is to
2382 // match that of metrics_constants.
2383 TYPE_COLLAPSE = 14;
2384 }
2385 optional Type type = 1;
2386
2387 // Package name associated with the notification.
2388 optional string package_name = 2;
2389
2390 // Tag associated with notification.
2391 optional string tag = 3;
2392
2393 // Application-supplied ID associated with the notification.
2394 optional int32 id = 4;
2395
2396 // Index of notification in the notification panel.
2397 optional int32 shade_index = 5;
2398
2399 // The number of notifications in the notification panel.
2400 optional int32 shade_count = 6;
2401
2402 // Importance for the notification.
2403 optional int32 importance = 7;
2404
2405 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002406 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002407
2408 // Importance for the notification channel.
2409 optional int32 channel_importance = 9;
2410
Howard Ro183c2bd2018-10-18 13:52:10 -07002411 // Application-supplied ID associated with the notifications group.
2412 optional string group_id = 10;
2413
Howard Ro688ae182018-09-25 00:09:36 -07002414 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002415 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002416
Howard Ro183c2bd2018-10-18 13:52:10 -07002417 // Reason for dismissal of a notification. This field is only meaningful for
2418 // TYPE_DISMISS events.
2419 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002420
Howard Ro183c2bd2018-10-18 13:52:10 -07002421 // The first post time of notification, stable across updates.
2422 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002423
Howard Ro183c2bd2018-10-18 13:52:10 -07002424 // The most recent interruption time, or the creation time if no updates.
2425 // Differs from update_millis because updates are filtered based on whether
2426 // they actually interrupted the user.
2427 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002428
Howard Ro183c2bd2018-10-18 13:52:10 -07002429 // The most recent update time, or the creation time if no updates.
2430 optional int64 update_millis = 15;
2431
2432 // The most recent visibility event.
2433 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002434}
2435
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002436/*
Yangster-macb89807e2018-11-15 21:10:57 -08002437 * Logs when a flag flip state changes.
2438 * Logged in P/h.
2439 */
2440message PhenotypeFlagStateChanged {
2441 // Mendel configuration name.
2442 optional string mendel_config_name = 1;
2443 // State
2444 enum State {
2445 STATE_UNKNOWN = 0;
2446 COMMITTED = 1;
2447 }
2448 optional State state = 2;
2449}
2450
2451/*
2452 * Logs when a binary push state changes.
2453 * Logged in Play store
2454 */
2455message BinaryPushStateChanged {
2456 // Binary package name.
2457 optional string binary_name = 1;
2458 // Version code.
2459 optional int64 version = 2;
2460 // State
2461 enum State {
2462 STATE_UNKNOWN = 0;
2463 DOWNLOAD_START = 1;
2464 DOWNLOAD_DONE = 2;
2465 INSTALL_START = 3;
2466 INSTALL_DONE = 4;
2467 REBOOT_START = 5;
2468 REBOOT_DONE = 6;
2469 }
2470 optional State state = 3;
2471}
2472
Maggie Whitefc1aa592018-11-28 21:55:23 -08002473/** Represents USB port overheat event. */
2474message UsbPortOverheatEvent {
2475 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
2476 optional int32 plug_temperature_deci_c = 1;
2477
2478 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
2479 optional int32 max_temperature_deci_c = 2;
2480
2481 /* Time between USB plug event and overheat threshold trip, in seconds. */
2482 optional int32 time_to_overheat_secs = 3;
2483
2484 /* Time between overheat threshold trip and hysteresis, in seconds. */
2485 optional int32 time_to_hysteresis_secs = 4;
2486
2487 /* Time between hysteresis and active mitigation ending, in seconds. */
2488 optional int32 time_to_inactive_secs = 5;
2489};
2490
Maggie White8735b852019-01-18 11:40:49 -08002491/**
2492 * Logs total effective full charge and discharge cycles on a battery.
2493 * Here are some examples of one effective cycle:
2494 * 1) the battery charges from 0% to 100% and drains back to 0%,
2495 * 2) charging from 50% to 100% and draining back to 50% twice.
2496 * Pulled from:
2497 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2498 */
2499message BatteryCycleCount {
2500 /* Number of total charge and discharge cycles on the system battery. */
2501 optional int32 cycle_count = 1;
2502}
2503
Yangster-macb89807e2018-11-15 21:10:57 -08002504/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002505 * Logs when a connection becomes available and lost.
2506 * Logged in StatsCompanionService.java
2507 */
2508message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002509 // Id of the network.
2510 optional int32 net_id = 1;
2511
2512 enum State {
2513 UNKNOWN = 0;
2514 CONNECTED = 1;
2515 DISCONNECTED = 2;
2516 }
2517 // Connected state of a network.
2518 optional State state = 2;
2519}
2520
2521/**
2522 * Logs when a service starts and stops.
2523 * Logged from:
2524 * services/core/java/com/android/server/am/ActiveServices.java
2525 */
2526message ServiceStateChanged {
2527
2528 optional int32 uid = 1 [(is_uid) = true];
2529
2530 optional string package_name = 2;
2531
2532 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002533
2534 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002535 START = 1;
2536 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002537 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07002538
2539 optional State state = 4;
2540}
2541
2542/**
2543 * Logs when a service is launched.
2544 * Logged from:
2545 * services/core/java/com/android/server/am/ActiveServices.java
2546 */
2547message ServiceLaunchReported {
2548
2549 optional int32 uid = 1 [(is_uid) = true];
2550
2551 optional string package_name = 2;
2552
2553 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002554}
Howard Ro688ae182018-09-25 00:09:36 -07002555
Chenjie Yubbcbc602018-02-05 16:51:52 -08002556//////////////////////////////////////////////////////////////////////
2557// Pulled atoms below this line //
2558//////////////////////////////////////////////////////////////////////
2559
2560/**
David Chenc8a43242017-10-17 16:23:28 -07002561 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2562 *
2563 * Pulled from:
2564 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2565 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002566message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002567 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002568
2569 optional int64 rx_bytes = 2;
2570
2571 optional int64 rx_packets = 3;
2572
2573 optional int64 tx_bytes = 4;
2574
2575 optional int64 tx_packets = 5;
2576}
2577
2578/**
2579 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2580 *
2581 * Pulled from:
2582 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2583 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002584message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002585 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002586
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002587 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2588 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002589
2590 optional int64 rx_bytes = 3;
2591
2592 optional int64 rx_packets = 4;
2593
2594 optional int64 tx_bytes = 5;
2595
2596 optional int64 tx_packets = 6;
2597}
2598
2599/**
2600 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2601 *
2602 * Pulled from:
2603 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2604 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002605message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002606 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002607
2608 optional int64 rx_bytes = 2;
2609
2610 optional int64 rx_packets = 3;
2611
2612 optional int64 tx_bytes = 4;
2613
2614 optional int64 tx_packets = 5;
2615}
2616
2617/**
2618 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2619 *
2620 * Pulled from:
2621 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2622 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002623message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002624 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002625
Yao Chenc40a19d2018-03-15 16:48:25 -07002626 // 1 denotes foreground and 0 denotes background. This is called Set in
2627 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002628 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002629
2630 optional int64 rx_bytes = 3;
2631
2632 optional int64 rx_packets = 4;
2633
2634 optional int64 tx_bytes = 5;
2635
2636 optional int64 tx_packets = 6;
2637}
2638
2639/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002640 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2641 *
2642 * Pulled from:
2643 * StatsCompanionService
2644 */
2645message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002646 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002647
2648 optional int64 rx_bytes = 2;
2649
2650 optional int64 tx_bytes = 3;
2651}
2652
2653/**
David Chenc8a43242017-10-17 16:23:28 -07002654 * Pulls the kernel wakelock durations. This atom is adapted from
2655 * android/internal/os/KernelWakelockStats.java
2656 *
2657 * Pulled from:
2658 * StatsCompanionService using KernelWakelockReader.
2659 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002660message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002661 optional string name = 1;
2662
2663 optional int32 count = 2;
2664
2665 optional int32 version = 3;
2666
Yangster-maca8a30442018-10-13 23:46:34 -07002667 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002668}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002669
Chenjie Yu05013b32017-11-21 10:21:41 -08002670/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002671 * Pulls low power state information. If power.stats HAL is not available, this
2672 * includes platform and subsystem sleep state information,
2673 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
2674 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002675 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002676 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002677 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
2678 * as defined in:
2679 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002680 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002681message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002682 // Subsystem name
2683 optional string subsystem_name = 1;
2684 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2685 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002686 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
2687 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002688 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002689 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002690 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002691 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002692 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002693}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002694
Chenjie Yu05013b32017-11-21 10:21:41 -08002695/**
Bookatz92da2832018-11-01 18:10:03 -07002696 * Pulls on-device power measurement information.
2697 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
2698 * Pulled from:
2699 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
2700 */
2701message OnDevicePowerMeasurement {
2702 // Name of the subsystem (to which the rail belongs).
2703 optional string subsystem_name = 1;
2704
2705 // Rail name. The rail lies within the subsystem.
2706 optional string rail_name = 2;
2707
2708 // Time (in ms since boot) at which the rail energy value was measured.
2709 // This may differ slightly from the time that statsd logs this information.
2710 optional uint64 measurement_timestamp_millis = 3;
2711
2712 // Accumulated energy used via the rail since device boot in uWs.
2713 optional uint64 energy_microwatt_secs = 4;
2714}
2715
2716/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002717 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002718 * Pulls the time the cpu spend on the frequency index. Frequency index
2719 * starts from highest to lowest. The value should be monotonically
2720 * increasing since boot. However, if there is a cpu
2721 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002722 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002723message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002724 optional uint32 cluster = 1;
2725 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002726 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002727}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002728
Chenjie Yu05013b32017-11-21 10:21:41 -08002729/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002730 * Pulls Cpu Time Per Uid.
2731 * Note that isolated process uid time should be attributed to host uids.
2732 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002733message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002734 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002735 optional uint64 user_time_micros = 2;
2736 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002737}
2738
2739/**
2740 * Pulls Cpu Time Per Uid per frequency.
2741 * Note that isolated process uid time should be attributed to host uids.
2742 * For each uid, we order the time by descending frequencies.
2743 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002744message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002745 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002746 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002747 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002748}
Hugo Benichi884970e2017-11-14 22:42:46 +09002749
Chenjie Yu05013b32017-11-21 10:21:41 -08002750/**
2751 * Pulls Wifi Controller Activity Energy Info
2752 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002753message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002754 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002755 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002756 // stack reported state
2757 // TODO: replace this with proto enum
2758 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002759 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002760 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002761 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002762 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002763 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002764 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002765 // product of current(mA), voltage(V) and time(ms)
2766 optional uint64 controller_energy_used = 6;
2767}
2768
2769/**
2770 * Pulls Modem Activity Energy Info
2771 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002772message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002773 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002774 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002775 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002776 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002777 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002778 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002779 /**
2780 * Tx power index
2781 * index 0 = tx_power < 0dBm
2782 * index 1 = 0dBm < tx_power < 5dBm
2783 * index 2 = 5dBm < tx_power < 15dBm
2784 * index 3 = 15dBm < tx_power < 20dBm
2785 * index 4 = tx_power > 20dBm
2786 */
2787 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002788 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002789 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002790 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002791 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002792 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002793 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002794 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002795 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002796 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002797 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002798 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002799 // product of current(mA), voltage(V) and time(ms)
2800 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002801}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002802
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002803/**
2804 * Pulls Bluetooth Activity Energy Info
2805 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2806 */
2807message BluetoothActivityInfo {
2808 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002809 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002810 // bluetooth stack state
2811 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002812 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002813 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002814 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002815 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002816 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002817 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002818 // product of current(mA), voltage(V) and time(ms)
2819 optional uint64 energy_used = 6;
2820}
2821
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002822/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002823 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002824 *
2825 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002826 */
2827message ProcessMemoryState {
2828 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002829 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002830
2831 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002832 // Usually package name, "system" for system server.
2833 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002834 optional string process_name = 2;
2835
Rafal Slawikda51b932018-12-13 16:31:33 +00002836 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07002837 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002838
2839 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002840 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002841
2842 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002843 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002844
Rajeev Kumar90235992018-01-29 11:06:48 -08002845 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002846 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
2847 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08002848 optional int64 rss_in_bytes = 6;
2849
2850 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00002851 // Value is read from memory.stat, field total_cache if per-app memory
2852 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002853 optional int64 cache_in_bytes = 7;
2854
2855 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00002856 // Value is read from memory.stat, field total_swap if per-app memory
2857 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002858 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002859
Rafal Slawikd03ae422018-11-20 11:27:45 +00002860 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002861 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00002862
2863 // Elapsed real time when the process started.
2864 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
2865 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002866}
2867
2868/*
Rafal Slawik08621582018-10-15 14:53:07 +01002869 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00002870 *
2871 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01002872 */
2873message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01002874 // The uid if available. -1 means not available.
2875 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01002876
Rafal Slawikbf67d072018-10-23 11:07:54 +01002877 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002878 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002879 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01002880
Rafal Slawikbf67d072018-10-23 11:07:54 +01002881 // # of page-faults
2882 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002883
Rafal Slawikbf67d072018-10-23 11:07:54 +01002884 // # of major page-faults
2885 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002886
Rafal Slawikbf67d072018-10-23 11:07:54 +01002887 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002888 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002889 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01002890
Rafal Slawikd03ae422018-11-20 11:27:45 +00002891 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002892 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01002893
2894 // Elapsed real time when the process started.
2895 // Value is read from /proc/PID/stat, field 22.
2896 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01002897}
2898
2899/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00002900 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002901 *
2902 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
2903 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00002904 *
2905 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002906 */
2907message ProcessMemoryHighWaterMark {
2908 // The uid if available. -1 means not available.
2909 optional int32 uid = 1 [(is_uid) = true];
2910
Rafal Slawikda51b932018-12-13 16:31:33 +00002911 // The process name.
2912 // Usually package name or process cmdline.
2913 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002914 optional string process_name = 2;
2915
2916 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
2917 // /proc/PID/status.
2918 optional int64 rss_high_water_mark_in_bytes = 3;
2919}
2920
2921/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002922 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002923 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002924message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002925 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002926}
2927
2928/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002929 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002930 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002931message SystemUptime {
2932 // Milliseconds since the system was booted.
2933 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2934 // for external input).
2935 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002936 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002937}
2938
2939/*
2940 * Reads from /proc/uid_concurrent_active_time which has the format:
2941 * active: X (X is # cores)
2942 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2943 * [uid1]: [time-0] [time-1] [time-2] ... ...
2944 * ...
2945 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2946 * The file contains a monotonically increasing count of time for a single boot.
2947 */
2948message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002949 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002950 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002951}
2952
2953/**
2954 * Reads from /proc/uid_concurrent_policy_time which has the format:
2955 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2956 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2957 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2958 * ...
2959 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2960 * The file contains a monotonically increasing count of time for a single boot.
2961 */
2962message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002963 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002964 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002965 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002966}
2967
2968/*
2969 * Pulls free disk space, for data, system partition and temporary directory.
2970 */
2971message DiskSpace {
2972 // available bytes in data partition
2973 optional uint64 data_available_bytes = 1;
2974 // available bytes in system partition
2975 optional uint64 system_available_bytes = 2;
2976 // available bytes in download cache or temp directories
2977 optional uint64 temp_available_bytes = 3;
2978}
Tej Singhbf972d92018-01-10 20:51:13 -08002979
2980/**
2981 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002982 * Pulled from:
2983 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002984 */
2985message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002986 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08002987}
2988
2989/**
2990 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002991 * Pulled from:
2992 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002993 */
2994message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002995 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08002996}
2997
2998/**
Bookatz17f0d8a2018-09-13 12:56:32 -07002999 * Pulls battery voltage.
3000 * Pulled from:
3001 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3002 */
3003message BatteryVoltage {
3004 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003005 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003006}
3007
3008/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003009 * Pulls battery level (percent full, from 0 to 100).
3010 *
3011 * Pulled from:
3012 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3013 */
3014message BatteryLevel {
3015 // Battery level. Should be in [0, 100].
3016 optional int32 battery_level = 1;
3017}
3018
3019/**
Tej Singhd89137e2018-03-26 14:51:40 -07003020 * Pulls the temperature of various parts of the device.
3021 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003022 *
3023 * Pulled from:
3024 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3025 */
3026message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003027 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003028 optional android.os.TemperatureTypeEnum sensor_location = 1;
3029
3030 // The name of the temperature source. Eg. CPU0
3031 optional string sensor_name = 2;
3032
Tej Singhd89137e2018-03-26 14:51:40 -07003033 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003034 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003035 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003036}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003037
3038/**
3039 * Pulls the statistics of calls to Binder.
3040 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003041 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3042 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003043 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003044 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003045 */
3046message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003047 // UID of the process responsible for the binder transaction. It will be set if the process
3048 // executing the binder transaction attribute the transaction to another uid using
3049 // Binder.setThreadWorkSource().
3050 //
3051 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003052 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003053 // UID of the process executing the binder transaction.
3054 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003055 // Fully qualified class name of the API call.
3056 //
3057 // This is a system server class name.
3058 //
3059 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3060 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3061 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3062 // commonly used APIs.
3063 optional string service_class_name = 2;
3064 // Method name of the API call. It can also be a transaction code if we cannot
3065 // resolve it to a name. See Binder#getTransactionName.
3066 //
3067 // This is a system server method name.
3068 optional string service_method_name = 3;
3069 // Total number of API calls.
3070 optional int64 call_count = 4;
3071 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3072 optional bool screen_interactive = 13;
3073 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3074 // call_count will be equal to recorded_call_count.
3075 //
3076 // If recorded_call_count is different than call_count, it means data collection has been
3077 // sampled. All the fields below will be sampled in this case.
3078 optional int64 recorded_call_count = 12;
3079 // Number of exceptions thrown by the API.
3080 optional int64 recorded_exception_count = 5;
3081 // Total latency of all API calls.
3082 // Average can be computed using total_latency_micros / recorded_call_count.
3083 optional int64 recorded_total_latency_micros = 6;
3084 // Maximum latency of one API call.
3085 optional int64 recorded_max_latency_micros = 7;
3086 // Total CPU usage of all API calls.
3087 // Average can be computed using total_cpu_micros / recorded_call_count.
3088 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3089 optional int64 recorded_total_cpu_micros = 8;
3090 // Maximum CPU usage of one API call.
3091 optional int64 recorded_max_cpu_micros = 9;
3092 // Maximum parcel reply size of one API call.
3093 optional int64 recorded_max_reply_size_bytes = 10;
3094 // Maximum parcel request size of one API call.
3095 optional int64 recorded_max_request_size_bytes = 11;
3096}
3097
3098/**
3099 * Pulls the statistics of exceptions during calls to Binder.
3100 *
3101 * Binder stats are cumulative from boot unless somebody reset the data using
3102 * > adb shell dumpsys binder_calls_stats --reset
3103 */
3104message BinderCallsExceptions {
3105 // Exception class name, e.g. java.lang.IllegalArgumentException.
3106 //
3107 // This is an exception class name thrown by the system server.
3108 optional string exception_class_name = 1;
3109 // Total number of exceptions.
3110 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003111}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003112
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003113/**
3114 * Pulls the statistics of message dispatching on HandlerThreads.
3115 *
3116 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3117 * config on the device.
3118 *
3119 * Next tag: 11
3120 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003121message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003122 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003123 optional int32 uid = 1 [(is_uid) = true];
3124
3125 // Fully qualified class name of the handler target class.
3126 //
3127 // This field does not contain PII. This is a system server class name.
3128 optional string handler_class_name = 2;
3129
3130 // The name of the thread that runs the Looper.
3131 //
3132 // This field does not contain PII. This is a system server thread name.
3133 optional string looper_thread_name = 3;
3134
3135 // The name of the dispatched message.
3136 //
3137 // This field does not contain PII. This is a system server constant or class
3138 // name.
3139 optional string message_name = 4;
3140
3141 // Total number of successfully dispatched messages.
3142 optional int64 message_count = 5;
3143
3144 // Total number of messages that failed dispatching.
3145 optional int64 exception_count = 6;
3146
3147 // Total number of processed messages we have data recorded for. If we
3148 // collected data for all the messages, message_count will be equal to
3149 // recorded_message_count.
3150 //
3151 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003152 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003153 optional int64 recorded_message_count = 7;
3154
3155 // Total latency of all processed messages.
3156 // Average can be computed using recorded_total_latency_micros /
3157 // recorded_message_count.
3158 optional int64 recorded_total_latency_micros = 8;
3159
3160 // Total CPU usage of all processed message.
3161 // Average can be computed using recorded_total_cpu_micros /
3162 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003163 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003164 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003165
3166 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3167 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003168
3169 // Max recorded CPU usage of all processed messages.
3170 optional int64 recorded_max_cpu_micros = 11;
3171
3172 // Max recorded latency of all processed messages.
3173 optional int64 recorded_max_latency_micros = 12;
3174
3175 // Total number of messages we tracked the dispatching delay for. If we
3176 // collected data for all the messages, message_count will be equal to
3177 // recorded_delay_message_count.
3178 //
3179 // If recorded_delay_message_count is different than message_count, it means data
3180 // collection has been sampled or/and not all messages specified the target dispatch time.
3181 // The fields below will be sampled in this case.
3182 optional int64 recorded_delay_message_count = 13;
3183
3184 // Total dispatching delay of all processed messages.
3185 // Calculated as a difference between the target dispatching time (Message.when)
3186 // and the actual dispatching time.
3187 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3188 optional int64 recorded_total_delay_millis = 14;
3189
3190 // Max dispatching delay of all processed messages.
3191 // Calculated as a difference between the target dispatching time (Message.when)
3192 // and the actual dispatching time.
3193 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003194}
Tej Singh86dc9db2018-09-06 00:39:57 +00003195
3196/**
3197 * Pulls disk information, such as write speed and latency.
3198 */
3199message DiskStats {
3200 // Time taken to open, write 512B to, and close a file.
3201 // -1 if error performing the check.
3202 optional int64 data_write_latency_millis = 1;
3203
3204 optional bool file_based_encryption = 2;
3205
3206 // Recent disk write speed in kB/s.
3207 // -1 if error querying storageed.
3208 // 0 if data is unavailable.
3209 optional int32 recent_disk_write_speed = 3;
3210}
3211
3212
3213/**
3214 * Free and total bytes of the Data, Cache, and System partition.
3215 */
3216message DirectoryUsage {
3217 enum Directory {
3218 UNKNOWN = 0;
3219 DATA = 1;
3220 CACHE = 2;
3221 SYSTEM = 3;
3222 }
3223 optional Directory directory = 1;
3224 optional int64 free_bytes = 2;
3225 optional int64 total_bytes = 3;
3226}
3227
3228
3229/**
3230 * Size of an application: apk size, data size, and cache size.
3231 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3232 * Information is only reported for apps with the primary user (user 0).
3233 * Sizes are aggregated by package name.
3234 */
3235message AppSize {
3236 // Including uids will involve modifying diskstats logic.
3237 optional string package_name = 1;
3238 // App size in bytes. -1 if unavailable.
3239 optional int64 app_size_bytes = 2;
3240 // App data size in bytes. -1 if unavailable.
3241 optional int64 app_data_size_bytes = 3;
3242 // App cache size in bytes. -1 if unavailable.
3243 optional int64 app_cache_size_bytes = 4;
3244 // Time that the cache file was produced.
3245 // Uses System.currentTimeMillis(), which is wall clock time.
3246 optional int64 cache_time_millis = 5;
3247}
3248
3249
3250/**
3251 * Size of a particular category. Eg: photos, videos.
3252 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3253 */
3254message CategorySize {
3255 enum Category {
3256 UNKNOWN = 0;
3257 APP_SIZE = 1;
3258 APP_DATA_SIZE = 2;
3259 APP_CACHE_SIZE = 3;
3260 PHOTOS = 4;
3261 VIDEOS = 5;
3262 AUDIO = 6;
3263 DOWNLOADS = 7;
3264 SYSTEM = 8;
3265 OTHER = 9;
3266 }
3267 optional Category category = 1;
3268 // Category size in bytes.
3269 optional int64 size_bytes = 2;
3270 // Time that the cache file was produced.
3271 // Uses System.currentTimeMillis(), which is wall clock time.
3272 optional int64 cache_time_millis = 3;
3273}
Tej Singhd6d6d772018-09-05 17:41:25 -07003274
3275/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003276 * Pulls per uid I/O stats. The stats are cumulative since boot.
3277 *
3278 * Read/write bytes are I/O events from a storage device
3279 * Read/write chars are data requested by read/write syscalls, and can be
3280 * satisfied by caching.
3281 *
3282 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3283 */
3284message DiskIo {
3285 optional int32 uid = 1 [(is_uid) = true];
3286 optional int64 fg_chars_read = 2;
3287 optional int64 fg_chars_write = 3;
3288 optional int64 fg_bytes_read = 4;
3289 optional int64 fg_bytes_write = 5;
3290 optional int64 bg_chars_read = 6;
3291 optional int64 bg_chars_write = 7;
3292 optional int64 bg_bytes_read = 8;
3293 optional int64 bg_bytes_write = 9;
3294 optional int64 fg_fsync = 10;
3295 optional int64 bg_fsync= 11;
3296}
3297
3298
3299/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003300 * Pulls the number of fingerprints for each user.
3301 *
3302 * Pulled from StatsCompanionService, which queries FingerprintManager.
3303 */
3304message NumFingerprints {
3305 // The associated user. Eg: 0 for owners, 10+ for others.
3306 // Defined in android/os/UserHandle.java
3307 optional int32 user = 1;
3308 // Number of fingerprints registered to that user.
3309 optional int32 num_fingerprints = 2;
3310}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003311
Yangsteraf9aee72018-10-12 09:26:16 -07003312message AggStats {
3313 optional int64 min = 1;
3314
3315 optional int64 average = 2;
3316
3317 optional int64 max = 3;
3318}
3319
3320message ProcessStatsStateProto {
3321 optional android.service.procstats.ScreenState screen_state = 1;
3322
3323 optional android.service.procstats.MemoryState memory_state = 2;
3324
3325 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3326 // and not frameworks/base/core/java/android/app/ActivityManager.java
3327 optional android.service.procstats.ProcessState process_state = 3;
3328
3329 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003330 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003331
3332 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003333 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003334
3335 // # of samples taken
3336 optional int32 sample_size = 5;
3337
3338 // PSS is memory reserved for this process
3339 optional AggStats pss = 6;
3340
3341 // USS is memory shared between processes, divided evenly for accounting
3342 optional AggStats uss = 7;
3343
3344 // RSS is memory resident for this process
3345 optional AggStats rss = 8;
3346}
3347
3348// Next Tag: 7
3349message ProcessStatsProto {
3350 // Name of process.
3351 optional string process = 1;
3352
3353 // Uid of the process.
3354 optional int32 uid = 2;
3355
3356 // Information about how often kills occurred
3357 message Kill {
3358 // Count of excessive CPU kills
3359 optional int32 cpu = 1;
3360
3361 // Count of kills when cached
3362 optional int32 cached = 2;
3363
3364 // PSS stats during cached kill
3365 optional AggStats cached_pss = 3;
3366 }
3367 optional Kill kill = 3;
3368
3369 // Time and memory spent in various states.
3370 repeated ProcessStatsStateProto states = 5;
3371
3372 // Total time process has been running... screen_state, memory_state, and process_state
3373 // will not be set.
3374 optional ProcessStatsStateProto total_running_state = 6;
3375}
3376
3377message PackageServiceOperationStatsProto {
3378 // Operate enum: Started, Foreground, Bound, Executing
3379 optional android.service.procstats.ServiceOperationState operation = 1;
3380
3381 // Number of times the service was in this operation.
3382 optional int32 count = 2;
3383
3384 // Information about a state the service can be in.
3385 message StateStats {
3386 // Screen state enum.
3387 optional android.service.procstats.ScreenState screen_state = 1;
3388 // Memory state enum.
3389 optional android.service.procstats.MemoryState memory_state = 2;
3390
3391 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07003392 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003393 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003394 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003395 }
3396 repeated StateStats state_stats = 3;
3397}
3398
3399message PackageServiceStatsProto {
3400 // Name of service component.
3401 optional string service_name = 1;
3402
3403 // The operation stats.
3404 // The package_name, package_uid, package_version, service_name will not be set to save space.
3405 repeated PackageServiceOperationStatsProto operation_stats = 2;
3406}
3407
3408message PackageAssociationSourceProcessStatsProto {
3409 // Uid of the process.
3410 optional int32 process_uid = 1;
3411 // Process name.
3412 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08003413 // Package name.
3414 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07003415 // Total count of the times this association appeared.
3416 optional int32 total_count = 3;
3417
3418 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07003419 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003420
3421 // Total count of the times this association became actively impacting its target process.
3422 optional int32 active_count = 5;
3423
3424 // Information on one source in this association.
3425 message StateStats {
3426 // Process state enum.
3427 optional android.service.procstats.ProcessState process_state = 1;
3428 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003429 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003430 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003431 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003432 }
3433 repeated StateStats active_state_stats = 6;
3434}
3435
3436message PackageAssociationProcessStatsProto {
3437 // Name of the target component.
3438 optional string component_name = 1;
3439 // Information on one source in this association.
3440 repeated PackageAssociationSourceProcessStatsProto sources = 2;
3441}
3442
3443
3444message ProcessStatsPackageProto {
3445 // Name of package.
3446 optional string package = 1;
3447
3448 // Uid of the package.
3449 optional int32 uid = 2;
3450
3451 // Version of the package.
3452 optional int64 version = 3;
3453
3454 // Stats for each process running with the package loaded in to it.
3455 repeated ProcessStatsProto process_stats = 4;
3456
3457 // Stats for each of the package's services.
3458 repeated PackageServiceStatsProto service_stats = 5;
3459
3460 // Stats for each association with the package.
3461 repeated PackageAssociationProcessStatsProto association_stats = 6;
3462}
3463
3464message ProcessStatsSectionProto {
3465 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003466 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07003467
3468 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003469 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003470
3471 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003472 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003473
3474 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003475 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003476
3477 // System runtime library. e.g. "libdvm.so", "libart.so".
3478 optional string runtime = 5;
3479
3480 // whether kernel reports swapped pss.
3481 optional bool has_swapped_pss = 6;
3482
3483 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
3484 enum Status {
3485 STATUS_UNKNOWN = 0;
3486 STATUS_COMPLETE = 1;
3487 STATUS_PARTIAL = 2;
3488 STATUS_SHUTDOWN = 3;
3489 STATUS_SYSPROPS = 4;
3490 }
3491 repeated Status status = 7;
3492
Chenjie Yub2ecc792019-01-17 10:27:26 -08003493 // Number of pages available of various types and sizes, representation fragmentation.
3494 repeated ProcessStatsAvailablePagesProto available_pages = 10;
3495
Yangsteraf9aee72018-10-12 09:26:16 -07003496 // Stats for each process.
3497 repeated ProcessStatsProto process_stats = 8;
3498
3499 // Stats for each package.
3500 repeated ProcessStatsPackageProto package_stats = 9;
3501}
3502
Chenjie Yub2ecc792019-01-17 10:27:26 -08003503message ProcessStatsAvailablePagesProto {
3504 // Node these pages are in (as per /proc/pagetypeinfo)
3505 optional int32 node = 1;
3506
3507 // Zone these pages are in (as per /proc/pagetypeinfo)
3508 optional string zone = 2;
3509
3510 // Label for the type of these pages (as per /proc/pagetypeinfo)
3511 optional string label = 3;
3512
3513 // Distribution of number of pages available by order size. First entry in array is
3514 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
3515 repeated int32 pages_per_order = 4;
3516}
3517
Chenjie Yu12e5e672018-09-14 15:54:59 -07003518/**
3519 * Pulled from ProcessStatsService.java
3520 */
3521message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07003522 optional ProcessStatsSectionProto proc_stats_section = 1;
3523}
3524
Chenjie Yuf910b7802019-01-11 16:08:20 -08003525/**
3526 * Pulled from ProcessStatsService.java
3527 */
3528message ProcStatsPkgProc {
3529 optional ProcessStatsSectionProto proc_stats_section = 1;
3530}
3531
Yangsteraf9aee72018-10-12 09:26:16 -07003532message PowerProfileProto {
3533 optional double cpu_suspend = 1;
3534
3535 optional double cpu_idle = 2;
3536
3537 optional double cpu_active = 3;
3538
3539 message CpuCluster {
3540 optional int32 id = 1;
3541 optional double cluster_power = 2;
3542 optional int32 cores = 3;
3543 repeated int64 speed = 4;
3544 repeated double core_power = 5;
3545 }
3546
3547 repeated CpuCluster cpu_cluster = 40;
3548
3549 optional double wifi_scan = 4;
3550
3551 optional double wifi_on = 5;
3552
3553 optional double wifi_active = 6;
3554
3555 optional double wifi_controller_idle = 7;
3556
3557 optional double wifi_controller_rx = 8;
3558
3559 optional double wifi_controller_tx = 9;
3560
3561 repeated double wifi_controller_tx_levels = 10;
3562
3563 optional double wifi_controller_operating_voltage = 11;
3564
3565 optional double bluetooth_controller_idle = 12;
3566
3567 optional double bluetooth_controller_rx = 13;
3568
3569 optional double bluetooth_controller_tx = 14;
3570
3571 optional double bluetooth_controller_operating_voltage = 15;
3572
3573 optional double modem_controller_sleep = 16;
3574
3575 optional double modem_controller_idle = 17;
3576
3577 optional double modem_controller_rx = 18;
3578
3579 repeated double modem_controller_tx = 19;
3580
3581 optional double modem_controller_operating_voltage = 20;
3582
3583 optional double gps_on = 21;
3584
3585 repeated double gps_signal_quality_based = 22;
3586
3587 optional double gps_operating_voltage = 23;
3588
3589 optional double bluetooth_on = 24;
3590
3591 optional double bluetooth_active = 25;
3592
3593 optional double bluetooth_at_cmd = 26;
3594
3595 optional double ambient_display = 27;
3596
3597 optional double screen_on = 28;
3598
3599 optional double radio_on = 29;
3600
3601 optional double radio_scanning = 30;
3602
3603 optional double radio_active = 31;
3604
3605 optional double screen_full = 32;
3606
3607 optional double audio = 33;
3608
3609 optional double video = 34;
3610
3611 optional double flashlight = 35;
3612
3613 optional double memory = 36;
3614
3615 optional double camera = 37;
3616
3617 optional double wifi_batched_scan = 38;
3618
3619 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003620}
Chenjie Yuab530202018-09-26 12:39:20 -07003621
3622/**
3623 * power_profile.xml and other constants for power model calculations.
3624 * Pulled from PowerProfile.java
3625 */
3626message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003627 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003628}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003629
3630/**
arangelovd5db50e2018-10-12 20:24:39 +01003631 * Logs when a user restriction was added or removed.
3632 *
3633 * Logged from:
3634 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3635 */
3636message UserRestrictionChanged {
3637 // The raw string of the user restriction as defined in UserManager.
3638 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3639 optional string restriction = 1;
3640 // Whether the restriction is enabled or disabled.
3641 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07003642}
Yangster-mac308ea0c2018-10-22 13:10:25 -07003643
3644/**
3645 * Pulls process user time and system time. Puller takes a snapshot of all pids
3646 * in the system and returns cpu stats for those that are working at the time.
3647 * Dead pids will be dropped. Kernel processes are excluded.
3648 * Min cool-down is 5 sec.
3649 */
3650message ProcessCpuTime {
3651 optional int32 uid = 1 [(is_uid) = true];
3652
3653 optional string process_name = 2;
3654 // Process cpu time in user space, cumulative from boot/process start
3655 optional int64 user_time_millis = 3;
3656 // Process cpu time in system space, cumulative from boot/process start
3657 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01003658}
Misha Wagner5a51e002018-10-03 15:04:09 +01003659
3660/**
3661 * Pulls the CPU usage for each thread.
3662 *
3663 * Read from /proc/$PID/task/$TID/time_in_state files.
3664 *
3665 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
3666 * time_in_state files not being present on some phones, have not been addressed. These should be
3667 * considered before a public release.
3668 */
3669message CpuTimePerThreadFreq {
3670 // UID that owns the process.
3671 optional int32 uid = 1 [(is_uid) = true];
3672 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003673 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01003674 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003675 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01003676 // Name of the process taken from `/proc/$PID/cmdline`.
3677 optional string process_name = 4;
3678 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
3679 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00003680
3681 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
3682 // are given in KHz, and time is given in milliseconds since the thread started. All eight
3683 // frequencies are given here as the alternative is sending eight separate atoms. This method
3684 // significantly reduces the amount of data created
3685 optional int32 frequency1_khz = 6;
3686 optional int32 time1_millis = 7;
3687 optional int32 frequency2_khz = 8;
3688 optional int32 time2_millis = 9;
3689 optional int32 frequency3_khz = 10;
3690 optional int32 time3_millis = 11;
3691 optional int32 frequency4_khz = 12;
3692 optional int32 time4_millis = 13;
3693 optional int32 frequency5_khz = 14;
3694 optional int32 time5_millis = 15;
3695 optional int32 frequency6_khz = 16;
3696 optional int32 time6_millis = 17;
3697 optional int32 frequency7_khz = 18;
3698 optional int32 time7_millis = 19;
3699 optional int32 frequency8_khz = 20;
3700 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01003701}
Bookatz75ee6042018-11-09 12:27:37 -08003702
3703/**
Bookatz366a4432018-11-20 09:42:33 -08003704 * Pulls information about the device's build.
3705 */
3706message BuildInformation {
3707 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
3708 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
3709 optional string fingerprint = 1;
3710
3711 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
3712 optional string brand = 2;
3713
3714 // Build.PRODUCT. The name of the overall product.
3715 optional string product = 3;
3716
3717 // Build.DEVICE. The name of the industrial design.
3718 optional string device = 4;
3719
3720 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
3721 optional string version_release = 5;
3722
3723 // Build.ID. E.g. a label like "M4-rc20".
3724 optional string id = 6;
3725
3726 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
3727 // represent this build.
3728 optional string version_incremental = 7;
3729
3730 // Build.TYPE. The type of build, like "user" or "eng".
3731 optional string type = 8;
3732
3733 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
3734 optional string tags = 9;
3735}
3736
3737/**
Bookatz75ee6042018-11-09 12:27:37 -08003738 * Pulls on-device BatteryStats power use calculations for the overall device.
3739 */
3740message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08003741 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3742 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3743 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
3744 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08003745}
3746
3747/**
3748 * Pulls on-device BatteryStats power use calculations broken down by uid.
3749 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
3750 * that is attributed to non-uid items. They must all be included to get the total power use.
3751 */
3752message DeviceCalculatedPowerBlameUid {
3753 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
3754 optional int32 uid = 1 [(is_uid) = true];
3755
Bookatz3dbc13a2018-12-21 12:16:51 -08003756 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3757 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3758 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08003759}
3760
3761/**
3762 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
3763 * drain type.
3764 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
3765 * is attributed uids. They must all be included to get the total power use.
3766 */
3767message DeviceCalculatedPowerBlameOther {
3768 // The type of item whose power use is being reported.
3769 enum DrainType {
3770 AMBIENT_DISPLAY = 0;
3771 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
3772 BLUETOOTH = 2;
3773 CAMERA = 3;
3774 // Cell-standby
3775 CELL = 4;
3776 FLASHLIGHT = 5;
3777 IDLE = 6;
3778 MEMORY = 7;
3779 // Amount that total computed drain exceeded the drain estimated using the
3780 // battery level changes and capacity.
3781 OVERCOUNTED = 8;
3782 PHONE = 9;
3783 SCREEN = 10;
3784 // Amount that total computed drain was below the drain estimated using the
3785 // battery level changes and capacity.
3786 UNACCOUNTED = 11;
3787 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
3788 WIFI = 13;
3789 }
3790 optional DrainType drain_type = 1;
3791
Bookatz3dbc13a2018-12-21 12:16:51 -08003792 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3793 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3794 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00003795}
arangelov4e994062018-11-13 16:12:38 +00003796
3797/**
3798 * Logs device policy features.
3799 *
3800 * Logged from:
3801 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3802 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
3803 */
3804message DevicePolicyEvent {
3805 // The event id - unique for each event.
3806 optional android.stats.devicepolicy.EventId event_id = 1;
3807 // The admin package name.
3808 optional string admin_package_name = 2;
3809 // A generic integer parameter.
3810 optional int32 integer_value = 3;
3811 // A generic boolean parameter.
3812 optional bool boolean_value = 4;
3813 // A parameter specifying a time period in milliseconds.
3814 optional uint64 time_period_millis = 5;
3815 // A parameter specifying a list of package names, bundle extras or string parameters.
3816 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
3817}
shawnlinea5b66b2018-11-13 15:05:29 +08003818
3819/**
3820 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
3821 *
3822 * Logged from:
3823 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3824 */
3825message DocsUILaunchReported {
3826 optional android.stats.docsui.LaunchAction launch_action = 1;
3827 optional bool has_initial_uri = 2;
3828 optional android.stats.docsui.MimeType mime_type = 3;
3829 optional android.stats.docsui.Root initial_root = 4;
3830}
3831
3832/**
3833 * Logs root/app visited event in file managers/picker. Call this when the user
3834 * taps on root/app in hamburger menu.
3835 *
3836 * Logged from:
3837 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3838 */
3839message DocsUIRootVisitedReported {
3840 optional android.stats.docsui.ContextScope scope = 1;
3841 optional android.stats.docsui.Root root = 2;
3842}
3843
3844/**
3845 * Logs file operation stats. Call this when a file operation has completed.
3846 *
3847 * Logged from:
3848 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3849 */
3850message DocsUIFileOperationReported {
3851 optional android.stats.docsui.Provider provider = 1;
3852 optional android.stats.docsui.FileOperation file_op = 2;
3853}
3854
3855/**
3856 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
3857 * mode.
3858 *
3859 * Logged from:
3860 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3861 */
3862message DocsUIFileOperationCopyMoveModeReported {
3863 optional android.stats.docsui.FileOperation file_op = 1;
3864 optional android.stats.docsui.CopyMoveOpMode mode = 2;
3865}
3866
3867
3868/**
3869 * Logs file sub operation stats. Call this when a file operation has failed.
3870 *
3871 * Logged from:
3872 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3873 */
3874message DocsUIFileOperationFailureReported {
3875 optional android.stats.docsui.Authority authority = 1;
3876 optional android.stats.docsui.SubFileOperation sub_op = 2;
3877}
3878
3879/**
3880* Logs the cancellation of a file operation. Call this when a job is canceled
3881*
3882* Logged from:
3883* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3884*/
3885message DocsUIFileOperationCanceledReported {
3886 optional android.stats.docsui.FileOperation file_op = 1;
3887}
3888
3889/**
3890 * Logs startup time in milliseconds.
3891 *
3892 * Logged from:
3893 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3894 */
3895message DocsUIStartupMsReported {
3896 optional int32 startup_millis = 1;
3897}
3898
3899/**
3900 * Logs the action that was started by user.
3901 *
3902 * Logged from:
3903 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3904 */
3905message DocsUIUserActionReported {
3906 optional android.stats.docsui.UserAction action = 1;
3907}
3908
3909/**
3910 * Logs the invalid type when invalid scoped access is requested.
3911 *
3912 * Logged from:
3913 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
3914 */
3915message DocsUIInvalidScopedAccessRequestReported {
3916 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00003917}
Ben Murdochbab399f2018-12-06 11:01:38 +00003918
3919/**
shawnlina75e82d2019-01-07 10:31:12 +08003920 * Logs the package name that launches docsui picker mode.
3921 *
3922 * Logged from:
3923 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3924 */
3925message DocsUIPickerLaunchedFromReported {
3926 optional string package_name = 1;
3927}
3928
3929/**
3930 * Logs the search type.
3931 *
3932 * Logged from:
3933 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3934 */
3935message DocsUISearchTypeReported {
3936 optional android.stats.docsui.SearchType search_type = 1;
3937}
3938
3939/**
3940 * Logs the search mode.
3941 *
3942 * Logged from:
3943 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3944 */
3945message DocsUISearchModeReported {
3946 optional android.stats.docsui.SearchMode search_mode = 1;
3947}
3948
3949/**
3950 * Logs the pick result information.
3951 *
3952 * Logged from:
3953 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3954 */
3955message DocsUIPickResultReported {
3956 optional int32 total_action_count = 1;
3957 optional int64 duration_millis = 2;
3958 optional int32 file_count= 3;
3959 optional bool is_searching = 4;
3960 optional android.stats.docsui.Root picked_from = 5;
3961 optional android.stats.docsui.MimeType mime_type = 6;
3962 optional int32 repeatedly_pick_times = 7;
3963}
3964
3965/**
Ben Murdochbab399f2018-12-06 11:01:38 +00003966 * Logs when an app's memory is compacted.
3967 *
3968 * Logged from:
3969 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3970 */
3971message AppCompacted {
3972 // The pid of the process being compacted.
3973 optional int32 pid = 1;
3974
3975 // The name of the process being compacted.
3976 optional string process_name = 2;
3977
3978 // The type of compaction.
3979 enum Action {
3980 UNKNOWN = 0;
3981 SOME = 1;
3982 FULL = 2;
3983 }
Ben Murdoch01720b82018-12-19 18:03:44 +00003984 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00003985
3986 // Total RSS in kilobytes consumed by the process prior to compaction.
3987 optional int64 before_rss_total_kilobytes = 4;
3988
3989 // File RSS in kilobytes consumed by the process prior to compaction.
3990 optional int64 before_rss_file_kilobytes = 5;
3991
3992 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
3993 optional int64 before_rss_anon_kilobytes = 6;
3994
3995 // Swap in kilobytes consumed by the process prior to compaction.
3996 optional int64 before_swap_kilobytes = 7;
3997
3998 // Total RSS in kilobytes consumed by the process after compaction.
3999 optional int64 after_rss_total_kilobytes = 8;
4000
4001 // File RSS in kilobytes consumed by the process after compaction.
4002 optional int64 after_rss_file_kilobytes = 9;
4003
4004 // Anonymous RSS in kilobytes consumed by the process after compaction.
4005 optional int64 after_rss_anon_kilobytes = 10;
4006
4007 // Swap in kilobytes consumed by the process after compaction.
4008 optional int64 after_swap_kilobytes = 11;
4009
4010 // The time taken to perform compaction in milliseconds.
4011 optional int64 time_to_compact_millis = 12;
4012
4013 // The last compaction action performed for this app.
4014 optional Action last_action = 13;
4015
Ben Murdoch01720b82018-12-19 18:03:44 +00004016 // The last time that compaction was attempted on this process in milliseconds
4017 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4018 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004019
Ben Murdoch01720b82018-12-19 18:03:44 +00004020 // The oom_score_adj at the time of compaction.
4021 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004022
4023 // The process state at the time of compaction.
4024 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4025}
lifr157fc552018-12-12 16:38:04 +08004026
4027/**
4028 * Logs the latency period(in microseconds) and the return code of
4029 * the DNS(Domain Name System) lookups.
4030 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4031 * to get info(address or hostname) from DNS server(or DNS cache).
4032 * Logged from:
4033 * /system/netd/server/DnsProxyListener.cpp
4034 */
4035message NetworkDnsEventReported {
4036 // The types of the DNS lookups, as defined in
4037 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4038 enum EventType {
4039 EVENT_UNKNOWN = 0;
4040 EVENT_GETADDRINFO = 1;
4041 EVENT_GETHOSTBYNAME = 2;
4042 EVENT_GETHOSTBYADDR = 3;
4043 EVENT_RES_NSEND = 4;
4044 }
4045 optional EventType event_type = 1;
4046
4047 // The return value of the DNS resolver for each DNS lookups.
4048 //bionic/libc/include/netdb.h
4049 //system/netd/resolv/include/netd_resolv/resolv.h
4050 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004051 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004052 EAI_ADDRFAMILY = 1;
4053 EAI_AGAIN = 2;
4054 EAI_BADFLAGS = 3;
4055 EAI_FAIL = 4;
4056 EAI_FAMILY = 5;
4057 EAI_MEMORY = 6;
4058 EAI_NODATA = 7;
4059 EAI_NONAME = 8;
4060 EAI_SERVICE = 9;
4061 EAI_SOCKTYPE = 10;
4062 EAI_SYSTEM = 11;
4063 EAI_BADHINTS = 12;
4064 EAI_PROTOCOL = 13;
4065 EAI_OVERFLOW = 14;
4066 RESOLV_TIMEOUT = 255;
4067 EAI_MAX = 256;
4068 }
4069 optional ReturnCode return_code = 2;
4070
4071 // The latency period(in microseconds) it took for this DNS lookup to complete.
4072 optional int32 latency_micros = 3;
4073}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004074
4075/**
4076 * Logs when a data stall event occurs.
4077 *
4078 * Log from:
4079 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4080 */
4081message DataStallEvent {
4082 // Data stall evaluation type.
4083 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4084 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4085 optional int32 evaluation_type = 1;
4086 // See definition in data_stall_event.proto.
4087 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4088 // See definition in data_stall_event.proto.
4089 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4090 // See definition in data_stall_event.proto.
4091 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4092 // See definition in data_stall_event.proto.
4093 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4094 // See definition in data_stall_event.proto.
4095 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4096}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004097
4098/*
4099 * Logs when RescueParty resets some set of experiment flags.
4100 *
4101 * Logged from:
4102 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4103 */
4104message RescuePartyResetReported {
4105 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4106 optional int32 rescue_level = 1;
4107}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004108
4109/**
4110 * Logs when signed config is received from an APK, and if that config was applied successfully.
4111 * Logged from:
4112 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4113 */
4114message SignedConfigReported {
4115 enum Type {
4116 UNKNOWN_TYPE = 0;
4117 GLOBAL_SETTINGS = 1;
4118 }
4119 optional Type type = 1;
4120
4121 // The final status of the signed config received.
4122 enum Status {
4123 UNKNOWN_STATUS = 0;
4124 APPLIED = 1;
4125 BASE64_FAILURE_CONFIG = 2;
4126 BASE64_FAILURE_SIGNATURE = 3;
4127 SECURITY_EXCEPTION = 4;
4128 INVALID_CONFIG = 5;
4129 OLD_CONFIG = 6;
4130 SIGNATURE_CHECK_FAILED = 7;
4131 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004132 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004133 }
4134 optional Status status = 2;
4135
4136 // The version of the signed config processed.
4137 optional int32 version = 3;
4138
4139 // The package name that the config was extracted from.
4140 optional string from_package = 4;
4141
4142 enum Key {
4143 NO_KEY = 0;
4144 DEBUG = 1;
4145 PRODUCTION = 2;
4146 }
4147 // Which key was used to verify the config.
4148 optional Key verified_with = 5;
4149}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004150
4151/*
4152 * Logs GNSS Network-Initiated (NI) location events.
4153 *
4154 * Logged from:
4155 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4156 */
4157message GnssNiEventReported {
4158 // The type of GnssNiEvent.
4159 enum EventType {
4160 UNKNOWN = 0;
4161 NI_REQUEST = 1;
4162 NI_RESPONSE = 2;
4163 }
4164 optional EventType event_type = 1;
4165
4166 // An ID generated by HAL to associate NI notifications and UI responses.
4167 optional int32 notification_id = 2;
4168
4169 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004170 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004171
4172 // NI requires notification.
4173 optional bool need_notify = 4;
4174
4175 // NI requires verification.
4176 optional bool need_verify = 5;
4177
4178 // NI requires privacy override, no notification/minimal trace.
4179 optional bool privacy_override = 6;
4180
4181 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4182 // seconds.
4183 optional int32 timeout = 7;
4184
4185 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004186 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004187
4188 // String representing the requester of the network inititated location request.
4189 optional string requestor_id = 9;
4190
4191 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4192 // network initiated location request.
4193 optional string text = 10;
4194
4195 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004196 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004197
4198 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004199 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004200
4201 // True if SUPL ES is enabled.
4202 optional bool is_supl_es_enabled = 13;
4203
4204 // True if GNSS location is enabled.
4205 optional bool is_location_enabled = 14;
4206
4207 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004208 optional android.server.location.GnssUserResponseType user_response = 15;
4209}
4210
4211/**
4212 * Logs GNSS non-framework (NFW) location notification.
4213 *
4214 * Logged from:
4215 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4216 */
4217message GnssNfwNotificationReported {
4218 // Package name of the Android proxy application representing the non-framework entity that
4219 // requested location. Set to empty string if unknown.
4220 optional string proxy_app_package_name = 1;
4221
4222 // Protocol stack that initiated the non-framework location request.
4223 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4224
4225 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4226 // set to empty string. This field is opaque to the framework and used for logging purposes.
4227 optional string other_protocol_stack_name = 3;
4228
4229 // Source initiating/receiving the location information.
4230 optional android.server.location.NfwRequestor requestor = 4;
4231
4232 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4233 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4234 // and used for logging purposes.
4235 optional string requestor_id = 5;
4236
4237 // Indicates whether location information was provided for this request.
4238 optional android.server.location.NfwResponseType response_type = 6;
4239
4240 // True if the device is in user initiated emergency session.
4241 optional bool in_emergency_mode = 7;
4242
4243 // True if cached location is provided.
4244 optional bool is_cached_location = 8;
4245
4246 // True if proxy app permission mismatch between framework and GNSS HAL.
4247 optional bool is_permission_mismatched = 9;
4248}
4249
4250/**
4251 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4252 *
4253 * Logged from:
4254 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4255 */
4256message GnssConfigurationReported {
4257 // SUPL host name.
4258 optional string supl_host = 1;
4259
4260 // SUPL port number.
4261 optional int32 supl_port = 2;
4262
4263 // C2K host name.
4264 optional string c2k_host = 3;
4265
4266 // C2K port number.
4267 optional int32 c2k_port = 4;
4268
4269 // The SUPL version requested by Carrier.
4270 optional int32 supl_ver = 5;
4271
4272 // The SUPL mode.
4273 optional android.server.location.SuplMode supl_mode = 6;
4274
4275 // True if NI emergency SUPL restrictions is enabled.
4276 optional bool supl_es = 7;
4277
4278 // LTE Positioning Profile settings
4279 optional android.server.location.LppProfile lpp_profile = 8;
4280
4281 // Positioning protocol on A-Glonass system.
4282 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
4283
4284 // True if emergency PDN is used. Otherwise, regular PDN is used.
4285 optional bool use_emergency_pdn_for_emergency_supl= 10;
4286
4287 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
4288 optional android.server.location.GpsLock gps_lock = 11;
4289
4290 // Number of seconds to extend the emergency session duration post emergency call.
4291 optional int32 es_extension_sec = 12;
4292
4293 // The full list of package names of proxy Android applications representing the non-framework
4294 // location access entities (on/off the device) for which the framework user has granted
4295 // non-framework location access permission. The package names are concatenated in one string
4296 // with spaces as separators.
4297 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004298}