Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | syntax = "proto2"; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 18 | |
| 19 | package android.os.statsd; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 20 | option java_package = "com.android.os"; |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 21 | option java_outer_classname = "AtomsProto"; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 22 | |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 23 | import "frameworks/base/cmds/statsd/src/atom_field_options.proto"; |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 24 | import "frameworks/base/core/proto/android/app/enums.proto"; |
Fan Zhang | f837b8e | 2018-10-23 12:38:30 -0700 | [diff] [blame] | 25 | import "frameworks/base/core/proto/android/app/settings_enums.proto"; |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 26 | import "frameworks/base/core/proto/android/app/job/enums.proto"; |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 27 | import "frameworks/base/core/proto/android/bluetooth/enums.proto"; |
Jack He | ab86dbd2 | 2018-12-18 15:43:27 -0800 | [diff] [blame] | 28 | import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto"; |
Jack He | d9837c8 | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 29 | import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto"; |
Chiachang Wang | f6bedc2 | 2019-01-14 11:54:32 +0800 | [diff] [blame] | 30 | import "frameworks/base/core/proto/android/net/networkcapabilities.proto"; |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 31 | import "frameworks/base/core/proto/android/os/enums.proto"; |
Chiachang Wang | f6bedc2 | 2019-01-14 11:54:32 +0800 | [diff] [blame] | 32 | import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto"; |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 33 | import "frameworks/base/core/proto/android/server/enums.proto"; |
Bookatz | 48d362e | 2018-11-06 15:49:08 -0800 | [diff] [blame] | 34 | import "frameworks/base/core/proto/android/server/location/enums.proto"; |
Yangster | af9aee7 | 2018-10-12 09:26:16 -0700 | [diff] [blame] | 35 | import "frameworks/base/core/proto/android/service/procstats_enum.proto"; |
| 36 | import "frameworks/base/core/proto/android/stats/enums.proto"; |
shawnlin | ea5b66b | 2018-11-13 15:05:29 +0800 | [diff] [blame] | 37 | import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto"; |
Yao Chen | 8c43386 | 2018-10-24 14:09:20 -0700 | [diff] [blame] | 38 | import "frameworks/base/core/proto/android/stats/launcher/launcher.proto"; |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 39 | import "frameworks/base/core/proto/android/telecomm/enums.proto"; |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 40 | import "frameworks/base/core/proto/android/telephony/enums.proto"; |
| 41 | import "frameworks/base/core/proto/android/view/enums.proto"; |
arangelov | 4e99406 | 2018-11-13 16:12:38 +0000 | [diff] [blame] | 42 | import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto"; |
| 43 | import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto"; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 44 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 45 | /** |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 46 | * The master atom class. This message defines all of the available |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 47 | * 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 Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 54 | * This Atom class is not actually built into the Android system. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 55 | * Instead, statsd on Android constructs these messages synthetically, |
| 56 | * in the format defined here and in stats_log.proto. |
| 57 | */ |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 58 | message Atom { |
| 59 | // Pushed atoms start at 2. |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 60 | oneof pushed { |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 61 | // For StatsLog reasons, 1 is illegal and will not work. Must start at 2. |
| 62 | BleScanStateChanged ble_scan_state_changed = 2; |
Chenjie Yu | bd1a28f | 2018-07-17 14:55:19 -0700 | [diff] [blame] | 63 | ProcessStateChanged process_state_changed = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 64 | BleScanResultReceived ble_scan_result_received = 4; |
| 65 | SensorStateChanged sensor_state_changed = 5; |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 66 | GpsScanStateChanged gps_scan_state_changed = 6; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 67 | SyncStateChanged sync_state_changed = 7; |
| 68 | ScheduledJobStateChanged scheduled_job_state_changed = 8; |
| 69 | ScreenBrightnessChanged screen_brightness_changed = 9; |
Bookatz | d674624 | 2017-10-24 18:39:35 -0700 | [diff] [blame] | 70 | WakelockStateChanged wakelock_state_changed = 10; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 71 | LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11; |
| 72 | MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12; |
| 73 | WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13; |
Chenjie Yu | bd1a28f | 2018-07-17 14:55:19 -0700 | [diff] [blame] | 74 | 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 Song | c6d6b77 | 2018-10-17 13:35:32 -0700 | [diff] [blame] | 79 | LauncherUIChanged launcher_event = 19; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 80 | BatterySaverModeStateChanged battery_saver_mode_state_changed = 20; |
| 81 | DeviceIdleModeStateChanged device_idle_mode_state_changed = 21; |
| 82 | DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 83 | AudioStateChanged audio_state_changed = 23; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 84 | MediaCodecStateChanged media_codec_state_changed = 24; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 85 | 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; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 90 | BatteryLevelChanged battery_level_changed = 30; |
| 91 | ChargingStateChanged charging_state_changed = 31; |
| 92 | PluggedStateChanged plugged_state_changed = 32; |
Bookatz | a66083f | 2018-09-20 17:24:00 -0700 | [diff] [blame] | 93 | InteractiveStateChanged interactive_state_changed = 33; |
| 94 | // 34 is available |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 95 | WakeupAlarmOccurred wakeup_alarm_occurred = 35; |
| 96 | KernelWakeupReported kernel_wakeup_reported = 36; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 97 | 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 Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 101 | SettingChanged setting_changed = 41; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 102 | ActivityForegroundStateChanged activity_foreground_state_changed = 42; |
David Chen | 2158296 | 2017-11-01 17:32:46 -0700 | [diff] [blame] | 103 | IsolatedUidChanged isolated_uid_changed = 43; |
Hugo Benichi | 884970e | 2017-11-14 22:42:46 +0900 | [diff] [blame] | 104 | PacketWakeupOccurred packet_wakeup_occurred = 44; |
Bookatz | 7948c87 | 2018-09-04 12:58:33 -0700 | [diff] [blame] | 105 | WallClockTimeShifted wall_clock_time_shifted = 45; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 106 | AnomalyDetected anomaly_detected = 46; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 107 | AppBreadcrumbReported app_breadcrumb_reported = 47; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 108 | AppStartOccurred app_start_occurred = 48; |
| 109 | AppStartCanceled app_start_canceled = 49; |
| 110 | AppStartFullyDrawn app_start_fully_drawn = 50; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 111 | LmkKillOccurred lmk_kill_occurred = 51; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 112 | PictureInPictureStateChanged picture_in_picture_state_changed = 52; |
Tej Singh | 4503e10 | 2018-01-04 14:35:01 -0800 | [diff] [blame] | 113 | WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 114 | LmkStateChanged lmk_state_changed = 54; |
| 115 | AppStartMemoryStateCaptured app_start_memory_state_captured = 55; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 116 | ShutdownSequenceReported shutdown_sequence_reported = 56; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 117 | BootSequenceReported boot_sequence_reported = 57; |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 118 | DaveyOccurred davey_occurred = 58; |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 119 | OverlayStateChanged overlay_state_changed = 59; |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 120 | ForegroundServiceStateChanged foreground_service_state_changed = 60; |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 121 | CallStateChanged call_state_changed = 61; |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 122 | KeyguardStateChanged keyguard_state_changed = 62; |
| 123 | KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63; |
| 124 | KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 125 | AppDied app_died = 65; |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 126 | ResourceConfigurationChanged resource_configuration_changed = 66; |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 127 | BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67; |
| 128 | BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68; |
Bookatz | 48d362e | 2018-11-06 15:49:08 -0800 | [diff] [blame] | 129 | GpsSignalQualityChanged gps_signal_quality_changed = 69; |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 130 | UsbConnectorStateChanged usb_connector_state_changed = 70; |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 131 | SpeakerImpedanceReported speaker_impedance_reported = 71; |
| 132 | HardwareFailed hardware_failed = 72; |
| 133 | PhysicalDropDetected physical_drop_detected = 73; |
| 134 | ChargeCyclesReported charge_cycles_reported = 74; |
Tej Singh | eee317b | 2018-03-07 19:28:05 -0800 | [diff] [blame] | 135 | MobileConnectionStateChanged mobile_connection_state_changed = 75; |
| 136 | MobileRadioTechnologyChanged mobile_radio_technology_changed = 76; |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 137 | UsbDeviceAttached usb_device_attached = 77; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 138 | AppCrashOccurred app_crash_occurred = 78; |
| 139 | ANROccurred anr_occurred = 79; |
| 140 | WTFOccurred wtf_occurred = 80; |
| 141 | LowMemReported low_mem_reported = 81; |
Howard Ro | cb767f6 | 2018-06-19 19:58:05 -0700 | [diff] [blame] | 142 | GenericAtom generic_atom = 82; |
Yangster-mac | 48b3d62 | 2018-08-18 12:38:11 -0700 | [diff] [blame] | 143 | KeyValuePairsAtom key_value_pairs_atom = 83; |
Bookatz | a7020bd | 2018-08-28 16:29:35 -0700 | [diff] [blame] | 144 | VibratorStateChanged vibrator_state_changed = 84; |
Yangster-mac | 9635300 | 2018-09-05 11:18:55 -0700 | [diff] [blame] | 145 | DeferredJobStatsReported deferred_job_stats_reported = 85; |
Yangster-mac | e16189a | 2018-08-26 12:20:16 -0700 | [diff] [blame] | 146 | ThermalThrottlingStateChanged thermal_throttling = 86; |
Tej Singh | d6d6d77 | 2018-09-05 17:41:25 -0700 | [diff] [blame] | 147 | FingerprintAcquired fingerprint_acquired = 87; |
| 148 | FingerprintAuthenticated fingerprint_authenticated = 88; |
| 149 | FingerprintErrorOccurred fingerprint_error_occurred = 89; |
Howard Ro | 688ae18 | 2018-09-25 00:09:36 -0700 | [diff] [blame] | 150 | Notification notification = 90; |
Howard Ro | a46b658 | 2018-09-18 16:45:02 -0700 | [diff] [blame] | 151 | BatteryHealthSnapshot battery_health_snapshot = 91; |
| 152 | SlowIo slow_io = 92; |
| 153 | BatteryCausedShutdown battery_caused_shutdown = 93; |
Yangster | af9aee7 | 2018-10-12 09:26:16 -0700 | [diff] [blame] | 154 | PhoneServiceStateChanged phone_service_state_changed = 94; |
| 155 | PhoneStateChanged phone_state_changed = 95; |
arangelov | d5db50e | 2018-10-12 20:24:39 +0100 | [diff] [blame] | 156 | UserRestrictionChanged user_restriction_changed = 96; |
Fan Zhang | 916c13b | 2018-10-16 22:49:45 -0700 | [diff] [blame] | 157 | SettingsUIChanged settings_ui_changed = 97; |
Chenjie Yu | ae9dfac | 2018-10-25 16:06:56 -0700 | [diff] [blame] | 158 | ConnectivityStateChanged connectivity_state_changed = 98; |
Chenjie Yu | 75b3c49 | 2018-10-06 21:45:19 -0700 | [diff] [blame] | 159 | // 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-mac | b89807e | 2018-11-15 21:10:57 -0800 | [diff] [blame] | 164 | PhenotypeFlagStateChanged phenotype_flag_state_changed = 101; |
| 165 | BinaryPushStateChanged binary_push_state_changed = 102; |
arangelov | 4e99406 | 2018-11-13 16:12:38 +0000 | [diff] [blame] | 166 | DevicePolicyEvent device_policy_event = 103; |
shawnlin | ea5b66b | 2018-11-13 15:05:29 +0800 | [diff] [blame] | 167 | 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; |
Bookatz | da1798c | 2018-12-13 14:16:00 -0800 | [diff] [blame] | 176 | WifiEnabledStateChanged wifi_enabled_state_changed = 113; |
| 177 | WifiRunningStateChanged wifi_running_state_changed = 114; |
Ben Murdoch | bab399f | 2018-12-06 11:01:38 +0000 | [diff] [blame] | 178 | AppCompacted app_compacted = 115; |
lifr | 030d23a | 2019-01-11 16:54:51 +0800 | [diff] [blame] | 179 | NetworkDnsEventReported network_dns_event_reported = 116; |
shawnlin | a75e82d | 2019-01-07 10:31:12 +0800 | [diff] [blame] | 180 | 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 Wang | f6bedc2 | 2019-01-14 11:54:32 +0800 | [diff] [blame] | 184 | DataStallEvent data_stall_event = 121; |
Christian Brunschen | f86039e | 2018-12-21 12:26:14 +0000 | [diff] [blame] | 185 | RescuePartyResetReported rescue_party_reset_reported = 122; |
Mathew Inwood | b375be5 | 2019-01-04 11:36:25 +0000 | [diff] [blame] | 186 | SignedConfigReported signed_config_reported = 123; |
Yu-Han Yang | 8a1b51d | 2018-12-26 22:18:31 -0800 | [diff] [blame] | 187 | GnssNiEventReported gnss_ni_event_reported = 124; |
Jack He | ab86dbd2 | 2018-12-18 15:43:27 -0800 | [diff] [blame] | 188 | BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125; |
Jack He | d9837c8 | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 189 | BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126; |
| 190 | BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127; |
Felix Lopez Luis | d95346a | 2018-12-12 10:32:32 +0000 | [diff] [blame] | 191 | AppDowngraded app_downgraded = 128; |
| 192 | AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129; |
| 193 | LowStorageStateChanged low_storage_state_changed = 130; |
Yu-Han Yang | 14d5fb4 | 2019-01-16 12:42:59 -0800 | [diff] [blame^] | 194 | GnssNfwNotificationReported gnss_nfw_notification_reported = 131; |
| 195 | GnssConfigurationReported gnss_configuration_reported = 132; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 196 | } |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 197 | |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 198 | // Pulled events will start at field 10000. |
Rafal Slawik | 3bea895 | 2018-11-15 12:39:33 +0000 | [diff] [blame] | 199 | // Next: 10043 |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 200 | oneof pulled { |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 201 | WifiBytesTransfer wifi_bytes_transfer = 10000; |
| 202 | WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001; |
| 203 | MobileBytesTransfer mobile_bytes_transfer = 10002; |
| 204 | MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 205 | BluetoothBytesTransfer bluetooth_bytes_transfer = 10006; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 206 | KernelWakelock kernel_wakelock = 10004; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 207 | SubsystemSleepState subsystem_sleep_state = 10005; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 208 | CpuTimePerFreq cpu_time_per_freq = 10008; |
| 209 | CpuTimePerUid cpu_time_per_uid = 10009; |
| 210 | CpuTimePerUidFreq cpu_time_per_uid_freq = 10010; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 211 | WifiActivityInfo wifi_activity_info = 10011; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 212 | ModemActivityInfo modem_activity_info = 10012; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 213 | BluetoothActivityInfo bluetooth_activity_info = 10007; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 214 | ProcessMemoryState process_memory_state = 10013; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 215 | SystemElapsedRealtime system_elapsed_realtime = 10014; |
| 216 | SystemUptime system_uptime = 10015; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 217 | CpuActiveTime cpu_active_time = 10016; |
| 218 | CpuClusterTime cpu_cluster_time = 10017; |
Tej Singh | 86dc9db | 2018-09-06 00:39:57 +0000 | [diff] [blame] | 219 | DiskSpace disk_space = 10018 [deprecated=true]; |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 220 | RemainingBatteryCapacity remaining_battery_capacity = 10019; |
| 221 | FullBatteryCapacity full_battery_capacity = 10020; |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 222 | Temperature temperature = 10021; |
Olivier Gaillard | 00bfb1b | 2018-07-10 11:25:09 +0100 | [diff] [blame] | 223 | BinderCalls binder_calls = 10022; |
Olivier Gaillard | 9ea238d | 2018-07-24 10:26:31 +0100 | [diff] [blame] | 224 | BinderCallsExceptions binder_calls_exceptions = 10023; |
Marcin Oczeretko | d8cc859 | 2018-08-22 16:07:36 +0100 | [diff] [blame] | 225 | LooperStats looper_stats = 10024; |
Tej Singh | 86dc9db | 2018-09-06 00:39:57 +0000 | [diff] [blame] | 226 | DiskStats disk_stats = 10025; |
| 227 | DirectoryUsage directory_usage = 10026; |
| 228 | AppSize app_size = 10027; |
| 229 | CategorySize category_size = 10028; |
Chenjie Yu | ab53020 | 2018-09-26 12:39:20 -0700 | [diff] [blame] | 230 | ProcStats proc_stats = 10029; |
Bookatz | 17f0d8a | 2018-09-13 12:56:32 -0700 | [diff] [blame] | 231 | BatteryVoltage battery_voltage = 10030; |
Tej Singh | d6d6d77 | 2018-09-05 17:41:25 -0700 | [diff] [blame] | 232 | NumFingerprints num_fingerprints = 10031; |
Tej Singh | e7726dc | 2018-09-21 11:42:12 -0700 | [diff] [blame] | 233 | DiskIo disk_io = 10032; |
Chenjie Yu | ab53020 | 2018-09-26 12:39:20 -0700 | [diff] [blame] | 234 | PowerProfile power_profile = 10033; |
Chenjie Yu | f910b780 | 2019-01-11 16:08:20 -0800 | [diff] [blame] | 235 | ProcStatsPkgProc proc_stats_pkg_proc = 10034; |
Yangster-mac | 308ea0c | 2018-10-22 13:10:25 -0700 | [diff] [blame] | 236 | ProcessCpuTime process_cpu_time = 10035; |
Rafal Slawik | 0862158 | 2018-10-15 14:53:07 +0100 | [diff] [blame] | 237 | NativeProcessMemoryState native_process_memory_state = 10036; |
Misha Wagner | 5a51e00 | 2018-10-03 15:04:09 +0100 | [diff] [blame] | 238 | CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037; |
Bookatz | 92da283 | 2018-11-01 18:10:03 -0700 | [diff] [blame] | 239 | OnDevicePowerMeasurement on_device_power_measurement = 10038; |
Bookatz | 75ee604 | 2018-11-09 12:27:37 -0800 | [diff] [blame] | 240 | DeviceCalculatedPowerUse device_calculated_power_use = 10039; |
| 241 | DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040; |
| 242 | DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041; |
Rafal Slawik | 3bea895 | 2018-11-15 12:39:33 +0000 | [diff] [blame] | 243 | ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042; |
Tej Singh | b1dbc8b | 2018-11-19 15:49:47 -0800 | [diff] [blame] | 244 | BatteryLevel battery_level = 10043; |
Bookatz | 366a443 | 2018-11-20 09:42:33 -0800 | [diff] [blame] | 245 | BuildInformation build_information = 10044; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 246 | } |
yro | a1fe77c | 2018-02-26 14:22:54 -0800 | [diff] [blame] | 247 | |
Bookatz | 76aafcf | 2018-09-17 16:17:10 -0700 | [diff] [blame] | 248 | // DO NOT USE field numbers above 100,000 in AOSP. |
| 249 | // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use. |
| 250 | // Field numbers 200,000 and above are reserved for future use; do not use them at all. |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 251 | } |
| 252 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 253 | /** |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 254 | * This proto represents a node of an attribution chain. |
| 255 | * Note: All attribution chains are represented as a repeated field of type |
| 256 | * AttributionNode. It is understood that in such arrays, the order is that |
| 257 | * of calls, that is [A, B, C] if A calls B that calls C. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 258 | */ |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 259 | message AttributionNode { |
| 260 | // The uid for a given element in the attribution chain. |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 261 | optional int32 uid = 1; |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 262 | |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 263 | // The (optional) string tag for an element in the attribution chain. If the |
| 264 | // element has no tag, it is encoded as an empty string. |
| 265 | optional string tag = 2; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 266 | } |
| 267 | |
Yangster-mac | 48b3d62 | 2018-08-18 12:38:11 -0700 | [diff] [blame] | 268 | message KeyValuePair { |
| 269 | optional int32 key = 1; |
| 270 | oneof value { |
Howard Ro | 4078dd4 | 2018-09-27 17:41:08 -0700 | [diff] [blame] | 271 | int32 value_int = 2; |
| 272 | int64 value_long = 3; |
| 273 | string value_str = 4; |
| 274 | float value_float = 5; |
Yangster-mac | 48b3d62 | 2018-08-18 12:38:11 -0700 | [diff] [blame] | 275 | } |
| 276 | } |
| 277 | |
| 278 | message KeyValuePairsAtom { |
| 279 | optional int32 uid = 1; |
| 280 | repeated KeyValuePair pairs = 2; |
| 281 | } |
| 282 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 283 | /* |
| 284 | * ***************************************************************************** |
yro | de4ca10 | 2017-11-15 22:57:24 -0800 | [diff] [blame] | 285 | * Below are all of the individual atoms that are logged by Android via statsd. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 286 | * |
| 287 | * RULES: |
| 288 | * - The field ids for each atom must start at 1, and count upwards by 1. |
| 289 | * Skipping field ids is not allowed. |
| 290 | * - These form an API, so renaming, renumbering or removing fields is |
| 291 | * not allowed between android releases. (This is not currently enforced, |
| 292 | * but there will be a tool to enforce this restriction). |
| 293 | * - The types must be built-in protocol buffer types, namely, no sub-messages |
| 294 | * are allowed (yet). The bytes type is also not allowed. |
| 295 | * - The CamelCase name of the message type should match the |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 296 | * underscore_separated name as defined in Atom. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 297 | * - If an atom represents work that can be attributed to an app, there can |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 298 | * be exactly one AttributionChain field. It must be field number 1. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 299 | * - A field that is a uid should be a string field, tagged with the [xxx] |
| 300 | * annotation. The generated code on android will be represented by UIDs, |
| 301 | * and those UIDs will be translated in xxx to those strings. |
| 302 | * |
| 303 | * CONVENTIONS: |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 304 | * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 305 | * - If there is a UID, it goes first. Think in an object-oriented fashion. |
| 306 | * ***************************************************************************** |
| 307 | */ |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 308 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 309 | /** |
Yangster-mac | e16189a | 2018-08-26 12:20:16 -0700 | [diff] [blame] | 310 | * Logs when the Thermal service HAL notifies the throttling start/stop events. |
| 311 | * |
| 312 | * Logged from: |
| 313 | * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java |
| 314 | */ |
| 315 | message ThermalThrottlingStateChanged { |
| 316 | optional android.os.TemperatureTypeEnum sensor_type = 1; |
| 317 | |
| 318 | enum State { |
| 319 | UNKNOWN = 0; |
| 320 | START = 1; |
| 321 | STOP = 2; |
| 322 | } |
| 323 | |
| 324 | optional State state = 2; |
| 325 | |
| 326 | optional float temperature = 3; |
| 327 | } |
| 328 | |
| 329 | /** |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 330 | * Logs when the screen state changes. |
| 331 | * |
| 332 | * Logged from: |
| 333 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 334 | */ |
| 335 | message ScreenStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 336 | // New screen state, from frameworks/base/core/proto/android/view/enums.proto. |
Yangster-mac | b6b77c6 | 2018-10-12 19:33:24 -0700 | [diff] [blame] | 337 | optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE]; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 338 | } |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 339 | |
| 340 | /** |
Chenjie Yu | bd1a28f | 2018-07-17 14:55:19 -0700 | [diff] [blame] | 341 | * Logs that the process state of the uid, as determined by ActivityManager |
| 342 | * (i.e. the highest process state of that uid's processes) has changed. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 343 | * |
| 344 | * Logged from: |
| 345 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 346 | */ |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 347 | message UidProcessStateChanged { |
Yangster-mac | b6b77c6 | 2018-10-12 19:33:24 -0700 | [diff] [blame] | 348 | optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true]; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 349 | |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 350 | // The state, from frameworks/base/core/proto/android/app/enums.proto. |
Yangster-mac | b6b77c6 | 2018-10-12 19:33:24 -0700 | [diff] [blame] | 351 | optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE]; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 352 | } |
| 353 | |
| 354 | /** |
Chenjie Yu | bd1a28f | 2018-07-17 14:55:19 -0700 | [diff] [blame] | 355 | * Logs process state change of a process, as per the activity manager. |
| 356 | * |
| 357 | * Logged from: |
| 358 | * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java |
| 359 | */ |
| 360 | message ProcessStateChanged { |
| 361 | optional int32 uid = 1; |
| 362 | optional string process_name = 2; |
| 363 | optional string package_name = 3; |
| 364 | // TODO: remove this when validation is done |
| 365 | optional int64 version = 5; |
| 366 | // The state, from frameworks/base/core/proto/android/app/enums.proto. |
| 367 | optional android.app.ProcessStateEnum state = 4; |
| 368 | } |
| 369 | |
| 370 | /** |
| 371 | * Logs when ActivityManagerService sleep state is changed. |
| 372 | * |
| 373 | * Logged from: |
| 374 | * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java |
| 375 | */ |
| 376 | message ActivityManagerSleepStateChanged { |
| 377 | // TODO: import frameworks proto |
| 378 | enum State { |
| 379 | UNKNOWN = 0; |
| 380 | ASLEEP = 1; |
| 381 | AWAKE = 2; |
| 382 | } |
Yangster-mac | b6b77c6 | 2018-10-12 19:33:24 -0700 | [diff] [blame] | 383 | optional State state = 1 [(state_field_option).option = EXCLUSIVE]; |
Chenjie Yu | bd1a28f | 2018-07-17 14:55:19 -0700 | [diff] [blame] | 384 | } |
| 385 | |
| 386 | /** |
| 387 | * Logs when system memory state changes. |
| 388 | * |
| 389 | * Logged from: |
| 390 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 391 | */ |
| 392 | message MemoryFactorStateChanged { |
| 393 | // TODO: import frameworks proto |
| 394 | enum State { |
| 395 | MEMORY_UNKNOWN = 0; |
| 396 | NORMAL = 1; // normal. |
| 397 | MODERATE = 2; // moderate memory pressure. |
| 398 | LOW = 3; // low memory. |
| 399 | CRITICAL = 4; // critical memory. |
| 400 | |
| 401 | } |
Yangster-mac | b6b77c6 | 2018-10-12 19:33:24 -0700 | [diff] [blame] | 402 | optional State factor = 1 [(state_field_option).option = EXCLUSIVE]; |
Chenjie Yu | bd1a28f | 2018-07-17 14:55:19 -0700 | [diff] [blame] | 403 | } |
| 404 | |
| 405 | /** |
| 406 | * Logs when app is using too much cpu, according to ActivityManagerService. |
| 407 | * |
| 408 | * Logged from: |
| 409 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 410 | */ |
| 411 | message ExcessiveCpuUsageReported { |
| 412 | optional int32 uid = 1; |
| 413 | optional string process_name = 2; |
| 414 | optional string package_name = 3; |
| 415 | // package version. TODO: remove this when validation is done |
| 416 | optional int64 version = 4; |
| 417 | } |
| 418 | |
| 419 | /** |
| 420 | * Logs when a cached process is killed, along with its pss. |
| 421 | * |
| 422 | * Logged from: |
| 423 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 424 | */ |
| 425 | message CachedKillReported { |
| 426 | optional int32 uid = 1; |
| 427 | optional string process_name = 2; |
| 428 | optional string package_name = 3; |
| 429 | // TODO: remove this when validation is done |
| 430 | optional int64 version = 5; |
| 431 | optional int64 pss = 4; |
| 432 | } |
| 433 | |
| 434 | /** |
| 435 | * Logs when memory stats of a process is reported. |
| 436 | * |
| 437 | * Logged from: |
| 438 | * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java |
| 439 | */ |
| 440 | message ProcessMemoryStatReported { |
| 441 | optional int32 uid = 1; |
| 442 | optional string process_name = 2; |
| 443 | optional string package_name = 3; |
| 444 | //TODO: remove this when validation is done |
| 445 | optional int64 version = 9; |
| 446 | optional int64 pss = 4; |
| 447 | optional int64 uss = 5; |
| 448 | optional int64 rss = 6; |
| 449 | enum Type { |
| 450 | ADD_PSS_INTERNAL_SINGLE = 0; |
| 451 | ADD_PSS_INTERNAL_ALL_MEM = 1; |
| 452 | ADD_PSS_INTERNAL_ALL_POLL = 2; |
| 453 | ADD_PSS_EXTERNAL = 3; |
| 454 | ADD_PSS_EXTERNAL_SLOW = 4; |
| 455 | } |
| 456 | optional Type type = 7; |
| 457 | optional int64 duration = 8; |
| 458 | } |
| 459 | |
| 460 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 461 | * Logs that a process started, finished, crashed, or ANRed. |
| 462 | * |
| 463 | * Logged from: |
| 464 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 465 | */ |
| 466 | message ProcessLifeCycleStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 467 | optional int32 uid = 1 [(is_uid) = true]; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 468 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 469 | // The process name (usually same as the app name). |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 470 | optional string process_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 471 | |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 472 | // What lifecycle state the process changed to. |
| 473 | // This enum is specific to atoms.proto. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 474 | enum State { |
| 475 | FINISHED = 0; |
| 476 | STARTED = 1; |
| 477 | CRASHED = 2; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 478 | } |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 479 | optional State state = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 480 | } |
| 481 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 482 | /** |
| 483 | * Logs when the ble scan state changes. |
| 484 | * |
| 485 | * Logged from: |
Bookatz | 17a879d | 2018-03-28 15:05:28 -0700 | [diff] [blame] | 486 | * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 487 | */ |
| 488 | message BleScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 489 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 490 | |
| 491 | enum State { |
| 492 | OFF = 0; |
| 493 | ON = 1; |
Bookatz | e5ec0b4 | 2018-03-26 13:34:56 -0700 | [diff] [blame] | 494 | // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes). |
| 495 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 496 | } |
| 497 | optional State state = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 498 | |
Bookatz | e5ec0b4 | 2018-03-26 13:34:56 -0700 | [diff] [blame] | 499 | // Does the scan have a filter. |
| 500 | optional bool is_filtered = 3; |
| 501 | // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally. |
| 502 | optional bool is_first_match = 4; |
| 503 | // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC). |
| 504 | optional bool is_opportunistic = 5; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 505 | } |
| 506 | |
| 507 | /** |
| 508 | * Logs reporting of a ble scan finding results. |
| 509 | * |
| 510 | * Logged from: |
Bookatz | ae6738e | 2018-09-13 11:38:56 -0700 | [diff] [blame] | 511 | * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 512 | */ |
Bookatz | ae6738e | 2018-09-13 11:38:56 -0700 | [diff] [blame] | 513 | // TODO: Consider also tracking per-scanner-id. |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 514 | message BleScanResultReceived { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 515 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 516 | |
| 517 | // Number of ble scan results returned. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 518 | optional int32 num_results = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 519 | } |
| 520 | |
| 521 | /** |
| 522 | * Logs when a sensor state changes. |
| 523 | * |
| 524 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 525 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 526 | */ |
| 527 | message SensorStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 528 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 529 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 530 | // The id (int) of the sensor. |
| 531 | optional int32 sensor_id = 2; |
| 532 | |
| 533 | enum State { |
| 534 | OFF = 0; |
| 535 | ON = 1; |
| 536 | } |
| 537 | optional State state = 3; |
| 538 | } |
| 539 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 540 | /** |
| 541 | * Logs when GPS state changes. |
| 542 | * |
| 543 | * Logged from: |
| 544 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 545 | */ |
| 546 | message GpsScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 547 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 548 | |
| 549 | enum State { |
| 550 | OFF = 0; |
| 551 | ON = 1; |
| 552 | } |
| 553 | optional State state = 2; |
| 554 | } |
| 555 | |
Bookatz | 48d362e | 2018-11-06 15:49:08 -0800 | [diff] [blame] | 556 | /** |
| 557 | * Logs when GPS signal quality. |
| 558 | * |
| 559 | * Logged from: |
| 560 | * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java |
| 561 | */ |
| 562 | message GpsSignalQualityChanged { |
| 563 | optional android.server.location.GpsSignalQualityEnum level = 1; |
| 564 | } |
| 565 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 566 | |
| 567 | /** |
| 568 | * Logs when a sync manager sync state changes. |
| 569 | * |
| 570 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 571 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 572 | */ |
| 573 | message SyncStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 574 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 575 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 576 | // Name of the sync (as named in the app). Can be chosen at run-time. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 577 | optional string sync_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 578 | |
| 579 | enum State { |
| 580 | OFF = 0; |
| 581 | ON = 1; |
| 582 | } |
| 583 | optional State state = 3; |
| 584 | } |
| 585 | |
Yangster-mac | 9635300 | 2018-09-05 11:18:55 -0700 | [diff] [blame] | 586 | /* |
| 587 | * Deferred job stats. |
| 588 | * |
| 589 | * Logged from: |
| 590 | * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java |
| 591 | */ |
| 592 | message DeferredJobStatsReported { |
| 593 | repeated AttributionNode attribution_node = 1; |
| 594 | |
| 595 | // Number of jobs deferred. |
| 596 | optional int32 num_jobs_deferred = 2; |
| 597 | |
| 598 | // Time since the last job runs. |
| 599 | optional int64 time_since_last_job_millis = 3; |
| 600 | } |
| 601 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 602 | /** |
| 603 | * Logs when a job scheduler job state changes. |
| 604 | * |
| 605 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 606 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 607 | */ |
| 608 | message ScheduledJobStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 609 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 610 | |
| 611 | // Name of the job (as named in the app) |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 612 | optional string job_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 613 | |
| 614 | enum State { |
Tej Singh | d5747a6 | 2018-01-08 20:57:35 -0800 | [diff] [blame] | 615 | FINISHED = 0; |
| 616 | STARTED = 1; |
| 617 | SCHEDULED = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 618 | } |
| 619 | optional State state = 3; |
| 620 | |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 621 | // The reason a job has stopped. |
| 622 | // This is only applicable when the state is FINISHED. |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 623 | // The default value is STOP_REASON_UNKNOWN. |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 624 | optional android.app.job.StopReasonEnum stop_reason = 4; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 625 | } |
| 626 | |
| 627 | /** |
| 628 | * Logs when the audio state changes. |
| 629 | * |
| 630 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 631 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 632 | */ |
| 633 | message AudioStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 634 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 635 | |
| 636 | enum State { |
| 637 | OFF = 0; |
| 638 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 639 | // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes). |
| 640 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 641 | } |
| 642 | optional State state = 2; |
| 643 | } |
| 644 | |
| 645 | /** |
| 646 | * Logs when the video codec state changes. |
| 647 | * |
| 648 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 649 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 650 | */ |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 651 | message MediaCodecStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 652 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 653 | |
| 654 | enum State { |
| 655 | OFF = 0; |
| 656 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 657 | // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes). |
| 658 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 659 | } |
| 660 | optional State state = 2; |
| 661 | } |
| 662 | |
| 663 | /** |
| 664 | * Logs when the flashlight state changes. |
| 665 | * |
| 666 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 667 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 668 | */ |
| 669 | message FlashlightStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 670 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 671 | |
| 672 | enum State { |
| 673 | OFF = 0; |
| 674 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 675 | // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes). |
| 676 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 677 | } |
| 678 | optional State state = 2; |
| 679 | } |
| 680 | |
| 681 | /** |
| 682 | * Logs when the camera state changes. |
| 683 | * |
| 684 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 685 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 686 | */ |
| 687 | message CameraStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 688 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 689 | |
| 690 | enum State { |
| 691 | OFF = 0; |
| 692 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 693 | // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes). |
| 694 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 695 | } |
| 696 | optional State state = 2; |
| 697 | } |
| 698 | |
| 699 | /** |
| 700 | * Logs that the state of a wakelock (per app and per wakelock name) has changed. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 701 | * |
| 702 | * Logged from: |
| 703 | * TODO |
| 704 | */ |
Bookatz | d674624 | 2017-10-24 18:39:35 -0700 | [diff] [blame] | 705 | message WakelockStateChanged { |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 706 | repeated AttributionNode attribution_node = 1; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 707 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 708 | // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock. |
| 709 | // From frameworks/base/core/proto/android/os/enums.proto. |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 710 | optional android.os.WakeLockLevelEnum type = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 711 | |
| 712 | // The wakelock tag (Called tag in the Java API, sometimes name elsewhere). |
| 713 | optional string tag = 3; |
| 714 | |
| 715 | enum State { |
Yangster-mac | cfdf3a4 | 2017-12-06 13:42:38 -0800 | [diff] [blame] | 716 | RELEASE = 0; |
| 717 | ACQUIRE = 1; |
| 718 | CHANGE_RELEASE = 2; |
| 719 | CHANGE_ACQUIRE = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 720 | } |
| 721 | optional State state = 4; |
| 722 | } |
| 723 | |
| 724 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 725 | * Logs when a partial wakelock is considered 'long' (over 1 min). |
| 726 | * |
| 727 | * Logged from: |
| 728 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 729 | */ |
| 730 | message LongPartialWakelockStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 731 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 732 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 733 | // The wakelock tag (Called tag in the Java API, sometimes name elsewhere). |
| 734 | optional string tag = 2; |
| 735 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 736 | // TODO: I have no idea what this is. |
| 737 | optional string history_tag = 3; |
| 738 | |
| 739 | enum State { |
| 740 | OFF = 0; |
| 741 | ON = 1; |
| 742 | } |
| 743 | optional State state = 4; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 744 | } |
| 745 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 746 | /** |
Bookatz | a66083f | 2018-09-20 17:24:00 -0700 | [diff] [blame] | 747 | * Logs when the device is interactive, according to the PowerManager Notifier. |
| 748 | * |
| 749 | * Logged from: |
| 750 | * frameworks/base/services/core/java/com/android/server/power/Notifier.java |
| 751 | */ |
| 752 | message InteractiveStateChanged { |
| 753 | enum State { |
| 754 | OFF = 0; |
| 755 | ON = 1; |
| 756 | } |
| 757 | optional State state = 1; |
| 758 | } |
| 759 | |
| 760 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 761 | * Logs Battery Saver state change. |
| 762 | * |
| 763 | * Logged from: |
| 764 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 765 | */ |
| 766 | message BatterySaverModeStateChanged { |
| 767 | enum State { |
| 768 | OFF = 0; |
| 769 | ON = 1; |
| 770 | } |
| 771 | optional State state = 1; |
| 772 | } |
| 773 | |
| 774 | /** |
| 775 | * Logs Doze mode state change. |
| 776 | * |
| 777 | * Logged from: |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 778 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 779 | */ |
| 780 | message DeviceIdleModeStateChanged { |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 781 | optional android.server.DeviceIdleModeEnum state = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 782 | } |
| 783 | |
| 784 | |
| 785 | /** |
| 786 | * Logs state change of Doze mode including maintenance windows. |
| 787 | * |
| 788 | * Logged from: |
| 789 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 790 | */ |
| 791 | message DeviceIdlingModeStateChanged { |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 792 | optional android.server.DeviceIdleModeEnum state = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 793 | } |
| 794 | |
| 795 | /** |
| 796 | * Logs screen brightness level. |
| 797 | * |
| 798 | * Logged from: |
| 799 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 800 | */ |
| 801 | message ScreenBrightnessChanged { |
| 802 | // Screen brightness level. Should be in [-1, 255] according to PowerManager.java. |
| 803 | optional int32 level = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 804 | } |
| 805 | |
| 806 | /** |
| 807 | * Logs battery level (percent full, from 0 to 100). |
| 808 | * |
| 809 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 810 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 811 | */ |
| 812 | message BatteryLevelChanged { |
| 813 | // Battery level. Should be in [0, 100]. |
| 814 | optional int32 battery_level = 1; |
| 815 | } |
| 816 | |
| 817 | /** |
| 818 | * Logs change in charging status of the device. |
| 819 | * |
| 820 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 821 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 822 | */ |
| 823 | message ChargingStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 824 | // State of the battery, from frameworks/base/core/proto/android/os/enums.proto. |
| 825 | optional android.os.BatteryStatusEnum state = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 826 | } |
| 827 | |
| 828 | /** |
| 829 | * Logs whether the device is plugged in, and what power source it is using. |
| 830 | * |
| 831 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 832 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 833 | */ |
| 834 | message PluggedStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 835 | // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto. |
| 836 | optional android.os.BatteryPluggedStateEnum state = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 837 | } |
| 838 | |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 839 | /** |
| 840 | * Logs when an app's wakeup alarm fires. |
| 841 | * |
| 842 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 843 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 844 | */ |
| 845 | message WakeupAlarmOccurred { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 846 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 847 | |
| 848 | // Name of the wakeup alarm. |
| 849 | optional string tag = 2; |
Bookatz | caf2293e | 2018-09-23 13:07:43 -0700 | [diff] [blame] | 850 | |
| 851 | // Name of source package (for historical reasons, since BatteryStats tracked it). |
| 852 | optional string package_name = 3; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 853 | } |
| 854 | |
| 855 | /** |
| 856 | * Logs when an an app causes the mobile radio to change state. |
| 857 | * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio. |
| 858 | * |
| 859 | * Logged from: |
Bookatz | 0b028b1 | 2018-05-31 16:51:17 -0700 | [diff] [blame] | 860 | * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 861 | */ |
| 862 | message MobileRadioPowerStateChanged { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 863 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 864 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 865 | // Power state, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 866 | optional android.telephony.DataConnectionPowerStateEnum state = 2; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 867 | } |
| 868 | |
| 869 | /** |
| 870 | * Logs when an an app causes the wifi radio to change state. |
| 871 | * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio. |
| 872 | * |
| 873 | * Logged from: |
Bookatz | 0b028b1 | 2018-05-31 16:51:17 -0700 | [diff] [blame] | 874 | * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 875 | */ |
| 876 | message WifiRadioPowerStateChanged { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 877 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 878 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 879 | // Power state, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 880 | optional android.telephony.DataConnectionPowerStateEnum state = 2; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 881 | } |
| 882 | |
| 883 | /** |
| 884 | * Logs kernel wakeup reasons and aborts. |
| 885 | * |
| 886 | * Logged from: |
Bookatz | 56585ca | 2018-09-07 11:38:45 -0700 | [diff] [blame] | 887 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 888 | */ |
| 889 | message KernelWakeupReported { |
| 890 | // Name of the kernel wakeup reason (or abort). |
| 891 | optional string wakeup_reason_name = 1; |
| 892 | |
| 893 | // Duration (in microseconds) for the wake-up interrupt to be serviced. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 894 | optional int64 duration_micros = 2; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 895 | } |
| 896 | |
| 897 | /** |
Bookatz | da1798c | 2018-12-13 14:16:00 -0800 | [diff] [blame] | 898 | * Logs when Wifi is toggled on/off. |
Bookatz | a0a1f8a | 2018-12-17 12:28:32 -0800 | [diff] [blame] | 899 | * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled. |
Bookatz | da1798c | 2018-12-13 14:16:00 -0800 | [diff] [blame] | 900 | * |
| 901 | * Logged from: |
| 902 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 903 | */ |
| 904 | message WifiEnabledStateChanged { |
| 905 | enum State { |
| 906 | OFF = 0; |
| 907 | ON = 1; |
| 908 | } |
| 909 | optional State state = 1; |
| 910 | } |
| 911 | |
| 912 | /** |
| 913 | * Logs when an app causes Wifi to run. In this context, 'to run' means to use Wifi Client Mode. |
Bookatz | a0a1f8a | 2018-12-17 12:28:32 -0800 | [diff] [blame] | 914 | * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'. |
| 915 | * Note that Wifi Scanning is monitored separately in WifiScanStateChanged. |
Bookatz | da1798c | 2018-12-13 14:16:00 -0800 | [diff] [blame] | 916 | * |
| 917 | * Logged from: |
| 918 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 919 | */ |
| 920 | message WifiRunningStateChanged { |
| 921 | repeated AttributionNode attribution_node = 1; |
| 922 | |
| 923 | enum State { |
| 924 | OFF = 0; |
| 925 | ON = 1; |
| 926 | } |
| 927 | optional State state = 2; |
| 928 | } |
| 929 | |
| 930 | /** |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 931 | * Logs wifi locks held by an app. |
| 932 | * |
| 933 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 934 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 935 | */ |
| 936 | message WifiLockStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 937 | repeated AttributionNode attribution_node = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 938 | |
| 939 | enum State { |
| 940 | OFF = 0; |
| 941 | ON = 1; |
| 942 | } |
| 943 | optional State state = 2; |
| 944 | } |
| 945 | |
| 946 | /** |
| 947 | * Logs wifi signal strength changes. |
| 948 | * |
| 949 | * Logged from: |
Bookatz | 819ea83 | 2018-11-28 16:53:31 -0800 | [diff] [blame] | 950 | * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 951 | */ |
| 952 | message WifiSignalStrengthChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 953 | // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 954 | optional android.telephony.SignalStrengthEnum signal_strength = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 955 | } |
| 956 | |
| 957 | /** |
| 958 | * Logs wifi scans performed by an app. |
| 959 | * |
| 960 | * Logged from: |
Bookatz | 819ea83 | 2018-11-28 16:53:31 -0800 | [diff] [blame] | 961 | * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 962 | */ |
| 963 | message WifiScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 964 | repeated AttributionNode attribution_node = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 965 | |
| 966 | enum State { |
| 967 | OFF = 0; |
| 968 | ON = 1; |
| 969 | } |
| 970 | optional State state = 2; |
| 971 | } |
| 972 | |
| 973 | /** |
Tej Singh | 4503e10 | 2018-01-04 14:35:01 -0800 | [diff] [blame] | 974 | * Logs wifi multicast locks held by an app |
| 975 | * |
| 976 | * Logged from: |
Bookatz | 819ea83 | 2018-11-28 16:53:31 -0800 | [diff] [blame] | 977 | * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java |
Tej Singh | 4503e10 | 2018-01-04 14:35:01 -0800 | [diff] [blame] | 978 | */ |
| 979 | message WifiMulticastLockStateChanged { |
| 980 | repeated AttributionNode attribution_node = 1; |
| 981 | |
| 982 | enum State { |
| 983 | OFF = 0; |
| 984 | ON = 1; |
| 985 | } |
| 986 | optional State state = 2; |
Bookatz | 819ea83 | 2018-11-28 16:53:31 -0800 | [diff] [blame] | 987 | |
| 988 | optional string tag = 3; |
Tej Singh | 4503e10 | 2018-01-04 14:35:01 -0800 | [diff] [blame] | 989 | } |
| 990 | |
| 991 | /** |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 992 | * Logs shutdown reason and duration on next boot. |
| 993 | * |
| 994 | * Logged from: |
| 995 | * frameworks/base/core/java/com/android/server/BootReceiver.java |
| 996 | */ |
| 997 | message ShutdownSequenceReported { |
| 998 | // True if shutdown is for a reboot. Default: false if we do not know. |
| 999 | optional bool reboot = 1; |
| 1000 | |
| 1001 | // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>". |
| 1002 | optional string reason = 2; |
| 1003 | |
| 1004 | // Beginning of shutdown time in ms using wall clock time since unix epoch. |
| 1005 | // Default: 0 if no start time received. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1006 | optional int64 start_time_millis = 3; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 1007 | |
| 1008 | // Duration of shutdown in ms. Default: 0 if no duration received. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1009 | optional int64 duration_millis = 4; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 1010 | } |
| 1011 | |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 1012 | |
| 1013 | /** |
| 1014 | * Logs boot reason and duration. |
| 1015 | * |
| 1016 | * Logged from: |
| 1017 | * system/core/bootstat/bootstat.cpp |
| 1018 | */ |
| 1019 | message BootSequenceReported { |
| 1020 | // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list |
| 1021 | // Default: "<EMPTY>" if not available. |
| 1022 | optional string bootloader_reason = 1; |
| 1023 | |
| 1024 | // Reason for system boot. Eg. bootloader, reboot,userrequested |
| 1025 | // Default: "<EMPTY>" if not available. |
| 1026 | optional string system_reason = 2; |
| 1027 | |
| 1028 | // End of boot time in ms from unix epoch using system wall clock. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1029 | optional int64 end_time_millis = 3; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 1030 | |
| 1031 | // Total boot duration in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1032 | optional int64 total_duration_millis = 4; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 1033 | |
| 1034 | // Bootloader duration in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1035 | optional int64 bootloader_duration_millis = 5; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 1036 | |
| 1037 | // Time since last boot in ms. Default: 0 if not available. |
| 1038 | optional int64 time_since_last_boot = 6; |
| 1039 | } |
| 1040 | |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 1041 | |
| 1042 | /** |
| 1043 | * Logs call state and disconnect cause (if applicable). |
| 1044 | * |
| 1045 | * Logged from: |
| 1046 | * packages/services/Telecomm/src/com/android/server/telecom/Call.java |
| 1047 | */ |
| 1048 | message CallStateChanged { |
| 1049 | // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED. |
| 1050 | // From frameworks/base/core/proto/android/telecomm/enums.proto. |
| 1051 | optional android.telecom.CallStateEnum call_state = 1; |
| 1052 | |
| 1053 | // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY. |
| 1054 | // This value is only applicable when the call_state is DISCONNECTED, and |
| 1055 | // should always be UNKNOWN if the call_state is not DISCONNECTED. |
| 1056 | // From frameworks/base/core/proto/android/telecomm/enums.proto. |
| 1057 | optional android.telecom.DisconnectCauseEnum disconnect_cause = 2; |
| 1058 | |
| 1059 | // True if the call is self-managed, which are apps that use the |
| 1060 | // telecom infrastructure to make their own calls. |
| 1061 | optional bool self_managed = 3; |
| 1062 | |
| 1063 | // True if call is external. External calls are calls on connected Wear |
| 1064 | // devices but show up in Telecom so the user can pull them onto the device. |
| 1065 | optional bool external_call = 4; |
| 1066 | } |
| 1067 | |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 1068 | /** |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 1069 | * Logs keyguard state. The keyguard is the lock screen. |
| 1070 | * |
| 1071 | * Logged from: |
| 1072 | * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java |
| 1073 | */ |
| 1074 | message KeyguardStateChanged { |
| 1075 | enum State { |
| 1076 | UNKNOWN = 0; |
| 1077 | // The keyguard is hidden when the phone is unlocked. |
| 1078 | HIDDEN = 1; |
| 1079 | // The keyguard is shown when the phone is locked (screen turns off). |
| 1080 | SHOWN= 2; |
| 1081 | // The keyguard is occluded when something is overlaying the keyguard. |
| 1082 | // Eg. Opening the camera while on the lock screen. |
| 1083 | OCCLUDED = 3; |
| 1084 | } |
| 1085 | optional State state = 1; |
| 1086 | } |
| 1087 | |
| 1088 | /** |
| 1089 | * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and |
| 1090 | * prompts the user to enter a password (pattern, pin, etc). |
| 1091 | * |
| 1092 | * Logged from: |
| 1093 | * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java |
| 1094 | */ |
| 1095 | |
| 1096 | message KeyguardBouncerStateChanged { |
| 1097 | enum State { |
| 1098 | UNKNOWN = 0; |
| 1099 | // Bouncer is hidden, either as a result of successfully entering the |
| 1100 | // password, screen timing out, or user going back to lock screen. |
| 1101 | HIDDEN = 1; |
| 1102 | // This is when the user is being prompted to enter the password. |
| 1103 | SHOWN = 2; |
| 1104 | } |
| 1105 | optional State state = 1; |
| 1106 | } |
| 1107 | |
| 1108 | /** |
| 1109 | * Logs the result of entering a password into the keyguard bouncer. |
| 1110 | * |
| 1111 | * Logged from: |
| 1112 | * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java |
| 1113 | */ |
| 1114 | message KeyguardBouncerPasswordEntered { |
| 1115 | enum BouncerResult { |
| 1116 | UNKNOWN = 0; |
| 1117 | // The password entered was incorrect. |
| 1118 | FAILURE = 1; |
| 1119 | // The password entered was correct. |
| 1120 | SUCCESS = 2; |
| 1121 | } |
| 1122 | optional BouncerResult result = 1; |
| 1123 | } |
| 1124 | |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 1125 | /* |
| 1126 | * Logs changes to the configuration of the device. The configuration is defined |
| 1127 | * in frameworks/base/core/java/android/content/res/Configuration.java |
| 1128 | * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html |
| 1129 | * Please go there to interpret the possible values each field can be. |
| 1130 | * |
| 1131 | * Logged from: |
| 1132 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1133 | */ |
| 1134 | message ResourceConfigurationChanged { |
| 1135 | // Bit mask of color capabilities of the screen. |
| 1136 | // Contains information about the color gamut and hdr mode of the screen. |
| 1137 | // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 1138 | optional int32 color_mode = 1; |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 1139 | |
| 1140 | // The target screen density being rendered to. |
| 1141 | // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 1142 | optional int32 density_dpi = 2; |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 1143 | |
| 1144 | // Current user preference for the scaling factor for fonts, |
| 1145 | // relative to the base density scaling. |
| 1146 | // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 1147 | optional float font_scale = 3; |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 1148 | |
| 1149 | // Flag indicating whether the hard keyboard is hidden. |
| 1150 | // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 1151 | optional int32 hard_keyboard_hidden = 4; |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 1152 | |
| 1153 | // The type of keyboard attached to the device. |
| 1154 | // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard |
| 1155 | optional int32 keyboard = 5; |
| 1156 | |
| 1157 | // Flag indicating whether any keyboard is available. Takes soft keyboards into account. |
| 1158 | // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 1159 | optional int32 keyboard_hidden = 6; |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 1160 | |
| 1161 | // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier. |
| 1162 | // 0 if undefined. |
| 1163 | // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc |
| 1164 | optional int32 mcc = 7; |
| 1165 | |
| 1166 | // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier. |
| 1167 | // 0 if undefined. Note: the actual MNC may be 0, to check for this use the |
| 1168 | // MNC_ZERO symbol defined in Configuration.java. |
| 1169 | // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc |
| 1170 | optional int32 mnc = 8; |
| 1171 | |
| 1172 | // The kind of navigation available on the device. |
| 1173 | // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation |
| 1174 | optional int32 navigation = 9; |
| 1175 | |
| 1176 | // Flag indicating whether the navigation is available. |
| 1177 | // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 1178 | optional int32 navigation_hidden = 10; |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 1179 | |
| 1180 | // Overall orientation of the screen. |
| 1181 | // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation |
| 1182 | optional int32 orientation = 11; |
| 1183 | |
| 1184 | // The current height of the available screen space, in dp units. |
| 1185 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 1186 | optional int32 screen_height_dp = 12; |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 1187 | |
| 1188 | // Bit mask of overall layout of the screen. |
| 1189 | // Contains information about screen size, whether the screen is wider/taller |
| 1190 | // than normal, whether the screen layout is right-tl-left or left-to-right, |
| 1191 | // and whether the screen has a rounded shape. |
| 1192 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 1193 | optional int32 screen_layout = 13; |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 1194 | |
| 1195 | // Current width of the available screen space, in dp units. |
| 1196 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 1197 | optional int32 screen_width_dp = 14; |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 1198 | |
| 1199 | // The smallest screen size an application will see in normal operation. |
| 1200 | // This is the smallest value of both screenWidthDp and screenHeightDp |
| 1201 | // in portrait and landscape. |
| 1202 | // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 1203 | optional int32 smallest_screen_width_dp = 15; |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 1204 | |
| 1205 | // The type of touch screen attached to the device. |
| 1206 | // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen |
| 1207 | optional int32 touchscreen = 16; |
| 1208 | |
| 1209 | // Bit mask of the ui mode. |
| 1210 | // Contains information about the overall ui mode of the device. |
| 1211 | // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET |
| 1212 | // Also contains information about whether the device is in night mode. |
| 1213 | // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 1214 | optional int32 ui_mode = 17; |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 1215 | } |
| 1216 | |
Tej Singh | eee317b | 2018-03-07 19:28:05 -0800 | [diff] [blame] | 1217 | |
| 1218 | /** |
| 1219 | * Logs changes in the connection state of the mobile radio. |
| 1220 | * |
| 1221 | * Logged from: |
| 1222 | * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java |
| 1223 | */ |
| 1224 | message MobileConnectionStateChanged { |
| 1225 | // States are from the state machine DataConnection.java. |
| 1226 | enum State { |
| 1227 | UNKNOWN = 0; |
| 1228 | // The connection is inactive, or disconnected. |
| 1229 | INACTIVE = 1; |
| 1230 | // The connection is being activated, or connecting. |
| 1231 | ACTIVATING = 2; |
| 1232 | // The connection is active, or connected. |
| 1233 | ACTIVE = 3; |
| 1234 | // The connection is disconnecting. |
| 1235 | DISCONNECTING = 4; |
| 1236 | // The connection is disconnecting after creating a connection. |
| 1237 | DISCONNECTION_ERROR_CREATING_CONNECTION = 5; |
| 1238 | } |
| 1239 | optional State state = 1; |
| 1240 | // For multi-sim phones, this distinguishes between the sim cards. |
| 1241 | optional int32 sim_slot_index = 2; |
| 1242 | // Used to identify the connection. Starts at 0 and increments by 1 for |
| 1243 | // every new network created. Resets whenever the device reboots. |
| 1244 | optional int32 data_connection_id = 3; |
| 1245 | // A bitmask for the capabilities of this connection. |
| 1246 | // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS. |
| 1247 | // Default value (if we have no information): 0 |
| 1248 | optional int64 capabilities = 4; |
| 1249 | // If this connection has internet. |
| 1250 | // This just checks if the DEFAULT bit of capabilities is set. |
| 1251 | optional bool has_internet = 5; |
| 1252 | } |
| 1253 | |
| 1254 | /** |
| 1255 | * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA. |
| 1256 | * |
| 1257 | * Logged from: |
| 1258 | * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java |
| 1259 | */ |
| 1260 | message MobileRadioTechnologyChanged { |
| 1261 | optional android.telephony.NetworkTypeEnum state = 1; |
| 1262 | // For multi-sim phones, this distinguishes between the sim cards. |
| 1263 | optional int32 sim_slot_index = 2; |
| 1264 | } |
| 1265 | |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 1266 | /** |
| 1267 | * Logs the VID and PID of any connected USB devices. |
| 1268 | * |
| 1269 | * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present. |
| 1270 | * |
| 1271 | * Logged by Vendor. |
| 1272 | */ |
| 1273 | message UsbDeviceAttached { |
| 1274 | optional int32 vid = 1; |
| 1275 | optional int32 pid = 2; |
| 1276 | optional bool has_audio = 3; |
| 1277 | optional bool has_hid = 4; |
| 1278 | optional bool has_storage = 5; |
Badhri Jagan Sridharan | 5ec629f | 2018-11-16 15:39:22 -0800 | [diff] [blame] | 1279 | enum State { |
| 1280 | STATE_DISCONNECTED = 0; |
| 1281 | STATE_CONNECTED = 1; |
| 1282 | } |
| 1283 | optional State state = 6; |
Badhri Jagan Sridharan | c2c54a2 | 2018-12-14 14:41:26 -0800 | [diff] [blame] | 1284 | optional int64 last_connect_duration_millis = 7; |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 1285 | } |
| 1286 | |
Tej Singh | eee317b | 2018-03-07 19:28:05 -0800 | [diff] [blame] | 1287 | |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 1288 | /** |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1289 | * Logs when Bluetooth is enabled and disabled. |
| 1290 | * |
| 1291 | * Logged from: |
| 1292 | * services/core/java/com/android/server/BluetoothManagerService.java |
| 1293 | */ |
| 1294 | message BluetoothEnabledStateChanged { |
| 1295 | repeated AttributionNode attribution_node = 1; |
| 1296 | // Whether or not bluetooth is enabled on the device. |
| 1297 | enum State { |
| 1298 | UNKNOWN = 0; |
| 1299 | ENABLED = 1; |
| 1300 | DISABLED = 2; |
| 1301 | } |
| 1302 | optional State state = 2; |
| 1303 | // The reason for being enabled/disabled. |
| 1304 | // Eg. Airplane mode, crash, application request. |
| 1305 | optional android.bluetooth.EnableDisableReasonEnum reason = 3; |
| 1306 | // If the reason is an application request, this will be the package name. |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 1307 | optional string pkg_name = 4; |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1308 | } |
| 1309 | |
| 1310 | /** |
Jack He | d9837c8 | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 1311 | * Logs when profiles on a Bluetooth device connects and disconnects. |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1312 | * |
| 1313 | * Logged from: |
Jack He | d9837c8 | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 1314 | * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java |
| 1315 | * |
| 1316 | * Next Tag: 5 |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1317 | */ |
| 1318 | message BluetoothConnectionStateChanged { |
| 1319 | // The state of the connection. |
| 1320 | // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED. |
| 1321 | optional android.bluetooth.ConnectionStateEnum state = 1; |
| 1322 | // An identifier that can be used to match connect and disconnect events. |
| 1323 | // Currently is last two bytes of a hash of a device level ID and |
| 1324 | // the mac address of the bluetooth device that is connected. |
Jack He | d9837c8 | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 1325 | // Deprecated: use obfuscated_id instead, this one is always 0 for Q+ |
| 1326 | optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true]; |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1327 | // The profile that is connected. Eg. GATT, A2DP, HEADSET. |
| 1328 | // From android.bluetooth.BluetoothAdapter.java |
Jack He | d9837c8 | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 1329 | // Default: 0 when not used |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1330 | optional int32 bt_profile = 3; |
Jack He | d9837c8 | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 1331 | // An identifier that can be used to match events for this device. |
| 1332 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1333 | // Salt: Randomly generated 256 bit value |
| 1334 | // Hash algorithm: HMAC-SHA256 |
| 1335 | // Size: 32 byte |
| 1336 | // Default: null or empty if the device identifier is not known |
| 1337 | optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1338 | } |
| 1339 | |
| 1340 | /** |
| 1341 | * Logs when a Bluetooth device connects and disconnects over ACL |
| 1342 | * |
| 1343 | * Logged from: |
| 1344 | * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java |
| 1345 | * |
| 1346 | * Next Tag: 3 |
| 1347 | */ |
| 1348 | message BluetoothAclConnectionStateChanged { |
| 1349 | // An identifier that can be used to match events for this device. |
| 1350 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1351 | // Salt: Randomly generated 256 bit value |
| 1352 | // Hash algorithm: HMAC-SHA256 |
| 1353 | // Size: 32 byte |
| 1354 | // Default: null or empty if the device identifier is not known |
| 1355 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1356 | // The state of the connection. |
| 1357 | // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED. |
| 1358 | optional android.bluetooth.ConnectionStateEnum state = 2; |
| 1359 | } |
| 1360 | |
| 1361 | /** |
| 1362 | * Logs when a Bluetooth device connects and disconnects over SCO |
| 1363 | * |
| 1364 | * Logged from: |
| 1365 | * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java |
| 1366 | * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java |
| 1367 | * |
| 1368 | * Next Tag: 4 |
| 1369 | */ |
| 1370 | message BluetoothScoConnectionStateChanged { |
| 1371 | // An identifier that can be used to match events for this device. |
| 1372 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1373 | // Salt: Randomly generated 256 bit value |
| 1374 | // Hash algorithm: HMAC-SHA256 |
| 1375 | // Size: 32 byte |
| 1376 | // Default: null or empty if the device identifier is not known |
| 1377 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1378 | // The state of the connection. |
| 1379 | // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED. |
| 1380 | optional android.bluetooth.ConnectionStateEnum state = 2; |
| 1381 | // Codec used for this SCO connection |
| 1382 | // Default: UNKNOWN |
| 1383 | optional android.bluetooth.hfp.ScoCodec codec = 3; |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1384 | } |
| 1385 | |
Jack He | ab86dbd2 | 2018-12-18 15:43:27 -0800 | [diff] [blame] | 1386 | // Logs when there is an event affecting Bluetooth device's link layer connection. |
| 1387 | // - This event is triggered when there is a related HCI command or event |
| 1388 | // - Users of this metrics can deduce Bluetooth device's connection state from these events |
| 1389 | // - HCI commands are logged before the command is sent, after receiving command status, and after |
| 1390 | // receiving command complete |
| 1391 | // - HCI events are logged when they arrive |
| 1392 | // |
| 1393 | // Low level log from system/bt |
| 1394 | // |
| 1395 | // Bluetooth classic commands: |
| 1396 | // - CMD_CREATE_CONNECTION |
| 1397 | // - CMD_DISCONNECT |
| 1398 | // - CMD_CREATE_CONNECTION_CANCEL |
| 1399 | // - CMD_ACCEPT_CONNECTION_REQUEST |
| 1400 | // - CMD_REJECT_CONNECTION_REQUEST |
| 1401 | // - CMD_SETUP_ESCO_CONNECTION |
| 1402 | // - CMD_ACCEPT_ESCO_CONNECTION |
| 1403 | // - CMD_REJECT_ESCO_CONNECTION |
| 1404 | // - CMD_ENH_SETUP_ESCO_CONNECTION |
| 1405 | // - CMD_ENH_ACCEPT_ESCO_CONNECTION |
| 1406 | // |
| 1407 | // Bluetooth low energy commands: |
| 1408 | // - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00] |
| 1409 | // - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error] |
| 1410 | // - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00] |
| 1411 | // - CMD_BLE_CLEAR_WHITE_LIST |
| 1412 | // - CMD_BLE_ADD_WHITE_LIST |
| 1413 | // - CMD_BLE_REMOVE_WHITE_LIST |
| 1414 | // |
| 1415 | // Bluetooth classic events: |
| 1416 | // - EVT_CONNECTION_COMP |
| 1417 | // - EVT_CONNECTION_REQUEST |
| 1418 | // - EVT_DISCONNECTION_COMP |
| 1419 | // - EVT_ESCO_CONNECTION_COMP |
| 1420 | // - EVT_ESCO_CONNECTION_CHANGED |
| 1421 | // |
| 1422 | // Bluetooth low energy meta events: |
| 1423 | // - BLE_EVT_CONN_COMPLETE_EVT |
| 1424 | // - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT |
| 1425 | // |
| 1426 | // Next tag: 10 |
| 1427 | message BluetoothLinkLayerConnectionEvent { |
| 1428 | // An identifier that can be used to match events for this device. |
| 1429 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1430 | // Salt: Randomly generated 256 bit value |
| 1431 | // Hash algorithm: HMAC-SHA256 |
| 1432 | // Size: 32 byte |
| 1433 | // Default: null or empty if the device identifier is not known |
| 1434 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1435 | // Connection handle of this connection if available |
| 1436 | // Range: 0x0000 - 0x0EFF (12 bits) |
| 1437 | // Default: 0xFFFF if the handle is unknown |
| 1438 | optional int32 connection_handle = 2; |
| 1439 | // Direction of the link |
| 1440 | // Default: DIRECTION_UNKNOWN |
| 1441 | optional android.bluetooth.DirectionEnum direction = 3; |
| 1442 | // Type of this link |
| 1443 | // Default: LINK_TYPE_UNKNOWN |
| 1444 | optional android.bluetooth.LinkTypeEnum type = 4; |
| 1445 | |
| 1446 | // Reason metadata for this link layer connection event, rules for interpretation: |
| 1447 | // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or |
| 1448 | // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case |
| 1449 | // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is |
| 1450 | // set and valid, ignore hci_ble_event |
| 1451 | |
| 1452 | // HCI command associated with this event |
| 1453 | // Default: CMD_UNKNOWN |
| 1454 | optional android.bluetooth.hci.CommandEnum hci_cmd = 5; |
| 1455 | // HCI event associated with this event |
| 1456 | // Default: EVT_UNKNOWN |
| 1457 | optional android.bluetooth.hci.EventEnum hci_event = 6; |
| 1458 | // HCI BLE meta event associated with this event |
| 1459 | // Default: BLE_EVT_UNKNOWN |
| 1460 | optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7; |
| 1461 | // HCI command status code if this is triggerred by hci_cmd |
| 1462 | // Default: STATUS_UNKNOWN |
| 1463 | optional android.bluetooth.hci.StatusEnum cmd_status = 8; |
| 1464 | // HCI reason code associated with this event |
| 1465 | // Default: STATUS_UNKNOWN |
| 1466 | optional android.bluetooth.hci.StatusEnum reason_code = 9; |
| 1467 | } |
| 1468 | |
| 1469 | |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1470 | /** |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 1471 | * Logs when something is plugged into or removed from the USB-C connector. |
| 1472 | * |
| 1473 | * Logged from: |
Badhri Jagan Sridharan | 223b3c7 | 2018-11-16 16:02:35 -0800 | [diff] [blame] | 1474 | * UsbService |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 1475 | */ |
| 1476 | message UsbConnectorStateChanged { |
| 1477 | enum State { |
Badhri Jagan Sridharan | 223b3c7 | 2018-11-16 16:02:35 -0800 | [diff] [blame] | 1478 | STATE_DISCONNECTED = 0; |
| 1479 | STATE_CONNECTED = 1; |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 1480 | } |
| 1481 | optional State state = 1; |
Badhri Jagan Sridharan | 223b3c7 | 2018-11-16 16:02:35 -0800 | [diff] [blame] | 1482 | optional string id = 2; |
Badhri Jagan Sridharan | faf6207 | 2018-11-16 17:17:03 -0800 | [diff] [blame] | 1483 | // Last active session in ms. |
| 1484 | // 0 when the port is in connected state. |
| 1485 | optional int64 last_connect_duration_millis = 3; |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 1486 | } |
| 1487 | |
| 1488 | /** |
| 1489 | * Logs the reported speaker impedance. |
| 1490 | * |
| 1491 | * Logged from: |
| 1492 | * Vendor audio implementation. |
| 1493 | */ |
| 1494 | message SpeakerImpedanceReported { |
| 1495 | optional int32 speaker_location = 1; |
| 1496 | optional int32 impedance = 2; |
| 1497 | } |
| 1498 | |
| 1499 | /** |
| 1500 | * Logs the report of a failed hardware. |
| 1501 | * |
| 1502 | * Logged from: |
| 1503 | * Vendor HALs. |
| 1504 | * |
| 1505 | */ |
| 1506 | message HardwareFailed { |
| 1507 | enum HardwareType { |
| 1508 | HARDWARE_FAILED_UNKNOWN = 0; |
| 1509 | HARDWARE_FAILED_MICROPHONE = 1; |
| 1510 | HARDWARE_FAILED_CODEC = 2; |
| 1511 | HARDWARE_FAILED_SPEAKER = 3; |
| 1512 | HARDWARE_FAILED_FINGERPRINT = 4; |
| 1513 | } |
| 1514 | optional HardwareType hardware_type = 1; |
| 1515 | |
| 1516 | /* hardware_location allows vendors to differentiate between multiple instances of |
| 1517 | * the same hardware_type. The specific locations are vendor defined integers, |
| 1518 | * referring to board-specific numbering schemes. |
| 1519 | */ |
| 1520 | optional int32 hardware_location = 2; |
| 1521 | |
| 1522 | /* failure_code is specific to the HardwareType of the failed hardware. |
| 1523 | * It should use the enum values defined below. |
| 1524 | */ |
| 1525 | enum MicrophoneFailureCode { |
| 1526 | MICROPHONE_FAILURE_COMPLETE = 0; |
| 1527 | } |
| 1528 | enum CodecFailureCode { |
| 1529 | CODEC_FAILURE_COMPLETE = 0; |
| 1530 | } |
| 1531 | enum SpeakerFailureCode { |
| 1532 | SPEAKER_FAILURE_COMPLETE = 0; |
| 1533 | SPEAKER_FAILURE_HIGH_Z = 1; |
| 1534 | SPEAKER_FAILURE_SHORT = 2; |
| 1535 | } |
| 1536 | enum FingerprintFailureCode { |
| 1537 | FINGERPRINT_FAILURE_COMPLETE = 0; |
| 1538 | FINGERPRINT_SENSOR_BROKEN = 1; |
| 1539 | FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2; |
| 1540 | } |
| 1541 | optional int32 failure_code = 3; |
| 1542 | } |
| 1543 | |
| 1544 | /** |
| 1545 | * Log an event when the device has been physically dropped. |
| 1546 | * Reported from the /vendor partition. |
| 1547 | */ |
| 1548 | message PhysicalDropDetected { |
| 1549 | // Confidence that the event was actually a drop, 0 -> 100 |
| 1550 | optional int32 confidence_pctg = 1; |
| 1551 | // Peak acceleration of the drop, in 1/1000s of a g. |
| 1552 | optional int32 accel_peak_thousandths_g = 2; |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 1553 | // Duration of freefall in ms |
| 1554 | optional int32 freefall_time_millis = 3; |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 1555 | } |
| 1556 | |
| 1557 | /** |
| 1558 | * Log bucketed battery charge cycles. |
| 1559 | * |
| 1560 | * Each bucket represents cycles of the battery past |
Maggie White | 38c9d32 | 2018-11-20 10:07:52 -0800 | [diff] [blame] | 1561 | * a given charge point. For example, if 10 cycle buckets are |
| 1562 | * initialized, bucket 1 is the lowest 1/10th of the battery, |
| 1563 | * and bucket 10 is 100%. |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 1564 | * |
| 1565 | * Logged from: |
| 1566 | * /sys/class/power_supply/bms/cycle_count, via Vendor. |
| 1567 | */ |
| 1568 | message ChargeCyclesReported { |
| 1569 | optional int32 cycle_bucket_1 = 1; |
| 1570 | optional int32 cycle_bucket_2 = 2; |
| 1571 | optional int32 cycle_bucket_3 = 3; |
| 1572 | optional int32 cycle_bucket_4 = 4; |
| 1573 | optional int32 cycle_bucket_5 = 5; |
| 1574 | optional int32 cycle_bucket_6 = 6; |
| 1575 | optional int32 cycle_bucket_7 = 7; |
| 1576 | optional int32 cycle_bucket_8 = 8; |
Maggie White | 38c9d32 | 2018-11-20 10:07:52 -0800 | [diff] [blame] | 1577 | optional int32 cycle_bucket_9 = 9; |
| 1578 | optional int32 cycle_bucket_10 = 10; |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 1579 | } |
| 1580 | |
| 1581 | /** |
Howard Ro | a46b658 | 2018-09-18 16:45:02 -0700 | [diff] [blame] | 1582 | * Log battery health snapshot. |
| 1583 | * |
| 1584 | * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level |
| 1585 | * are snapshotted periodically over 24hrs. |
| 1586 | */ |
| 1587 | message BatteryHealthSnapshot { |
| 1588 | enum BatterySnapshotType { |
| 1589 | UNKNOWN = 0; |
| 1590 | MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs. |
| 1591 | MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs. |
| 1592 | MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs. |
| 1593 | MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs. |
| 1594 | MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs. |
| 1595 | MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs. |
| 1596 | MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs. |
| 1597 | MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs. |
| 1598 | MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs. |
| 1599 | MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs. |
| 1600 | AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs. |
| 1601 | } |
| 1602 | optional BatterySnapshotType type = 1; |
| 1603 | // Temperature, in 1/10ths of degree C. |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 1604 | optional int32 temperature_deci_celsius = 2; |
Howard Ro | a46b658 | 2018-09-18 16:45:02 -0700 | [diff] [blame] | 1605 | // Voltage Battery Voltage, in microVolts. |
| 1606 | optional int32 voltage_micro_volt = 3; |
| 1607 | // Current Battery current, in microAmps. |
| 1608 | optional int32 current_micro_amps = 4; |
| 1609 | // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts. |
| 1610 | optional int32 open_circuit_micro_volt = 5; |
| 1611 | // Resistance Battery Resistance, in microOhms. |
| 1612 | optional int32 resistance_micro_ohm = 6; |
| 1613 | // Level Battery Level, as % of full. |
| 1614 | optional int32 level_percent = 7; |
| 1615 | } |
| 1616 | |
| 1617 | /** |
| 1618 | * Log slow I/O operations on the primary storage. |
| 1619 | */ |
| 1620 | message SlowIo { |
| 1621 | // Classifications of IO Operations. |
| 1622 | enum IoOperation { |
| 1623 | UNKNOWN = 0; |
| 1624 | READ = 1; |
| 1625 | WRITE = 2; |
| 1626 | UNMAP = 3; |
| 1627 | SYNC = 4; |
| 1628 | } |
| 1629 | optional IoOperation operation = 1; |
| 1630 | |
| 1631 | // The number of slow IO operations of this type over 24 hours. |
| 1632 | optional int32 count = 2; |
| 1633 | } |
| 1634 | |
| 1635 | /** |
| 1636 | * Log battery caused shutdown with the last recorded voltage. |
| 1637 | */ |
| 1638 | message BatteryCausedShutdown { |
| 1639 | // The last recorded battery voltage prior to shutdown. |
| 1640 | optional int32 last_recorded_micro_volt = 1; |
| 1641 | } |
| 1642 | |
| 1643 | /** |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1644 | * Logs the duration of a davey (jank of >=700ms) when it occurs |
| 1645 | * |
| 1646 | * Logged from: |
| 1647 | * frameworks/base/libs/hwui/JankTracker.cpp |
| 1648 | */ |
| 1649 | message DaveyOccurred { |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1650 | // The UID that logged this atom. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1651 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1652 | |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1653 | // Amount of time it took to render the frame. Should be >=700ms. |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1654 | optional int64 jank_duration_millis = 2; |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1655 | } |
| 1656 | |
| 1657 | /** |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 1658 | * Logs phone signal strength changes. |
| 1659 | * |
| 1660 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1661 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 1662 | */ |
| 1663 | message PhoneSignalStrengthChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 1664 | // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 1665 | optional android.telephony.SignalStrengthEnum signal_strength = 1; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1666 | } |
| 1667 | |
Yangster | 4ccebea | 2018-10-09 17:09:02 -0700 | [diff] [blame] | 1668 | |
| 1669 | /** |
| 1670 | * Logs when the phone state, sim state or signal strength changes |
| 1671 | * |
| 1672 | * Logged from: |
| 1673 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 1674 | */ |
| 1675 | message PhoneServiceStateChanged { |
| 1676 | optional android.telephony.ServiceStateEnum state = 1; |
| 1677 | optional android.telephony.SimStateEnum sim_state = 2; |
| 1678 | optional android.telephony.SignalStrengthEnum signal_strength = 3; |
| 1679 | } |
| 1680 | |
| 1681 | /** |
| 1682 | * Logs when the phone becomes on or off. |
| 1683 | * |
| 1684 | * Logged from: |
| 1685 | * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java |
| 1686 | */ |
| 1687 | message PhoneStateChanged { |
| 1688 | enum State { |
| 1689 | OFF = 0; |
| 1690 | ON = 1; |
| 1691 | } |
| 1692 | optional State state = 1; |
| 1693 | } |
| 1694 | |
Hyunyoung Song | c6d6b77 | 2018-10-17 13:35:32 -0700 | [diff] [blame] | 1695 | message LauncherUIChanged { |
Yao Chen | 8c43386 | 2018-10-24 14:09:20 -0700 | [diff] [blame] | 1696 | optional android.stats.launcher.LauncherAction action = 1; |
| 1697 | optional android.stats.launcher.LauncherState src_state = 2; |
| 1698 | optional android.stats.launcher.LauncherState dst_state = 3; |
| 1699 | optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES]; |
Hyunyoung Song | c6d6b77 | 2018-10-17 13:35:32 -0700 | [diff] [blame] | 1700 | optional bool is_swipe_up_enabled = 5; |
| 1701 | } |
| 1702 | |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1703 | /** |
Fan Zhang | 916c13b | 2018-10-16 22:49:45 -0700 | [diff] [blame] | 1704 | * Logs when Settings UI has changed. |
| 1705 | * |
| 1706 | * Logged from: |
| 1707 | * packages/apps/Settings |
| 1708 | */ |
| 1709 | message SettingsUIChanged { |
| 1710 | /** |
Fan Zhang | 916c13b | 2018-10-16 22:49:45 -0700 | [diff] [blame] | 1711 | * Where this SettingsUIChange event comes from. For example, if |
| 1712 | * it's a PAGE_VISIBLE event, where the page is opened from. |
| 1713 | */ |
Fan Zhang | f837b8e | 2018-10-23 12:38:30 -0700 | [diff] [blame] | 1714 | optional android.app.settings.PageId attribution = 1; |
Fan Zhang | 916c13b | 2018-10-16 22:49:45 -0700 | [diff] [blame] | 1715 | |
| 1716 | /** |
| 1717 | * What the UI action is. |
| 1718 | */ |
Fan Zhang | f837b8e | 2018-10-23 12:38:30 -0700 | [diff] [blame] | 1719 | optional android.app.settings.Action action = 2; |
Fan Zhang | 916c13b | 2018-10-16 22:49:45 -0700 | [diff] [blame] | 1720 | |
| 1721 | /** |
| 1722 | * Where the action is happening |
| 1723 | */ |
Fan Zhang | ff2332b | 2018-12-06 15:16:41 -0800 | [diff] [blame] | 1724 | optional android.app.settings.PageId page_id = 3; |
Fan Zhang | 916c13b | 2018-10-16 22:49:45 -0700 | [diff] [blame] | 1725 | |
| 1726 | /** |
| 1727 | * What preference changed in this event. |
| 1728 | */ |
Fan Zhang | ff2332b | 2018-12-06 15:16:41 -0800 | [diff] [blame] | 1729 | optional string changed_preference_key = 4; |
Fan Zhang | 916c13b | 2018-10-16 22:49:45 -0700 | [diff] [blame] | 1730 | |
| 1731 | /** |
| 1732 | * The new value of the changed preference. |
| 1733 | */ |
Fan Zhang | ff2332b | 2018-12-06 15:16:41 -0800 | [diff] [blame] | 1734 | optional int64 changed_preference_int_value = 5; |
Fan Zhang | 916c13b | 2018-10-16 22:49:45 -0700 | [diff] [blame] | 1735 | } |
| 1736 | |
| 1737 | /** |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1738 | * Logs that a setting was updated. |
| 1739 | * Logged from: |
David Chen | bd78991 | 2018-03-16 17:19:55 -0700 | [diff] [blame] | 1740 | * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1741 | * The tag and is_default allow resetting of settings to default values based on the specified |
| 1742 | * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details. |
| 1743 | */ |
| 1744 | message SettingChanged { |
| 1745 | // The name of the setting. |
| 1746 | optional string setting = 1; |
| 1747 | |
| 1748 | // The change being imposed on this setting. May represent a number, eg "3". |
| 1749 | optional string value = 2; |
| 1750 | |
| 1751 | // The new value of this setting. For most settings, this is same as value. For some settings, |
| 1752 | // value is +X or -X where X represents an element in a set. For example, if the previous value |
| 1753 | // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C. |
| 1754 | // The +/- feature is currently only used for location_providers_allowed. |
| 1755 | optional string new_value = 3; |
| 1756 | |
| 1757 | // The previous value of this setting. |
| 1758 | optional string prev_value = 4; |
| 1759 | |
| 1760 | // The tag used with the is_default for resetting sets of settings. This is generally null. |
| 1761 | optional string tag = 5; |
| 1762 | |
Bookatz | 9086762 | 2018-01-31 15:05:57 -0800 | [diff] [blame] | 1763 | // True if this setting with tag should be resettable. |
| 1764 | optional bool is_default = 6; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1765 | |
David Chen | bd78991 | 2018-03-16 17:19:55 -0700 | [diff] [blame] | 1766 | // The associated user (for multi-user feature). Defined in android/os/UserHandle.java |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1767 | optional int32 user = 7; |
David Chen | bd78991 | 2018-03-16 17:19:55 -0700 | [diff] [blame] | 1768 | |
| 1769 | enum ChangeReason { |
| 1770 | UPDATED = 1; // Updated can be an insertion or an update. |
| 1771 | DELETED = 2; |
| 1772 | } |
| 1773 | optional ChangeReason reason = 8; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1774 | } |
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 1775 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1776 | /** |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 1777 | * Logs activity going to foreground or background |
| 1778 | * |
| 1779 | * Logged from: |
| 1780 | * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java |
| 1781 | */ |
| 1782 | message ActivityForegroundStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1783 | optional int32 uid = 1 [(is_uid) = true]; |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 1784 | optional string pkg_name = 2; |
| 1785 | optional string class_name = 3; |
| 1786 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1787 | enum State { |
| 1788 | BACKGROUND = 0; |
| 1789 | FOREGROUND = 1; |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 1790 | } |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1791 | optional State state = 4; |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 1792 | } |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1793 | |
| 1794 | /** |
Felix Lopez Luis | d95346a | 2018-12-12 10:32:32 +0000 | [diff] [blame] | 1795 | * Logs when a volume entered low Storage state. |
| 1796 | * Logged from: |
| 1797 | * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java |
| 1798 | */ |
| 1799 | message LowStorageStateChanged { |
| 1800 | // Volume that ran out of storage. |
| 1801 | optional string volume_description = 1; |
| 1802 | |
| 1803 | enum State { |
| 1804 | UNKNOWN = 0; |
| 1805 | OFF = 1; |
| 1806 | ON = 2; |
| 1807 | } |
| 1808 | optional State state = 2; |
| 1809 | } |
| 1810 | |
| 1811 | /** |
| 1812 | * Logs when an app is downgraded. |
| 1813 | * Logged from: |
| 1814 | * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java |
| 1815 | */ |
| 1816 | message AppDowngraded { |
| 1817 | optional string package_name = 1; |
| 1818 | // Size of the package (all data) before being downgraded. |
| 1819 | optional int64 size_in_bytes_before = 2; |
| 1820 | // Size of the package (all data) after being downgraded. |
| 1821 | optional int64 size_in_bytes_after = 3; |
| 1822 | |
| 1823 | optional bool aggressive = 4; |
| 1824 | } |
| 1825 | |
| 1826 | /** |
| 1827 | * Logs when an app is optimized after being downgraded. |
| 1828 | * Logged from: |
| 1829 | * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java |
| 1830 | */ |
| 1831 | message AppOptimizedAfterDowngraded { |
| 1832 | optional string package_name = 1; |
| 1833 | } |
| 1834 | |
| 1835 | /** |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1836 | * Logs when an app crashes. |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1837 | * Logged from: |
| 1838 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1839 | */ |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1840 | message AppCrashOccurred { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1841 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1842 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1843 | optional string event_type = 2; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1844 | |
| 1845 | // The name of the process. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1846 | // system_server if it is not by an app |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1847 | optional string process_name = 3; |
| 1848 | |
| 1849 | // The pid if available. -1 means not available. |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 1850 | optional sint32 pid = 4; |
Chenjie Yu | f17bf62 | 2018-04-02 14:22:19 -0700 | [diff] [blame] | 1851 | |
| 1852 | optional string package_name = 5; |
| 1853 | |
| 1854 | enum InstantApp { |
| 1855 | UNAVAILABLE = 0; |
| 1856 | FALSE = 1; |
| 1857 | TRUE = 2; |
| 1858 | } |
| 1859 | optional InstantApp is_instant_app = 6; |
| 1860 | |
| 1861 | enum ForegroundState { |
| 1862 | UNKNOWN = 0; |
| 1863 | BACKGROUND = 1; |
| 1864 | FOREGROUND = 2; |
| 1865 | } |
| 1866 | optional ForegroundState foreground_state = 7; |
Yang Lu | 732d638 | 2018-11-05 07:53:12 -0800 | [diff] [blame] | 1867 | |
| 1868 | optional android.server.ErrorSource error_source = 8; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1869 | } |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1870 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1871 | /** |
| 1872 | * Logs when a WTF (What a Terrible Failure) happened. |
| 1873 | * Logged from: |
| 1874 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1875 | */ |
| 1876 | message WTFOccurred { |
| 1877 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1878 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1879 | optional string tag = 2; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1880 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1881 | // The name of the process. |
| 1882 | // system_server if it is not by an app |
| 1883 | optional string process_name = 3; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 1884 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1885 | // The pid if available. -1 means not available. |
| 1886 | optional sint32 pid = 4; |
Yang Lu | 732d638 | 2018-11-05 07:53:12 -0800 | [diff] [blame] | 1887 | |
| 1888 | optional android.server.ErrorSource error_source = 5; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1889 | } |
| 1890 | |
| 1891 | /** |
| 1892 | * Logs when system server reports low memory. |
| 1893 | * Logged from: |
| 1894 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1895 | */ |
| 1896 | message LowMemReported { |
| 1897 | } |
| 1898 | |
| 1899 | /** |
| 1900 | * Logs when an app ANR (App Not Responding) occurs. |
| 1901 | * Logged from: |
| 1902 | * frameworks/base/services/core/java/com/android/server/am/AppErrors.java |
| 1903 | */ |
| 1904 | message ANROccurred { |
| 1905 | optional int32 uid = 1 [(is_uid) = true]; |
| 1906 | |
| 1907 | optional string process_name = 2; |
| 1908 | |
| 1909 | optional string short_component_name = 3; |
| 1910 | |
| 1911 | optional string reason = 4; |
Chenjie Yu | f17bf62 | 2018-04-02 14:22:19 -0700 | [diff] [blame] | 1912 | |
| 1913 | enum InstantApp { |
| 1914 | UNAVAILABLE = 0; |
| 1915 | FALSE = 1; |
| 1916 | TRUE = 2; |
| 1917 | } |
| 1918 | optional InstantApp is_instant_app = 5; |
| 1919 | |
| 1920 | enum ForegroundState { |
| 1921 | UNKNOWN = 0; |
| 1922 | BACKGROUND = 1; |
| 1923 | FOREGROUND = 2; |
| 1924 | } |
| 1925 | optional ForegroundState foreground_state = 6; |
Yang Lu | 732d638 | 2018-11-05 07:53:12 -0800 | [diff] [blame] | 1926 | |
| 1927 | optional android.server.ErrorSource error_source = 7; |
| 1928 | |
| 1929 | optional string package_name = 8; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1930 | } |
| 1931 | |
Bookatz | a7020bd | 2018-08-28 16:29:35 -0700 | [diff] [blame] | 1932 | /** |
| 1933 | * Logs when the vibrator state changes. |
| 1934 | * Logged from: |
| 1935 | * frameworks/base/services/core/java/com/android/server/VibratorService.java |
| 1936 | */ |
| 1937 | message VibratorStateChanged { |
| 1938 | repeated AttributionNode attribution_node = 1; |
| 1939 | |
| 1940 | enum State { |
| 1941 | OFF = 0; |
| 1942 | ON = 1; |
| 1943 | } |
| 1944 | optional State state = 2; |
| 1945 | |
| 1946 | // Duration (in milliseconds) requested to keep the vibrator on. |
| 1947 | // Only applicable for State == ON. |
| 1948 | optional int64 duration_millis = 3; |
| 1949 | } |
| 1950 | |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 1951 | /* |
| 1952 | * Allows other apps to push events into statsd. |
| 1953 | * Logged from: |
| 1954 | * frameworks/base/core/java/android/util/StatsLog.java |
| 1955 | */ |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1956 | message AppBreadcrumbReported { |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 1957 | // The uid of the application that sent this custom atom. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1958 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 1959 | |
| 1960 | // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16). |
| 1961 | optional int32 label = 2; |
| 1962 | |
| 1963 | // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom |
| 1964 | // predicates for the metrics). |
| 1965 | enum State { |
| 1966 | UNKNOWN = 0; |
| 1967 | UNSPECIFIED = 1; // For events that are known to not represent START/STOP. |
| 1968 | STOP = 2; |
| 1969 | START = 3; |
| 1970 | } |
| 1971 | optional State state = 3; |
| 1972 | } |
| 1973 | |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1974 | /** |
Bookatz | 7948c87 | 2018-09-04 12:58:33 -0700 | [diff] [blame] | 1975 | * Logs the wall-clock time when a significant wall-clock time shift occurs. |
| 1976 | * For example, this could be due to the user manually changing the time. |
| 1977 | * |
| 1978 | * Logged from: |
| 1979 | * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java |
| 1980 | */ |
| 1981 | message WallClockTimeShifted { |
| 1982 | // New wall-clock time in milliseconds, according to System.currentTimeMillis(). |
| 1983 | optional int64 wall_clock_timestamp_millis = 1; |
| 1984 | } |
| 1985 | |
| 1986 | /** |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1987 | * Logs when statsd detects an anomaly. |
| 1988 | * |
| 1989 | * Logged from: |
| 1990 | * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp |
| 1991 | */ |
| 1992 | message AnomalyDetected { |
| 1993 | // Uid that owns the config whose anomaly detection alert fired. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1994 | optional int32 config_uid = 1 [(is_uid) = true]; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1995 | |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 1996 | // Id of the config whose anomaly detection alert fired. |
| 1997 | optional int64 config_id = 2; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1998 | |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 1999 | // Id of the alert (i.e. name of the anomaly that was detected). |
| 2000 | optional int64 alert_id = 3; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 2001 | } |
| 2002 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2003 | message AppStartOccurred { |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2004 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2005 | optional int32 uid = 1 [(is_uid) = true]; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2006 | |
| 2007 | // The app package name. |
| 2008 | optional string pkg_name = 2; |
| 2009 | |
| 2010 | enum TransitionType { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2011 | UNKNOWN = 0; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2012 | WARM = 1; |
| 2013 | HOT = 2; |
| 2014 | COLD = 3; |
| 2015 | } |
| 2016 | // The transition type. |
| 2017 | optional TransitionType type = 3; |
| 2018 | |
| 2019 | // The activity name. |
| 2020 | optional string activity_name = 4; |
| 2021 | |
| 2022 | // The name of the calling app. Empty if not set. |
| 2023 | optional string calling_pkg_name = 5; |
| 2024 | |
| 2025 | // Whether the app is an instant app. |
| 2026 | optional bool is_instant_app = 6; |
| 2027 | |
| 2028 | // Device uptime when activity started. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2029 | optional int64 activity_start_millis = 7; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2030 | |
Bookatz | 80d11a0 | 2018-01-16 10:46:35 -0800 | [diff] [blame] | 2031 | optional android.app.AppTransitionReasonEnum reason = 8; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2032 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2033 | optional int32 transition_delay_millis = 9; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2034 | // -1 if not set. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2035 | optional int32 starting_window_delay_millis = 10; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2036 | // -1 if not set. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2037 | optional int32 bind_application_delay_millis = 11; |
| 2038 | optional int32 windows_drawn_delay_millis = 12; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2039 | |
| 2040 | // Empty if not set. |
| 2041 | optional string launch_token = 13; |
| 2042 | |
Calin Juravle | 759fbda | 2018-02-20 19:52:30 +0000 | [diff] [blame] | 2043 | // The compiler filter used when when the package was optimized. |
Calin Juravle | a86783b | 2018-03-21 14:25:59 -0700 | [diff] [blame] | 2044 | optional int32 package_optimization_compilation_filter = 14; |
Calin Juravle | 759fbda | 2018-02-20 19:52:30 +0000 | [diff] [blame] | 2045 | |
| 2046 | // The reason why the package was optimized. |
Calin Juravle | a86783b | 2018-03-21 14:25:59 -0700 | [diff] [blame] | 2047 | optional int32 package_optimization_compilation_reason = 15; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2048 | } |
| 2049 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2050 | message AppStartCanceled { |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2051 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2052 | optional int32 uid = 1 [(is_uid) = true]; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2053 | |
| 2054 | // The app package name. |
| 2055 | optional string pkg_name = 2; |
| 2056 | |
| 2057 | enum TransitionType { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2058 | UNKNOWN = 0; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2059 | WARM = 1; |
| 2060 | HOT = 2; |
| 2061 | COLD = 3; |
| 2062 | } |
| 2063 | // The transition type. |
| 2064 | optional TransitionType type = 3; |
| 2065 | |
| 2066 | // The activity name. |
| 2067 | optional string activity_name = 4; |
| 2068 | } |
| 2069 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2070 | message AppStartFullyDrawn { |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2071 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2072 | optional int32 uid = 1 [(is_uid) = true]; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2073 | |
| 2074 | // The app package name. |
| 2075 | optional string pkg_name = 2; |
| 2076 | |
| 2077 | enum TransitionType { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2078 | UNKNOWN = 0; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2079 | WITH_BUNDLE = 1; |
| 2080 | WITHOUT_BUNDLE = 2; |
| 2081 | } |
| 2082 | // The transition type. |
| 2083 | optional TransitionType type = 3; |
| 2084 | |
| 2085 | // The activity name. |
| 2086 | optional string activity_name = 4; |
| 2087 | |
| 2088 | optional bool transition_process_running = 5; |
| 2089 | |
| 2090 | // App startup time (until call to Activity#reportFullyDrawn()). |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2091 | optional int64 app_startup_time_millis = 6; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2092 | } |
| 2093 | |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 2094 | /** |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 2095 | * Logs a picture-in-picture action |
| 2096 | * Logged from: |
| 2097 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 2098 | * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java |
| 2099 | * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java |
| 2100 | */ |
| 2101 | message PictureInPictureStateChanged { |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 2102 | // -1 if it is not available |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2103 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 2104 | |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 2105 | optional string short_name = 2; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 2106 | |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 2107 | enum State { |
| 2108 | ENTERED = 1; |
| 2109 | EXPANDED_TO_FULL_SCREEN = 2; |
| 2110 | MINIMIZED = 3; |
| 2111 | DISMISSED = 4; |
| 2112 | } |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 2113 | optional State state = 3; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 2114 | } |
| 2115 | |
| 2116 | /** |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 2117 | * Logs overlay action |
| 2118 | * Logged from: |
| 2119 | * services/core/java/com/android/server/wm/Session.java |
| 2120 | */ |
| 2121 | message OverlayStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2122 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 2123 | |
| 2124 | optional string package_name = 2; |
| 2125 | |
| 2126 | optional bool using_alert_window = 3; |
| 2127 | |
| 2128 | enum State { |
| 2129 | ENTERED = 1; |
| 2130 | EXITED = 2; |
| 2131 | } |
| 2132 | optional State state = 4; |
| 2133 | } |
| 2134 | |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 2135 | /* |
| 2136 | * Logs foreground service starts and stops. |
| 2137 | * Note that this is not when a service starts or stops, but when it is |
| 2138 | * considered foreground. |
| 2139 | * Logged from |
| 2140 | * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java |
| 2141 | */ |
| 2142 | message ForegroundServiceStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2143 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 2144 | // package_name + "/" + class_name |
| 2145 | optional string short_name = 2; |
| 2146 | |
| 2147 | enum State { |
| 2148 | ENTER = 1; |
| 2149 | EXIT = 2; |
| 2150 | } |
| 2151 | optional State state = 3; |
| 2152 | } |
| 2153 | |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 2154 | /** |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2155 | * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky |
| 2156 | * behavior in its own uid. However, the metrics of these isolated uid's almost always should be |
| 2157 | * attributed back to the parent (host) uid. One example is Chrome. |
| 2158 | * |
| 2159 | * Logged from: |
| 2160 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 2161 | */ |
| 2162 | message IsolatedUidChanged { |
| 2163 | // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2164 | // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd. |
Bookatz | 3c64886 | 2018-05-25 13:32:43 -0700 | [diff] [blame] | 2165 | // This field is ignored when event == REMOVED. |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2166 | optional int32 parent_uid = 1; |
| 2167 | |
| 2168 | optional int32 isolated_uid = 2; |
| 2169 | |
| 2170 | // We expect an isolated uid to be removed before if it's used for another parent uid. |
| 2171 | enum Event { |
| 2172 | REMOVED = 0; |
| 2173 | CREATED = 1; |
| 2174 | } |
| 2175 | optional Event event = 3; |
| 2176 | } |
| 2177 | |
| 2178 | /* |
| 2179 | * Logs the reception of an incoming network packet causing the main system to wake up for |
| 2180 | * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd |
| 2181 | * and processed by WakeupController.cpp. |
| 2182 | */ |
| 2183 | message PacketWakeupOccurred { |
| 2184 | // The uid owning the socket into which the packet was delivered, or -1 if the packet was |
| 2185 | // delivered nowhere. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2186 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2187 | // The interface name on which the packet was received. |
| 2188 | optional string iface = 2; |
| 2189 | // The ethertype value of the packet. |
| 2190 | optional int32 ethertype = 3; |
| 2191 | // String representation of the destination MAC address of the packet. |
| 2192 | optional string destination_hardware_address = 4; |
| 2193 | // String representation of the source address of the packet if this was an IP packet. |
| 2194 | optional string source_ip = 5; |
| 2195 | // String representation of the destination address of the packet if this was an IP packet. |
| 2196 | optional string destination_ip = 6; |
| 2197 | // The value of the protocol field if this was an IPv4 packet or the value of the Next Header |
| 2198 | // field if this was an IPv6 packet. The range of possible values is the same for both IP |
| 2199 | // families. |
| 2200 | optional int32 ip_next_header = 7; |
| 2201 | // The source port if this was a TCP or UDP packet. |
| 2202 | optional int32 source_port = 8; |
| 2203 | // The destination port if this was a TCP or UDP packet. |
| 2204 | optional int32 destination_port = 9; |
| 2205 | } |
| 2206 | |
| 2207 | /* |
| 2208 | * Logs the memory stats for an app on startup. |
| 2209 | * Logged from: |
| 2210 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 2211 | */ |
| 2212 | message AppStartMemoryStateCaptured { |
| 2213 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2214 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2215 | |
| 2216 | // The process name. |
| 2217 | optional string process_name = 2; |
| 2218 | |
| 2219 | // The activity name. |
| 2220 | optional string activity_name = 3; |
| 2221 | |
| 2222 | // # of page-faults |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 2223 | optional int64 page_fault = 4; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2224 | |
| 2225 | // # of major page-faults |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 2226 | optional int64 page_major_fault = 5; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2227 | |
| 2228 | // RSS |
| 2229 | optional int64 rss_in_bytes = 6; |
| 2230 | |
| 2231 | // CACHE |
| 2232 | optional int64 cache_in_bytes = 7; |
| 2233 | |
| 2234 | // SWAP |
| 2235 | optional int64 swap_in_bytes = 8; |
| 2236 | } |
| 2237 | |
| 2238 | /* |
| 2239 | * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries |
| 2240 | * for LMK event. |
| 2241 | * Logged from: |
| 2242 | * system/core/lmkd/lmkd.c |
| 2243 | */ |
| 2244 | message LmkStateChanged { |
| 2245 | enum State { |
| 2246 | UNKNOWN = 0; |
| 2247 | START = 1; |
| 2248 | STOP = 2; |
| 2249 | } |
| 2250 | optional State state = 1; |
| 2251 | } |
| 2252 | |
| 2253 | /* |
| 2254 | * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure. |
| 2255 | * Logged from: |
| 2256 | * system/core/lmkd/lmkd.c |
| 2257 | */ |
| 2258 | message LmkKillOccurred { |
| 2259 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2260 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2261 | |
| 2262 | // The process name. |
| 2263 | optional string process_name = 2; |
| 2264 | |
| 2265 | // oom adj score. |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 2266 | optional int32 oom_adj_score = 3; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2267 | |
| 2268 | // # of page-faults |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 2269 | optional int64 page_fault = 4; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2270 | |
| 2271 | // # of major page-faults |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 2272 | optional int64 page_major_fault = 5; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2273 | |
| 2274 | // RSS |
| 2275 | optional int64 rss_in_bytes = 6; |
| 2276 | |
| 2277 | // CACHE |
| 2278 | optional int64 cache_in_bytes = 7; |
| 2279 | |
| 2280 | // SWAP |
| 2281 | optional int64 swap_in_bytes = 8; |
Jim Blackler | 8593d1f | 2018-11-21 15:24:48 +0000 | [diff] [blame] | 2282 | |
| 2283 | // The elapsed real time of start of the process. |
| 2284 | optional int64 process_start_time_nanos = 9; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2285 | } |
| 2286 | |
Rajeev Kumar | 51b5460 | 2018-03-01 12:18:26 -0800 | [diff] [blame] | 2287 | /* |
| 2288 | * Logs when the ActivityManagerService detects that an app died. |
| 2289 | * |
| 2290 | * Logged from: |
| 2291 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 2292 | */ |
| 2293 | message AppDied { |
| 2294 | // timestamp(elapsedRealtime) of record creation |
Yangster-mac | b6b77c6 | 2018-10-12 19:33:24 -0700 | [diff] [blame] | 2295 | optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE]; |
Rajeev Kumar | 51b5460 | 2018-03-01 12:18:26 -0800 | [diff] [blame] | 2296 | } |
| 2297 | |
Howard Ro | 21a039c | 2018-08-06 14:55:47 -0700 | [diff] [blame] | 2298 | /** |
| 2299 | * An atom for generic metrics logging. Available from Android Q. |
| 2300 | */ |
| 2301 | message GenericAtom { |
| 2302 | // The uid of the application that sent this custom atom. |
| 2303 | optional int32 uid = 1 [(is_uid) = true]; |
| 2304 | |
| 2305 | // An event_id indicates the type of event. |
Howard Ro | 9a862de | 2018-10-11 16:03:33 -0700 | [diff] [blame] | 2306 | optional android.stats.EventType event_id = 2; |
Howard Ro | 21a039c | 2018-08-06 14:55:47 -0700 | [diff] [blame] | 2307 | } |
| 2308 | |
Tej Singh | d6d6d77 | 2018-09-05 17:41:25 -0700 | [diff] [blame] | 2309 | /** |
| 2310 | * Logs when a fingerprint acquire event occurs. |
| 2311 | * |
| 2312 | * Logged from: |
| 2313 | * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java |
| 2314 | */ |
| 2315 | message FingerprintAcquired { |
| 2316 | // The associated user. Eg: 0 for owners, 10+ for others. |
| 2317 | // Defined in android/os/UserHandle.java |
| 2318 | optional int32 user = 1; |
| 2319 | // If this acquire is for a crypto fingerprint. |
| 2320 | // e.g. Secure purchases, unlock password storage. |
| 2321 | optional bool is_crypto = 2; |
| 2322 | } |
| 2323 | |
| 2324 | /** |
| 2325 | * Logs when a fingerprint authentication event occurs. |
| 2326 | * |
| 2327 | * Logged from: |
| 2328 | * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java |
| 2329 | */ |
| 2330 | message FingerprintAuthenticated { |
| 2331 | // The associated user. Eg: 0 for owners, 10+ for others. |
| 2332 | // Defined in android/os/UserHandle.java |
| 2333 | optional int32 user = 1; |
| 2334 | // If this authentication is for a crypto fingerprint. |
| 2335 | // e.g. Secure purchases, unlock password storage. |
| 2336 | optional bool is_crypto = 2; |
| 2337 | // Whether or not this authentication was successful. |
| 2338 | optional bool is_authenticated = 3; |
| 2339 | } |
| 2340 | |
| 2341 | /** |
| 2342 | * Logs when a fingerprint error occurs. |
| 2343 | * |
| 2344 | * Logged from: |
| 2345 | * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java |
| 2346 | */ |
| 2347 | message FingerprintErrorOccurred { |
| 2348 | // The associated user. Eg: 0 for owners, 10+ for others. |
| 2349 | // Defined in android/os/UserHandle.java |
| 2350 | optional int32 user = 1; |
| 2351 | // If this error is for a crypto fingerprint. |
| 2352 | // e.g. Secure purchases, unlock password storage. |
| 2353 | optional bool is_crypto = 2; |
| 2354 | |
| 2355 | enum Error { |
| 2356 | UNKNOWN = 0; |
| 2357 | LOCKOUT = 1; |
| 2358 | PERMANENT_LOCKOUT = 2; |
| 2359 | } |
| 2360 | // The type of error. |
| 2361 | optional Error error = 3; |
| 2362 | } |
Howard Ro | 688ae18 | 2018-09-25 00:09:36 -0700 | [diff] [blame] | 2363 | |
| 2364 | message Notification { |
| 2365 | |
| 2366 | // Type of notification event. |
| 2367 | enum Type { |
| 2368 | TYPE_UNKNOWN = 0; |
| 2369 | // Notification became visible to the user. |
| 2370 | TYPE_OPEN = 1; |
| 2371 | // Notification became hidden. |
| 2372 | TYPE_CLOSE = 2; |
| 2373 | // Notification switched to detail mode. |
| 2374 | TYPE_DETAIL = 3; |
| 2375 | // Notification was clicked. |
| 2376 | TYPE_ACTION = 4; |
| 2377 | // Notification was dismissed. |
| 2378 | TYPE_DISMISS = 5; |
| 2379 | // Notification switched to summary mode. The enum value of 14 is to |
| 2380 | // match that of metrics_constants. |
| 2381 | TYPE_COLLAPSE = 14; |
| 2382 | } |
| 2383 | optional Type type = 1; |
| 2384 | |
| 2385 | // Package name associated with the notification. |
| 2386 | optional string package_name = 2; |
| 2387 | |
| 2388 | // Tag associated with notification. |
| 2389 | optional string tag = 3; |
| 2390 | |
| 2391 | // Application-supplied ID associated with the notification. |
| 2392 | optional int32 id = 4; |
| 2393 | |
| 2394 | // Index of notification in the notification panel. |
| 2395 | optional int32 shade_index = 5; |
| 2396 | |
| 2397 | // The number of notifications in the notification panel. |
| 2398 | optional int32 shade_count = 6; |
| 2399 | |
| 2400 | // Importance for the notification. |
| 2401 | optional int32 importance = 7; |
| 2402 | |
| 2403 | // ID for the notification channel. |
Howard Ro | 183c2bd | 2018-10-18 13:52:10 -0700 | [diff] [blame] | 2404 | optional string channel_id = 8; |
Howard Ro | 688ae18 | 2018-09-25 00:09:36 -0700 | [diff] [blame] | 2405 | |
| 2406 | // Importance for the notification channel. |
| 2407 | optional int32 channel_importance = 9; |
| 2408 | |
Howard Ro | 183c2bd | 2018-10-18 13:52:10 -0700 | [diff] [blame] | 2409 | // Application-supplied ID associated with the notifications group. |
| 2410 | optional string group_id = 10; |
| 2411 | |
Howard Ro | 688ae18 | 2018-09-25 00:09:36 -0700 | [diff] [blame] | 2412 | // Whether notification was a group summary. |
Howard Ro | 183c2bd | 2018-10-18 13:52:10 -0700 | [diff] [blame] | 2413 | optional bool group_summary = 11; |
Howard Ro | 688ae18 | 2018-09-25 00:09:36 -0700 | [diff] [blame] | 2414 | |
Howard Ro | 183c2bd | 2018-10-18 13:52:10 -0700 | [diff] [blame] | 2415 | // Reason for dismissal of a notification. This field is only meaningful for |
| 2416 | // TYPE_DISMISS events. |
| 2417 | optional int32 dismiss_reason = 12; |
Howard Ro | 688ae18 | 2018-09-25 00:09:36 -0700 | [diff] [blame] | 2418 | |
Howard Ro | 183c2bd | 2018-10-18 13:52:10 -0700 | [diff] [blame] | 2419 | // The first post time of notification, stable across updates. |
| 2420 | optional int64 creation_millis = 13; |
Howard Ro | 688ae18 | 2018-09-25 00:09:36 -0700 | [diff] [blame] | 2421 | |
Howard Ro | 183c2bd | 2018-10-18 13:52:10 -0700 | [diff] [blame] | 2422 | // The most recent interruption time, or the creation time if no updates. |
| 2423 | // Differs from update_millis because updates are filtered based on whether |
| 2424 | // they actually interrupted the user. |
| 2425 | optional int64 interruption_millis = 14; |
Howard Ro | 688ae18 | 2018-09-25 00:09:36 -0700 | [diff] [blame] | 2426 | |
Howard Ro | 183c2bd | 2018-10-18 13:52:10 -0700 | [diff] [blame] | 2427 | // The most recent update time, or the creation time if no updates. |
| 2428 | optional int64 update_millis = 15; |
| 2429 | |
| 2430 | // The most recent visibility event. |
| 2431 | optional int64 visible_millis = 16; |
Howard Ro | 688ae18 | 2018-09-25 00:09:36 -0700 | [diff] [blame] | 2432 | } |
| 2433 | |
Chenjie Yu | ae9dfac | 2018-10-25 16:06:56 -0700 | [diff] [blame] | 2434 | /* |
Yangster-mac | b89807e | 2018-11-15 21:10:57 -0800 | [diff] [blame] | 2435 | * Logs when a flag flip state changes. |
| 2436 | * Logged in P/h. |
| 2437 | */ |
| 2438 | message PhenotypeFlagStateChanged { |
| 2439 | // Mendel configuration name. |
| 2440 | optional string mendel_config_name = 1; |
| 2441 | // State |
| 2442 | enum State { |
| 2443 | STATE_UNKNOWN = 0; |
| 2444 | COMMITTED = 1; |
| 2445 | } |
| 2446 | optional State state = 2; |
| 2447 | } |
| 2448 | |
| 2449 | /* |
| 2450 | * Logs when a binary push state changes. |
| 2451 | * Logged in Play store |
| 2452 | */ |
| 2453 | message BinaryPushStateChanged { |
| 2454 | // Binary package name. |
| 2455 | optional string binary_name = 1; |
| 2456 | // Version code. |
| 2457 | optional int64 version = 2; |
| 2458 | // State |
| 2459 | enum State { |
| 2460 | STATE_UNKNOWN = 0; |
| 2461 | DOWNLOAD_START = 1; |
| 2462 | DOWNLOAD_DONE = 2; |
| 2463 | INSTALL_START = 3; |
| 2464 | INSTALL_DONE = 4; |
| 2465 | REBOOT_START = 5; |
| 2466 | REBOOT_DONE = 6; |
| 2467 | } |
| 2468 | optional State state = 3; |
| 2469 | } |
| 2470 | |
| 2471 | /* |
Chenjie Yu | ae9dfac | 2018-10-25 16:06:56 -0700 | [diff] [blame] | 2472 | * Logs when a connection becomes available and lost. |
| 2473 | * Logged in StatsCompanionService.java |
| 2474 | */ |
| 2475 | message ConnectivityStateChanged { |
Chenjie Yu | 75b3c49 | 2018-10-06 21:45:19 -0700 | [diff] [blame] | 2476 | // Id of the network. |
| 2477 | optional int32 net_id = 1; |
| 2478 | |
| 2479 | enum State { |
| 2480 | UNKNOWN = 0; |
| 2481 | CONNECTED = 1; |
| 2482 | DISCONNECTED = 2; |
| 2483 | } |
| 2484 | // Connected state of a network. |
| 2485 | optional State state = 2; |
| 2486 | } |
| 2487 | |
| 2488 | /** |
| 2489 | * Logs when a service starts and stops. |
| 2490 | * Logged from: |
| 2491 | * services/core/java/com/android/server/am/ActiveServices.java |
| 2492 | */ |
| 2493 | message ServiceStateChanged { |
| 2494 | |
| 2495 | optional int32 uid = 1 [(is_uid) = true]; |
| 2496 | |
| 2497 | optional string package_name = 2; |
| 2498 | |
| 2499 | optional string service_name = 3; |
Chenjie Yu | ae9dfac | 2018-10-25 16:06:56 -0700 | [diff] [blame] | 2500 | |
| 2501 | enum State { |
Chenjie Yu | 75b3c49 | 2018-10-06 21:45:19 -0700 | [diff] [blame] | 2502 | START = 1; |
| 2503 | STOP = 2; |
Chenjie Yu | ae9dfac | 2018-10-25 16:06:56 -0700 | [diff] [blame] | 2504 | } |
Chenjie Yu | 75b3c49 | 2018-10-06 21:45:19 -0700 | [diff] [blame] | 2505 | |
| 2506 | optional State state = 4; |
| 2507 | } |
| 2508 | |
| 2509 | /** |
| 2510 | * Logs when a service is launched. |
| 2511 | * Logged from: |
| 2512 | * services/core/java/com/android/server/am/ActiveServices.java |
| 2513 | */ |
| 2514 | message ServiceLaunchReported { |
| 2515 | |
| 2516 | optional int32 uid = 1 [(is_uid) = true]; |
| 2517 | |
| 2518 | optional string package_name = 2; |
| 2519 | |
| 2520 | optional string service_name = 3; |
Chenjie Yu | ae9dfac | 2018-10-25 16:06:56 -0700 | [diff] [blame] | 2521 | } |
Howard Ro | 688ae18 | 2018-09-25 00:09:36 -0700 | [diff] [blame] | 2522 | |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2523 | ////////////////////////////////////////////////////////////////////// |
| 2524 | // Pulled atoms below this line // |
| 2525 | ////////////////////////////////////////////////////////////////////// |
| 2526 | |
| 2527 | /** |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2528 | * Pulls bytes transferred via wifi (Sum of foreground and background usage). |
| 2529 | * |
| 2530 | * Pulled from: |
| 2531 | * StatsCompanionService (using BatteryStats to get which interfaces are wifi) |
| 2532 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2533 | message WifiBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2534 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2535 | |
| 2536 | optional int64 rx_bytes = 2; |
| 2537 | |
| 2538 | optional int64 rx_packets = 3; |
| 2539 | |
| 2540 | optional int64 tx_bytes = 4; |
| 2541 | |
| 2542 | optional int64 tx_packets = 5; |
| 2543 | } |
| 2544 | |
| 2545 | /** |
| 2546 | * Pulls bytes transferred via wifi (separated by foreground and background usage). |
| 2547 | * |
| 2548 | * Pulled from: |
| 2549 | * StatsCompanionService (using BatteryStats to get which interfaces are wifi) |
| 2550 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2551 | message WifiBytesTransferByFgBg { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2552 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2553 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2554 | // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats. |
| 2555 | optional bool is_foreground = 2; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2556 | |
| 2557 | optional int64 rx_bytes = 3; |
| 2558 | |
| 2559 | optional int64 rx_packets = 4; |
| 2560 | |
| 2561 | optional int64 tx_bytes = 5; |
| 2562 | |
| 2563 | optional int64 tx_packets = 6; |
| 2564 | } |
| 2565 | |
| 2566 | /** |
| 2567 | * Pulls bytes transferred via mobile networks (Sum of foreground and background usage). |
| 2568 | * |
| 2569 | * Pulled from: |
| 2570 | * StatsCompanionService (using BatteryStats to get which interfaces are mobile data) |
| 2571 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2572 | message MobileBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2573 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2574 | |
| 2575 | optional int64 rx_bytes = 2; |
| 2576 | |
| 2577 | optional int64 rx_packets = 3; |
| 2578 | |
| 2579 | optional int64 tx_bytes = 4; |
| 2580 | |
| 2581 | optional int64 tx_packets = 5; |
| 2582 | } |
| 2583 | |
| 2584 | /** |
| 2585 | * Pulls bytes transferred via mobile networks (separated by foreground and background usage). |
| 2586 | * |
| 2587 | * Pulled from: |
| 2588 | * StatsCompanionService (using BatteryStats to get which interfaces are mobile data) |
| 2589 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2590 | message MobileBytesTransferByFgBg { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2591 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2592 | |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2593 | // 1 denotes foreground and 0 denotes background. This is called Set in |
| 2594 | // NetworkStats. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2595 | optional bool is_foreground = 2; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2596 | |
| 2597 | optional int64 rx_bytes = 3; |
| 2598 | |
| 2599 | optional int64 rx_packets = 4; |
| 2600 | |
| 2601 | optional int64 tx_bytes = 5; |
| 2602 | |
| 2603 | optional int64 tx_packets = 6; |
| 2604 | } |
| 2605 | |
| 2606 | /** |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2607 | * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller. |
| 2608 | * |
| 2609 | * Pulled from: |
| 2610 | * StatsCompanionService |
| 2611 | */ |
| 2612 | message BluetoothBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2613 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2614 | |
| 2615 | optional int64 rx_bytes = 2; |
| 2616 | |
| 2617 | optional int64 tx_bytes = 3; |
| 2618 | } |
| 2619 | |
| 2620 | /** |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2621 | * Pulls the kernel wakelock durations. This atom is adapted from |
| 2622 | * android/internal/os/KernelWakelockStats.java |
| 2623 | * |
| 2624 | * Pulled from: |
| 2625 | * StatsCompanionService using KernelWakelockReader. |
| 2626 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2627 | message KernelWakelock { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2628 | optional string name = 1; |
| 2629 | |
| 2630 | optional int32 count = 2; |
| 2631 | |
| 2632 | optional int32 version = 3; |
| 2633 | |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 2634 | optional int64 time_micros = 4; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2635 | } |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 2636 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2637 | /** |
Benjamin Schwartz | 51329b7 | 2018-12-06 10:48:03 -0800 | [diff] [blame] | 2638 | * Pulls low power state information. If power.stats HAL is not available, this |
| 2639 | * includes platform and subsystem sleep state information, |
| 2640 | * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState |
| 2641 | * as defined in: |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 2642 | * hardware/interfaces/power/1.0/types.hal |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 2643 | * hardware/interfaces/power/1.1/types.hal |
Benjamin Schwartz | 51329b7 | 2018-12-06 10:48:03 -0800 | [diff] [blame] | 2644 | * If power.stats HAL is available, this includes PowerEntityStateResidencyResult |
| 2645 | * as defined in: |
| 2646 | * hardware/interfaces/power/stats/1.0/types.hal |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 2647 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2648 | message SubsystemSleepState { |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2649 | // Subsystem name |
| 2650 | optional string subsystem_name = 1; |
| 2651 | // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty. |
| 2652 | // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name. |
Benjamin Schwartz | 51329b7 | 2018-12-06 10:48:03 -0800 | [diff] [blame] | 2653 | // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the |
| 2654 | // powerEntityStateName from the corresponding PowerEntityStateInfo. |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2655 | optional string subname = 2; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 2656 | // The number of times it entered, or voted for entering the sleep state |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2657 | optional uint64 count = 3; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 2658 | // The length of time spent in, or spent voting for, the sleep state |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2659 | optional uint64 time_millis = 4; |
David Chen | 2158296 | 2017-11-01 17:32:46 -0700 | [diff] [blame] | 2660 | } |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 2661 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2662 | /** |
Bookatz | 92da283 | 2018-11-01 18:10:03 -0700 | [diff] [blame] | 2663 | * Pulls on-device power measurement information. |
| 2664 | * Data defined by hardware/interfaces/power/stats/1.0/types.hal. |
| 2665 | * Pulled from: |
| 2666 | * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp |
| 2667 | */ |
| 2668 | message OnDevicePowerMeasurement { |
| 2669 | // Name of the subsystem (to which the rail belongs). |
| 2670 | optional string subsystem_name = 1; |
| 2671 | |
| 2672 | // Rail name. The rail lies within the subsystem. |
| 2673 | optional string rail_name = 2; |
| 2674 | |
| 2675 | // Time (in ms since boot) at which the rail energy value was measured. |
| 2676 | // This may differ slightly from the time that statsd logs this information. |
| 2677 | optional uint64 measurement_timestamp_millis = 3; |
| 2678 | |
| 2679 | // Accumulated energy used via the rail since device boot in uWs. |
| 2680 | optional uint64 energy_microwatt_secs = 4; |
| 2681 | } |
| 2682 | |
| 2683 | /** |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 2684 | * Pulls Cpu time per frequency. |
Chenjie Yu | 1ee9b74 | 2018-01-10 16:02:57 -0800 | [diff] [blame] | 2685 | * Pulls the time the cpu spend on the frequency index. Frequency index |
| 2686 | * starts from highest to lowest. The value should be monotonically |
| 2687 | * increasing since boot. However, if there is a cpu |
| 2688 | * hotplug event, the value would be reset as well. |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 2689 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2690 | message CpuTimePerFreq { |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 2691 | optional uint32 cluster = 1; |
| 2692 | optional uint32 freq_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2693 | optional uint64 time_millis = 3; |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 2694 | } |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 2695 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2696 | /** |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 2697 | * Pulls Cpu Time Per Uid. |
| 2698 | * Note that isolated process uid time should be attributed to host uids. |
| 2699 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2700 | message CpuTimePerUid { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2701 | optional int32 uid = 1 [(is_uid) = true]; |
Misha Wagner | 6bc6c91 | 2018-11-16 13:19:54 +0000 | [diff] [blame] | 2702 | optional uint64 user_time_micros = 2; |
| 2703 | optional uint64 sys_time_micros = 3; |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 2704 | } |
| 2705 | |
| 2706 | /** |
| 2707 | * Pulls Cpu Time Per Uid per frequency. |
| 2708 | * Note that isolated process uid time should be attributed to host uids. |
| 2709 | * For each uid, we order the time by descending frequencies. |
| 2710 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2711 | message CpuTimePerUidFreq { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2712 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 2713 | optional uint32 freq_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2714 | optional uint64 time_millis = 3; |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 2715 | } |
Hugo Benichi | 884970e | 2017-11-14 22:42:46 +0900 | [diff] [blame] | 2716 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2717 | /** |
| 2718 | * Pulls Wifi Controller Activity Energy Info |
| 2719 | */ |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2720 | message WifiActivityInfo { |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2721 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2722 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2723 | // stack reported state |
| 2724 | // TODO: replace this with proto enum |
| 2725 | optional int32 stack_state = 2; |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 2726 | // tx time in millis |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2727 | optional uint64 controller_tx_time_millis = 3; |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 2728 | // rx time in millis |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2729 | optional uint64 controller_rx_time_millis = 4; |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 2730 | // idle time in millis |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2731 | optional uint64 controller_idle_time_millis = 5; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2732 | // product of current(mA), voltage(V) and time(ms) |
| 2733 | optional uint64 controller_energy_used = 6; |
| 2734 | } |
| 2735 | |
| 2736 | /** |
| 2737 | * Pulls Modem Activity Energy Info |
| 2738 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2739 | message ModemActivityInfo { |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2740 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2741 | optional uint64 timestamp_millis = 1; |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 2742 | // sleep time in millis. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2743 | optional uint64 sleep_time_millis = 2; |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 2744 | // idle time in millis |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2745 | optional uint64 controller_idle_time_millis = 3; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2746 | /** |
| 2747 | * Tx power index |
| 2748 | * index 0 = tx_power < 0dBm |
| 2749 | * index 1 = 0dBm < tx_power < 5dBm |
| 2750 | * index 2 = 5dBm < tx_power < 15dBm |
| 2751 | * index 3 = 15dBm < tx_power < 20dBm |
| 2752 | * index 4 = tx_power > 20dBm |
| 2753 | */ |
| 2754 | // tx time in ms at power level 0 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2755 | optional uint64 controller_tx_time_pl0_millis = 4; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2756 | // tx time in ms at power level 1 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2757 | optional uint64 controller_tx_time_pl1_millis = 5; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2758 | // tx time in ms at power level 2 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2759 | optional uint64 controller_tx_time_pl2_millis = 6; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2760 | // tx time in ms at power level 3 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2761 | optional uint64 controller_tx_time_pl3_millis = 7; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2762 | // tx time in ms at power level 4 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2763 | optional uint64 controller_tx_time_pl4_millis = 8; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2764 | // rx time in ms at power level 5 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2765 | optional uint64 controller_rx_time_millis = 9; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2766 | // product of current(mA), voltage(V) and time(ms) |
| 2767 | optional uint64 energy_used = 10; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 2768 | } |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 2769 | |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2770 | /** |
| 2771 | * Pulls Bluetooth Activity Energy Info |
| 2772 | * Note: BluetoothBytesTransfer is pulled at the same time from the controller. |
| 2773 | */ |
| 2774 | message BluetoothActivityInfo { |
| 2775 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2776 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2777 | // bluetooth stack state |
| 2778 | optional int32 bluetooth_stack_state = 2; |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 2779 | // tx time in millis |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2780 | optional uint64 controller_tx_time_millis = 3; |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 2781 | // rx time in millis |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2782 | optional uint64 controller_rx_time_millis = 4; |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 2783 | // idle time in millis |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2784 | optional uint64 controller_idle_time_millis = 5; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2785 | // product of current(mA), voltage(V) and time(ms) |
| 2786 | optional uint64 energy_used = 6; |
| 2787 | } |
| 2788 | |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 2789 | /* |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2790 | * Logs the memory stats for a process. |
Rafal Slawik | da51b93 | 2018-12-13 16:31:33 +0000 | [diff] [blame] | 2791 | * |
| 2792 | * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService). |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2793 | */ |
| 2794 | message ProcessMemoryState { |
| 2795 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2796 | optional int32 uid = 1 [(is_uid) = true]; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2797 | |
| 2798 | // The process name. |
Rafal Slawik | da51b93 | 2018-12-13 16:31:33 +0000 | [diff] [blame] | 2799 | // Usually package name, "system" for system server. |
| 2800 | // Provided by ActivityManagerService. |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2801 | optional string process_name = 2; |
| 2802 | |
Rafal Slawik | da51b93 | 2018-12-13 16:31:33 +0000 | [diff] [blame] | 2803 | // Current OOM score adjustment. Value read from ProcessRecord. |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 2804 | optional int32 oom_adj_score = 3; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2805 | |
| 2806 | // # of page-faults |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 2807 | optional int64 page_fault = 4; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2808 | |
| 2809 | // # of major page-faults |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 2810 | optional int64 page_major_fault = 5; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2811 | |
Rajeev Kumar | 9023599 | 2018-01-29 11:06:48 -0800 | [diff] [blame] | 2812 | // RSS |
Rafal Slawik | da51b93 | 2018-12-13 16:31:33 +0000 | [diff] [blame] | 2813 | // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field |
| 2814 | // total_rss if per-app memory cgroups are enabled. |
Rajeev Kumar | 9023599 | 2018-01-29 11:06:48 -0800 | [diff] [blame] | 2815 | optional int64 rss_in_bytes = 6; |
| 2816 | |
| 2817 | // CACHE |
Rafal Slawik | da51b93 | 2018-12-13 16:31:33 +0000 | [diff] [blame] | 2818 | // Value is read from memory.stat, field total_cache if per-app memory |
| 2819 | // cgroups are enabled. Otherwise, 0. |
Rajeev Kumar | 9023599 | 2018-01-29 11:06:48 -0800 | [diff] [blame] | 2820 | optional int64 cache_in_bytes = 7; |
| 2821 | |
| 2822 | // SWAP |
Rafal Slawik | da51b93 | 2018-12-13 16:31:33 +0000 | [diff] [blame] | 2823 | // Value is read from memory.stat, field total_swap if per-app memory |
| 2824 | // cgroups are enabled. Otherwise, 0. |
Rajeev Kumar | 9023599 | 2018-01-29 11:06:48 -0800 | [diff] [blame] | 2825 | optional int64 swap_in_bytes = 8; |
Rafal Slawik | aaf6089 | 2018-09-12 13:04:30 +0100 | [diff] [blame] | 2826 | |
Rafal Slawik | d03ae42 | 2018-11-20 11:27:45 +0000 | [diff] [blame] | 2827 | // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0. |
Rafal Slawik | 3bea895 | 2018-11-15 12:39:33 +0000 | [diff] [blame] | 2828 | optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true]; |
Rafal Slawik | 272a816 | 2018-11-01 15:12:28 +0000 | [diff] [blame] | 2829 | |
| 2830 | // Elapsed real time when the process started. |
| 2831 | // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups. |
| 2832 | optional int64 start_time_nanos = 10; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2833 | } |
| 2834 | |
| 2835 | /* |
Rafal Slawik | 0862158 | 2018-10-15 14:53:07 +0100 | [diff] [blame] | 2836 | * Logs the memory stats for a native process (from procfs). |
Rafal Slawik | da51b93 | 2018-12-13 16:31:33 +0000 | [diff] [blame] | 2837 | * |
| 2838 | * Pulled from StatsCompanionService for selected native processes. |
Rafal Slawik | 0862158 | 2018-10-15 14:53:07 +0100 | [diff] [blame] | 2839 | */ |
| 2840 | message NativeProcessMemoryState { |
Rafal Slawik | bf67d07 | 2018-10-23 11:07:54 +0100 | [diff] [blame] | 2841 | // The uid if available. -1 means not available. |
| 2842 | optional int32 uid = 1 [(is_uid) = true]; |
Rafal Slawik | 0862158 | 2018-10-15 14:53:07 +0100 | [diff] [blame] | 2843 | |
Rafal Slawik | bf67d07 | 2018-10-23 11:07:54 +0100 | [diff] [blame] | 2844 | // The process name. |
Rafal Slawik | da51b93 | 2018-12-13 16:31:33 +0000 | [diff] [blame] | 2845 | // Value read from /proc/PID/cmdline. |
Rafal Slawik | bf67d07 | 2018-10-23 11:07:54 +0100 | [diff] [blame] | 2846 | optional string process_name = 2; |
Rafal Slawik | 0862158 | 2018-10-15 14:53:07 +0100 | [diff] [blame] | 2847 | |
Rafal Slawik | bf67d07 | 2018-10-23 11:07:54 +0100 | [diff] [blame] | 2848 | // # of page-faults |
| 2849 | optional int64 page_fault = 3; |
Rafal Slawik | 0862158 | 2018-10-15 14:53:07 +0100 | [diff] [blame] | 2850 | |
Rafal Slawik | bf67d07 | 2018-10-23 11:07:54 +0100 | [diff] [blame] | 2851 | // # of major page-faults |
| 2852 | optional int64 page_major_fault = 4; |
Rafal Slawik | 0862158 | 2018-10-15 14:53:07 +0100 | [diff] [blame] | 2853 | |
Rafal Slawik | bf67d07 | 2018-10-23 11:07:54 +0100 | [diff] [blame] | 2854 | // RSS |
Rafal Slawik | da51b93 | 2018-12-13 16:31:33 +0000 | [diff] [blame] | 2855 | // Value read from /proc/PID/stat, field 24. |
Rafal Slawik | bf67d07 | 2018-10-23 11:07:54 +0100 | [diff] [blame] | 2856 | optional int64 rss_in_bytes = 5; |
Rafal Slawik | 0862158 | 2018-10-15 14:53:07 +0100 | [diff] [blame] | 2857 | |
Rafal Slawik | d03ae42 | 2018-11-20 11:27:45 +0000 | [diff] [blame] | 2858 | // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0. |
Rafal Slawik | 3bea895 | 2018-11-15 12:39:33 +0000 | [diff] [blame] | 2859 | optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true]; |
Rafal Slawik | bf67d07 | 2018-10-23 11:07:54 +0100 | [diff] [blame] | 2860 | |
| 2861 | // Elapsed real time when the process started. |
| 2862 | // Value is read from /proc/PID/stat, field 22. |
| 2863 | optional int64 start_time_nanos = 7; |
Rafal Slawik | 0862158 | 2018-10-15 14:53:07 +0100 | [diff] [blame] | 2864 | } |
| 2865 | |
| 2866 | /* |
Rafal Slawik | 3bea895 | 2018-11-15 12:39:33 +0000 | [diff] [blame] | 2867 | * Logs the memory high-water mark for a process. |
Rafal Slawik | da51b93 | 2018-12-13 16:31:33 +0000 | [diff] [blame] | 2868 | * |
| 2869 | * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie) |
| 2870 | * and for selected native processes. |
Rafal Slawik | 44b8814 | 2018-12-15 16:48:09 +0000 | [diff] [blame] | 2871 | * |
| 2872 | * Pulling this atom resets high-water mark counters for all processes. |
Rafal Slawik | 3bea895 | 2018-11-15 12:39:33 +0000 | [diff] [blame] | 2873 | */ |
| 2874 | message ProcessMemoryHighWaterMark { |
| 2875 | // The uid if available. -1 means not available. |
| 2876 | optional int32 uid = 1 [(is_uid) = true]; |
| 2877 | |
Rafal Slawik | da51b93 | 2018-12-13 16:31:33 +0000 | [diff] [blame] | 2878 | // The process name. |
| 2879 | // Usually package name or process cmdline. |
| 2880 | // Provided by ActivityManagerService or read from /proc/PID/cmdline. |
Rafal Slawik | 3bea895 | 2018-11-15 12:39:33 +0000 | [diff] [blame] | 2881 | optional string process_name = 2; |
| 2882 | |
| 2883 | // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in |
| 2884 | // /proc/PID/status. |
| 2885 | optional int64 rss_high_water_mark_in_bytes = 3; |
| 2886 | } |
| 2887 | |
| 2888 | /* |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2889 | * Elapsed real time from SystemClock. |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2890 | */ |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2891 | message SystemElapsedRealtime { |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2892 | optional uint64 time_millis = 1; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2893 | } |
| 2894 | |
| 2895 | /* |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2896 | * Up time from SystemClock. |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2897 | */ |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2898 | message SystemUptime { |
| 2899 | // Milliseconds since the system was booted. |
| 2900 | // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting |
| 2901 | // for external input). |
| 2902 | // It is not affected by clock scaling, idle, or other power saving mechanisms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2903 | optional uint64 uptime_millis = 1; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2904 | } |
| 2905 | |
| 2906 | /* |
| 2907 | * Reads from /proc/uid_concurrent_active_time which has the format: |
| 2908 | * active: X (X is # cores) |
| 2909 | * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores) |
| 2910 | * [uid1]: [time-0] [time-1] [time-2] ... ... |
| 2911 | * ... |
| 2912 | * Time-N means the CPU time a UID spent running concurrently with N other processes. |
| 2913 | * The file contains a monotonically increasing count of time for a single boot. |
| 2914 | */ |
| 2915 | message CpuActiveTime { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2916 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 2917 | optional uint64 time_millis = 2; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2918 | } |
| 2919 | |
| 2920 | /** |
| 2921 | * Reads from /proc/uid_concurrent_policy_time which has the format: |
| 2922 | * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4) |
| 2923 | * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ... |
| 2924 | * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ... |
| 2925 | * ... |
| 2926 | * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes. |
| 2927 | * The file contains a monotonically increasing count of time for a single boot. |
| 2928 | */ |
| 2929 | message CpuClusterTime { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2930 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 2931 | optional int32 cluster_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2932 | optional uint64 time_millis = 3; |
Chenjie Yu | 937d742 | 2018-01-10 16:37:53 -0800 | [diff] [blame] | 2933 | } |
| 2934 | |
| 2935 | /* |
| 2936 | * Pulls free disk space, for data, system partition and temporary directory. |
| 2937 | */ |
| 2938 | message DiskSpace { |
| 2939 | // available bytes in data partition |
| 2940 | optional uint64 data_available_bytes = 1; |
| 2941 | // available bytes in system partition |
| 2942 | optional uint64 system_available_bytes = 2; |
| 2943 | // available bytes in download cache or temp directories |
| 2944 | optional uint64 temp_available_bytes = 3; |
| 2945 | } |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 2946 | |
| 2947 | /** |
| 2948 | * Pulls battery coulomb counter, which is the remaining battery charge in uAh. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2949 | * Pulled from: |
| 2950 | * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 2951 | */ |
| 2952 | message RemainingBatteryCapacity { |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 2953 | optional int32 charge_micro_ampere_hour = 1; |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 2954 | } |
| 2955 | |
| 2956 | /** |
| 2957 | * Pulls battery capacity, which is the battery capacity when full in uAh. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2958 | * Pulled from: |
| 2959 | * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 2960 | */ |
| 2961 | message FullBatteryCapacity { |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 2962 | optional int32 capacity_micro_ampere_hour = 1; |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2963 | } |
| 2964 | |
| 2965 | /** |
Bookatz | 17f0d8a | 2018-09-13 12:56:32 -0700 | [diff] [blame] | 2966 | * Pulls battery voltage. |
| 2967 | * Pulled from: |
| 2968 | * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp |
| 2969 | */ |
| 2970 | message BatteryVoltage { |
| 2971 | // The voltage of the battery, in millivolts. |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 2972 | optional int32 voltage_millivolt = 1; |
Bookatz | 17f0d8a | 2018-09-13 12:56:32 -0700 | [diff] [blame] | 2973 | } |
| 2974 | |
| 2975 | /** |
Tej Singh | b1dbc8b | 2018-11-19 15:49:47 -0800 | [diff] [blame] | 2976 | * Pulls battery level (percent full, from 0 to 100). |
| 2977 | * |
| 2978 | * Pulled from: |
| 2979 | * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp |
| 2980 | */ |
| 2981 | message BatteryLevel { |
| 2982 | // Battery level. Should be in [0, 100]. |
| 2983 | optional int32 battery_level = 1; |
| 2984 | } |
| 2985 | |
| 2986 | /** |
Tej Singh | d89137e | 2018-03-26 14:51:40 -0700 | [diff] [blame] | 2987 | * Pulls the temperature of various parts of the device. |
| 2988 | * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2989 | * |
| 2990 | * Pulled from: |
| 2991 | * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp |
| 2992 | */ |
| 2993 | message Temperature { |
Tej Singh | b6070b9 | 2018-12-19 19:00:12 -0800 | [diff] [blame] | 2994 | // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2995 | optional android.os.TemperatureTypeEnum sensor_location = 1; |
| 2996 | |
| 2997 | // The name of the temperature source. Eg. CPU0 |
| 2998 | optional string sensor_name = 2; |
| 2999 | |
Tej Singh | d89137e | 2018-03-26 14:51:40 -0700 | [diff] [blame] | 3000 | // Temperature in tenths of a degree C. |
Tej Singh | b6070b9 | 2018-12-19 19:00:12 -0800 | [diff] [blame] | 3001 | // For BCL, it is decimillivolt, decimilliamps, and percentage * 10. |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 3002 | optional int32 temperature_deci_celsius = 3; |
yro | a1fe77c | 2018-02-26 14:22:54 -0800 | [diff] [blame] | 3003 | } |
Olivier Gaillard | 00bfb1b | 2018-07-10 11:25:09 +0100 | [diff] [blame] | 3004 | |
| 3005 | /** |
| 3006 | * Pulls the statistics of calls to Binder. |
| 3007 | * |
Olivier Gaillard | d25f7a8 | 2018-09-12 14:28:48 +0100 | [diff] [blame] | 3008 | * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one |
| 3009 | * config on the device. |
Olivier Gaillard | 9ea238d | 2018-07-24 10:26:31 +0100 | [diff] [blame] | 3010 | * |
Olivier Gaillard | 720ec5b | 2018-10-30 17:32:56 +0000 | [diff] [blame] | 3011 | * Next tag: 15 |
Olivier Gaillard | 00bfb1b | 2018-07-10 11:25:09 +0100 | [diff] [blame] | 3012 | */ |
| 3013 | message BinderCalls { |
Olivier Gaillard | 720ec5b | 2018-10-30 17:32:56 +0000 | [diff] [blame] | 3014 | // UID of the process responsible for the binder transaction. It will be set if the process |
| 3015 | // executing the binder transaction attribute the transaction to another uid using |
| 3016 | // Binder.setThreadWorkSource(). |
| 3017 | // |
| 3018 | // If not set, the value will be -1. |
Olivier Gaillard | 9ea238d | 2018-07-24 10:26:31 +0100 | [diff] [blame] | 3019 | optional int32 uid = 1 [(is_uid) = true]; |
Olivier Gaillard | 720ec5b | 2018-10-30 17:32:56 +0000 | [diff] [blame] | 3020 | // UID of the process executing the binder transaction. |
| 3021 | optional int32 direct_caller_uid = 14; |
Olivier Gaillard | 9ea238d | 2018-07-24 10:26:31 +0100 | [diff] [blame] | 3022 | // Fully qualified class name of the API call. |
| 3023 | // |
| 3024 | // This is a system server class name. |
| 3025 | // |
| 3026 | // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid |
| 3027 | // gets recycled and we have isolated uids, we might attribute the data incorrectly. |
| 3028 | // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less |
| 3029 | // commonly used APIs. |
| 3030 | optional string service_class_name = 2; |
| 3031 | // Method name of the API call. It can also be a transaction code if we cannot |
| 3032 | // resolve it to a name. See Binder#getTransactionName. |
| 3033 | // |
| 3034 | // This is a system server method name. |
| 3035 | optional string service_method_name = 3; |
| 3036 | // Total number of API calls. |
| 3037 | optional int64 call_count = 4; |
| 3038 | // True if the screen was interactive PowerManager#isInteractive at the end of the call. |
| 3039 | optional bool screen_interactive = 13; |
| 3040 | // Total number of API calls we have data recorded for. If we collected data for all the calls, |
| 3041 | // call_count will be equal to recorded_call_count. |
| 3042 | // |
| 3043 | // If recorded_call_count is different than call_count, it means data collection has been |
| 3044 | // sampled. All the fields below will be sampled in this case. |
| 3045 | optional int64 recorded_call_count = 12; |
| 3046 | // Number of exceptions thrown by the API. |
| 3047 | optional int64 recorded_exception_count = 5; |
| 3048 | // Total latency of all API calls. |
| 3049 | // Average can be computed using total_latency_micros / recorded_call_count. |
| 3050 | optional int64 recorded_total_latency_micros = 6; |
| 3051 | // Maximum latency of one API call. |
| 3052 | optional int64 recorded_max_latency_micros = 7; |
| 3053 | // Total CPU usage of all API calls. |
| 3054 | // Average can be computed using total_cpu_micros / recorded_call_count. |
| 3055 | // Total can be computed using total_cpu_micros / recorded_call_count * call_count. |
| 3056 | optional int64 recorded_total_cpu_micros = 8; |
| 3057 | // Maximum CPU usage of one API call. |
| 3058 | optional int64 recorded_max_cpu_micros = 9; |
| 3059 | // Maximum parcel reply size of one API call. |
| 3060 | optional int64 recorded_max_reply_size_bytes = 10; |
| 3061 | // Maximum parcel request size of one API call. |
| 3062 | optional int64 recorded_max_request_size_bytes = 11; |
| 3063 | } |
| 3064 | |
| 3065 | /** |
| 3066 | * Pulls the statistics of exceptions during calls to Binder. |
| 3067 | * |
| 3068 | * Binder stats are cumulative from boot unless somebody reset the data using |
| 3069 | * > adb shell dumpsys binder_calls_stats --reset |
| 3070 | */ |
| 3071 | message BinderCallsExceptions { |
| 3072 | // Exception class name, e.g. java.lang.IllegalArgumentException. |
| 3073 | // |
| 3074 | // This is an exception class name thrown by the system server. |
| 3075 | optional string exception_class_name = 1; |
| 3076 | // Total number of exceptions. |
| 3077 | optional int64 exception_count = 2; |
Olivier Gaillard | 00bfb1b | 2018-07-10 11:25:09 +0100 | [diff] [blame] | 3078 | } |
Marcin Oczeretko | d8cc859 | 2018-08-22 16:07:36 +0100 | [diff] [blame] | 3079 | |
Marcin Oczeretko | 3e6494e | 2018-09-10 18:06:52 +0100 | [diff] [blame] | 3080 | /** |
| 3081 | * Pulls the statistics of message dispatching on HandlerThreads. |
| 3082 | * |
| 3083 | * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one |
| 3084 | * config on the device. |
| 3085 | * |
| 3086 | * Next tag: 11 |
| 3087 | */ |
Marcin Oczeretko | d8cc859 | 2018-08-22 16:07:36 +0100 | [diff] [blame] | 3088 | message LooperStats { |
Marcin Oczeretko | ec75872 | 2018-09-12 12:53:47 +0100 | [diff] [blame] | 3089 | // The uid that made a call to the System Server and caused the message to be enqueued. |
Marcin Oczeretko | d8cc859 | 2018-08-22 16:07:36 +0100 | [diff] [blame] | 3090 | optional int32 uid = 1 [(is_uid) = true]; |
| 3091 | |
| 3092 | // Fully qualified class name of the handler target class. |
| 3093 | // |
| 3094 | // This field does not contain PII. This is a system server class name. |
| 3095 | optional string handler_class_name = 2; |
| 3096 | |
| 3097 | // The name of the thread that runs the Looper. |
| 3098 | // |
| 3099 | // This field does not contain PII. This is a system server thread name. |
| 3100 | optional string looper_thread_name = 3; |
| 3101 | |
| 3102 | // The name of the dispatched message. |
| 3103 | // |
| 3104 | // This field does not contain PII. This is a system server constant or class |
| 3105 | // name. |
| 3106 | optional string message_name = 4; |
| 3107 | |
| 3108 | // Total number of successfully dispatched messages. |
| 3109 | optional int64 message_count = 5; |
| 3110 | |
| 3111 | // Total number of messages that failed dispatching. |
| 3112 | optional int64 exception_count = 6; |
| 3113 | |
| 3114 | // Total number of processed messages we have data recorded for. If we |
| 3115 | // collected data for all the messages, message_count will be equal to |
| 3116 | // recorded_message_count. |
| 3117 | // |
| 3118 | // If recorded_message_count is different than message_count, it means data |
Marcin Oczeretko | c06331a | 2018-10-02 13:00:38 +0100 | [diff] [blame] | 3119 | // collection has been sampled. The fields below will be sampled in this case. |
Marcin Oczeretko | d8cc859 | 2018-08-22 16:07:36 +0100 | [diff] [blame] | 3120 | optional int64 recorded_message_count = 7; |
| 3121 | |
| 3122 | // Total latency of all processed messages. |
| 3123 | // Average can be computed using recorded_total_latency_micros / |
| 3124 | // recorded_message_count. |
| 3125 | optional int64 recorded_total_latency_micros = 8; |
| 3126 | |
| 3127 | // Total CPU usage of all processed message. |
| 3128 | // Average can be computed using recorded_total_cpu_micros / |
| 3129 | // recorded_message_count. Total can be computed using |
Marcin Oczeretko | 3e6494e | 2018-09-10 18:06:52 +0100 | [diff] [blame] | 3130 | // recorded_total_cpu_micros / recorded_message_count * message_count. |
Marcin Oczeretko | d8cc859 | 2018-08-22 16:07:36 +0100 | [diff] [blame] | 3131 | optional int64 recorded_total_cpu_micros = 9; |
Marcin Oczeretko | 3e6494e | 2018-09-10 18:06:52 +0100 | [diff] [blame] | 3132 | |
| 3133 | // True if the screen was interactive PowerManager#isInteractive at the end of the call. |
| 3134 | optional bool screen_interactive = 10; |
Marcin Oczeretko | c06331a | 2018-10-02 13:00:38 +0100 | [diff] [blame] | 3135 | |
| 3136 | // Max recorded CPU usage of all processed messages. |
| 3137 | optional int64 recorded_max_cpu_micros = 11; |
| 3138 | |
| 3139 | // Max recorded latency of all processed messages. |
| 3140 | optional int64 recorded_max_latency_micros = 12; |
| 3141 | |
| 3142 | // Total number of messages we tracked the dispatching delay for. If we |
| 3143 | // collected data for all the messages, message_count will be equal to |
| 3144 | // recorded_delay_message_count. |
| 3145 | // |
| 3146 | // If recorded_delay_message_count is different than message_count, it means data |
| 3147 | // collection has been sampled or/and not all messages specified the target dispatch time. |
| 3148 | // The fields below will be sampled in this case. |
| 3149 | optional int64 recorded_delay_message_count = 13; |
| 3150 | |
| 3151 | // Total dispatching delay of all processed messages. |
| 3152 | // Calculated as a difference between the target dispatching time (Message.when) |
| 3153 | // and the actual dispatching time. |
| 3154 | // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count. |
| 3155 | optional int64 recorded_total_delay_millis = 14; |
| 3156 | |
| 3157 | // Max dispatching delay of all processed messages. |
| 3158 | // Calculated as a difference between the target dispatching time (Message.when) |
| 3159 | // and the actual dispatching time. |
| 3160 | optional int64 recorded_max_delay_millis = 15; |
Marcin Oczeretko | d8cc859 | 2018-08-22 16:07:36 +0100 | [diff] [blame] | 3161 | } |
Tej Singh | 86dc9db | 2018-09-06 00:39:57 +0000 | [diff] [blame] | 3162 | |
| 3163 | /** |
| 3164 | * Pulls disk information, such as write speed and latency. |
| 3165 | */ |
| 3166 | message DiskStats { |
| 3167 | // Time taken to open, write 512B to, and close a file. |
| 3168 | // -1 if error performing the check. |
| 3169 | optional int64 data_write_latency_millis = 1; |
| 3170 | |
| 3171 | optional bool file_based_encryption = 2; |
| 3172 | |
| 3173 | // Recent disk write speed in kB/s. |
| 3174 | // -1 if error querying storageed. |
| 3175 | // 0 if data is unavailable. |
| 3176 | optional int32 recent_disk_write_speed = 3; |
| 3177 | } |
| 3178 | |
| 3179 | |
| 3180 | /** |
| 3181 | * Free and total bytes of the Data, Cache, and System partition. |
| 3182 | */ |
| 3183 | message DirectoryUsage { |
| 3184 | enum Directory { |
| 3185 | UNKNOWN = 0; |
| 3186 | DATA = 1; |
| 3187 | CACHE = 2; |
| 3188 | SYSTEM = 3; |
| 3189 | } |
| 3190 | optional Directory directory = 1; |
| 3191 | optional int64 free_bytes = 2; |
| 3192 | optional int64 total_bytes = 3; |
| 3193 | } |
| 3194 | |
| 3195 | |
| 3196 | /** |
| 3197 | * Size of an application: apk size, data size, and cache size. |
| 3198 | * Reads from a cached file produced daily by DiskStatsLoggingService.java. |
| 3199 | * Information is only reported for apps with the primary user (user 0). |
| 3200 | * Sizes are aggregated by package name. |
| 3201 | */ |
| 3202 | message AppSize { |
| 3203 | // Including uids will involve modifying diskstats logic. |
| 3204 | optional string package_name = 1; |
| 3205 | // App size in bytes. -1 if unavailable. |
| 3206 | optional int64 app_size_bytes = 2; |
| 3207 | // App data size in bytes. -1 if unavailable. |
| 3208 | optional int64 app_data_size_bytes = 3; |
| 3209 | // App cache size in bytes. -1 if unavailable. |
| 3210 | optional int64 app_cache_size_bytes = 4; |
| 3211 | // Time that the cache file was produced. |
| 3212 | // Uses System.currentTimeMillis(), which is wall clock time. |
| 3213 | optional int64 cache_time_millis = 5; |
| 3214 | } |
| 3215 | |
| 3216 | |
| 3217 | /** |
| 3218 | * Size of a particular category. Eg: photos, videos. |
| 3219 | * Reads from a cached file produced daily by DiskStatsLoggingService.java. |
| 3220 | */ |
| 3221 | message CategorySize { |
| 3222 | enum Category { |
| 3223 | UNKNOWN = 0; |
| 3224 | APP_SIZE = 1; |
| 3225 | APP_DATA_SIZE = 2; |
| 3226 | APP_CACHE_SIZE = 3; |
| 3227 | PHOTOS = 4; |
| 3228 | VIDEOS = 5; |
| 3229 | AUDIO = 6; |
| 3230 | DOWNLOADS = 7; |
| 3231 | SYSTEM = 8; |
| 3232 | OTHER = 9; |
| 3233 | } |
| 3234 | optional Category category = 1; |
| 3235 | // Category size in bytes. |
| 3236 | optional int64 size_bytes = 2; |
| 3237 | // Time that the cache file was produced. |
| 3238 | // Uses System.currentTimeMillis(), which is wall clock time. |
| 3239 | optional int64 cache_time_millis = 3; |
| 3240 | } |
Tej Singh | d6d6d77 | 2018-09-05 17:41:25 -0700 | [diff] [blame] | 3241 | |
| 3242 | /** |
Tej Singh | e7726dc | 2018-09-21 11:42:12 -0700 | [diff] [blame] | 3243 | * Pulls per uid I/O stats. The stats are cumulative since boot. |
| 3244 | * |
| 3245 | * Read/write bytes are I/O events from a storage device |
| 3246 | * Read/write chars are data requested by read/write syscalls, and can be |
| 3247 | * satisfied by caching. |
| 3248 | * |
| 3249 | * Pulled from StatsCompanionService, which reads proc/uid_io/stats. |
| 3250 | */ |
| 3251 | message DiskIo { |
| 3252 | optional int32 uid = 1 [(is_uid) = true]; |
| 3253 | optional int64 fg_chars_read = 2; |
| 3254 | optional int64 fg_chars_write = 3; |
| 3255 | optional int64 fg_bytes_read = 4; |
| 3256 | optional int64 fg_bytes_write = 5; |
| 3257 | optional int64 bg_chars_read = 6; |
| 3258 | optional int64 bg_chars_write = 7; |
| 3259 | optional int64 bg_bytes_read = 8; |
| 3260 | optional int64 bg_bytes_write = 9; |
| 3261 | optional int64 fg_fsync = 10; |
| 3262 | optional int64 bg_fsync= 11; |
| 3263 | } |
| 3264 | |
| 3265 | |
| 3266 | /** |
Tej Singh | d6d6d77 | 2018-09-05 17:41:25 -0700 | [diff] [blame] | 3267 | * Pulls the number of fingerprints for each user. |
| 3268 | * |
| 3269 | * Pulled from StatsCompanionService, which queries FingerprintManager. |
| 3270 | */ |
| 3271 | message NumFingerprints { |
| 3272 | // The associated user. Eg: 0 for owners, 10+ for others. |
| 3273 | // Defined in android/os/UserHandle.java |
| 3274 | optional int32 user = 1; |
| 3275 | // Number of fingerprints registered to that user. |
| 3276 | optional int32 num_fingerprints = 2; |
| 3277 | } |
Chenjie Yu | 12e5e67 | 2018-09-14 15:54:59 -0700 | [diff] [blame] | 3278 | |
Yangster | af9aee7 | 2018-10-12 09:26:16 -0700 | [diff] [blame] | 3279 | message AggStats { |
| 3280 | optional int64 min = 1; |
| 3281 | |
| 3282 | optional int64 average = 2; |
| 3283 | |
| 3284 | optional int64 max = 3; |
| 3285 | } |
| 3286 | |
| 3287 | message ProcessStatsStateProto { |
| 3288 | optional android.service.procstats.ScreenState screen_state = 1; |
| 3289 | |
| 3290 | optional android.service.procstats.MemoryState memory_state = 2; |
| 3291 | |
| 3292 | // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java |
| 3293 | // and not frameworks/base/core/java/android/app/ActivityManager.java |
| 3294 | optional android.service.procstats.ProcessState process_state = 3; |
| 3295 | |
| 3296 | // Millisecond uptime duration spent in this state |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 3297 | optional int64 duration_millis = 4; |
Yangster | af9aee7 | 2018-10-12 09:26:16 -0700 | [diff] [blame] | 3298 | |
| 3299 | // Millisecond elapsed realtime duration spent in this state |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 3300 | optional int64 realtime_duration_millis = 9; |
Yangster | af9aee7 | 2018-10-12 09:26:16 -0700 | [diff] [blame] | 3301 | |
| 3302 | // # of samples taken |
| 3303 | optional int32 sample_size = 5; |
| 3304 | |
| 3305 | // PSS is memory reserved for this process |
| 3306 | optional AggStats pss = 6; |
| 3307 | |
| 3308 | // USS is memory shared between processes, divided evenly for accounting |
| 3309 | optional AggStats uss = 7; |
| 3310 | |
| 3311 | // RSS is memory resident for this process |
| 3312 | optional AggStats rss = 8; |
| 3313 | } |
| 3314 | |
| 3315 | // Next Tag: 7 |
| 3316 | message ProcessStatsProto { |
| 3317 | // Name of process. |
| 3318 | optional string process = 1; |
| 3319 | |
| 3320 | // Uid of the process. |
| 3321 | optional int32 uid = 2; |
| 3322 | |
| 3323 | // Information about how often kills occurred |
| 3324 | message Kill { |
| 3325 | // Count of excessive CPU kills |
| 3326 | optional int32 cpu = 1; |
| 3327 | |
| 3328 | // Count of kills when cached |
| 3329 | optional int32 cached = 2; |
| 3330 | |
| 3331 | // PSS stats during cached kill |
| 3332 | optional AggStats cached_pss = 3; |
| 3333 | } |
| 3334 | optional Kill kill = 3; |
| 3335 | |
| 3336 | // Time and memory spent in various states. |
| 3337 | repeated ProcessStatsStateProto states = 5; |
| 3338 | |
| 3339 | // Total time process has been running... screen_state, memory_state, and process_state |
| 3340 | // will not be set. |
| 3341 | optional ProcessStatsStateProto total_running_state = 6; |
| 3342 | } |
| 3343 | |
| 3344 | message PackageServiceOperationStatsProto { |
| 3345 | // Operate enum: Started, Foreground, Bound, Executing |
| 3346 | optional android.service.procstats.ServiceOperationState operation = 1; |
| 3347 | |
| 3348 | // Number of times the service was in this operation. |
| 3349 | optional int32 count = 2; |
| 3350 | |
| 3351 | // Information about a state the service can be in. |
| 3352 | message StateStats { |
| 3353 | // Screen state enum. |
| 3354 | optional android.service.procstats.ScreenState screen_state = 1; |
| 3355 | // Memory state enum. |
| 3356 | optional android.service.procstats.MemoryState memory_state = 2; |
| 3357 | |
| 3358 | // duration in milliseconds. |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 3359 | optional int64 duration_millis = 3; |
Yangster | af9aee7 | 2018-10-12 09:26:16 -0700 | [diff] [blame] | 3360 | // Millisecond elapsed realtime duration spent in this state |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 3361 | optional int64 realtime_duration_millis = 4; |
Yangster | af9aee7 | 2018-10-12 09:26:16 -0700 | [diff] [blame] | 3362 | } |
| 3363 | repeated StateStats state_stats = 3; |
| 3364 | } |
| 3365 | |
| 3366 | message PackageServiceStatsProto { |
| 3367 | // Name of service component. |
| 3368 | optional string service_name = 1; |
| 3369 | |
| 3370 | // The operation stats. |
| 3371 | // The package_name, package_uid, package_version, service_name will not be set to save space. |
| 3372 | repeated PackageServiceOperationStatsProto operation_stats = 2; |
| 3373 | } |
| 3374 | |
| 3375 | message PackageAssociationSourceProcessStatsProto { |
| 3376 | // Uid of the process. |
| 3377 | optional int32 process_uid = 1; |
| 3378 | // Process name. |
| 3379 | optional string process_name = 2; |
Chenjie Yu | b2ecc79 | 2019-01-17 10:27:26 -0800 | [diff] [blame] | 3380 | // Package name. |
| 3381 | optional string package_name = 7; |
Yangster | af9aee7 | 2018-10-12 09:26:16 -0700 | [diff] [blame] | 3382 | // Total count of the times this association appeared. |
| 3383 | optional int32 total_count = 3; |
| 3384 | |
| 3385 | // Millisecond uptime total duration this association was around. |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 3386 | optional int64 total_duration_millis = 4; |
Yangster | af9aee7 | 2018-10-12 09:26:16 -0700 | [diff] [blame] | 3387 | |
| 3388 | // Total count of the times this association became actively impacting its target process. |
| 3389 | optional int32 active_count = 5; |
| 3390 | |
| 3391 | // Information on one source in this association. |
| 3392 | message StateStats { |
| 3393 | // Process state enum. |
| 3394 | optional android.service.procstats.ProcessState process_state = 1; |
| 3395 | // Millisecond uptime duration spent in this state |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 3396 | optional int64 duration_millis = 2; |
Yangster | af9aee7 | 2018-10-12 09:26:16 -0700 | [diff] [blame] | 3397 | // Millisecond elapsed realtime duration spent in this state |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 3398 | optional int64 realtime_duration_mmillis = 3; |
Yangster | af9aee7 | 2018-10-12 09:26:16 -0700 | [diff] [blame] | 3399 | } |
| 3400 | repeated StateStats active_state_stats = 6; |
| 3401 | } |
| 3402 | |
| 3403 | message PackageAssociationProcessStatsProto { |
| 3404 | // Name of the target component. |
| 3405 | optional string component_name = 1; |
| 3406 | // Information on one source in this association. |
| 3407 | repeated PackageAssociationSourceProcessStatsProto sources = 2; |
| 3408 | } |
| 3409 | |
| 3410 | |
| 3411 | message ProcessStatsPackageProto { |
| 3412 | // Name of package. |
| 3413 | optional string package = 1; |
| 3414 | |
| 3415 | // Uid of the package. |
| 3416 | optional int32 uid = 2; |
| 3417 | |
| 3418 | // Version of the package. |
| 3419 | optional int64 version = 3; |
| 3420 | |
| 3421 | // Stats for each process running with the package loaded in to it. |
| 3422 | repeated ProcessStatsProto process_stats = 4; |
| 3423 | |
| 3424 | // Stats for each of the package's services. |
| 3425 | repeated PackageServiceStatsProto service_stats = 5; |
| 3426 | |
| 3427 | // Stats for each association with the package. |
| 3428 | repeated PackageAssociationProcessStatsProto association_stats = 6; |
| 3429 | } |
| 3430 | |
| 3431 | message ProcessStatsSectionProto { |
| 3432 | // Elapsed realtime at start of report. |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 3433 | optional int64 start_realtime_millis = 1; |
Yangster | af9aee7 | 2018-10-12 09:26:16 -0700 | [diff] [blame] | 3434 | |
| 3435 | // Elapsed realtime at end of report. |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 3436 | optional int64 end_realtime_millis = 2; |
Yangster | af9aee7 | 2018-10-12 09:26:16 -0700 | [diff] [blame] | 3437 | |
| 3438 | // CPU uptime at start of report. |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 3439 | optional int64 start_uptime_millis = 3; |
Yangster | af9aee7 | 2018-10-12 09:26:16 -0700 | [diff] [blame] | 3440 | |
| 3441 | // CPU uptime at end of report. |
Yangster-mac | a8a3044 | 2018-10-13 23:46:34 -0700 | [diff] [blame] | 3442 | optional int64 end_uptime_millis = 4; |
Yangster | af9aee7 | 2018-10-12 09:26:16 -0700 | [diff] [blame] | 3443 | |
| 3444 | // System runtime library. e.g. "libdvm.so", "libart.so". |
| 3445 | optional string runtime = 5; |
| 3446 | |
| 3447 | // whether kernel reports swapped pss. |
| 3448 | optional bool has_swapped_pss = 6; |
| 3449 | |
| 3450 | // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops". |
| 3451 | enum Status { |
| 3452 | STATUS_UNKNOWN = 0; |
| 3453 | STATUS_COMPLETE = 1; |
| 3454 | STATUS_PARTIAL = 2; |
| 3455 | STATUS_SHUTDOWN = 3; |
| 3456 | STATUS_SYSPROPS = 4; |
| 3457 | } |
| 3458 | repeated Status status = 7; |
| 3459 | |
Chenjie Yu | b2ecc79 | 2019-01-17 10:27:26 -0800 | [diff] [blame] | 3460 | // Number of pages available of various types and sizes, representation fragmentation. |
| 3461 | repeated ProcessStatsAvailablePagesProto available_pages = 10; |
| 3462 | |
Yangster | af9aee7 | 2018-10-12 09:26:16 -0700 | [diff] [blame] | 3463 | // Stats for each process. |
| 3464 | repeated ProcessStatsProto process_stats = 8; |
| 3465 | |
| 3466 | // Stats for each package. |
| 3467 | repeated ProcessStatsPackageProto package_stats = 9; |
| 3468 | } |
| 3469 | |
Chenjie Yu | b2ecc79 | 2019-01-17 10:27:26 -0800 | [diff] [blame] | 3470 | message ProcessStatsAvailablePagesProto { |
| 3471 | // Node these pages are in (as per /proc/pagetypeinfo) |
| 3472 | optional int32 node = 1; |
| 3473 | |
| 3474 | // Zone these pages are in (as per /proc/pagetypeinfo) |
| 3475 | optional string zone = 2; |
| 3476 | |
| 3477 | // Label for the type of these pages (as per /proc/pagetypeinfo) |
| 3478 | optional string label = 3; |
| 3479 | |
| 3480 | // Distribution of number of pages available by order size. First entry in array is |
| 3481 | // order 0, second is order 1, etc. Each order increase is a doubling of page size. |
| 3482 | repeated int32 pages_per_order = 4; |
| 3483 | } |
| 3484 | |
Chenjie Yu | 12e5e67 | 2018-09-14 15:54:59 -0700 | [diff] [blame] | 3485 | /** |
| 3486 | * Pulled from ProcessStatsService.java |
| 3487 | */ |
| 3488 | message ProcStats { |
Yangster | af9aee7 | 2018-10-12 09:26:16 -0700 | [diff] [blame] | 3489 | optional ProcessStatsSectionProto proc_stats_section = 1; |
| 3490 | } |
| 3491 | |
Chenjie Yu | f910b780 | 2019-01-11 16:08:20 -0800 | [diff] [blame] | 3492 | /** |
| 3493 | * Pulled from ProcessStatsService.java |
| 3494 | */ |
| 3495 | message ProcStatsPkgProc { |
| 3496 | optional ProcessStatsSectionProto proc_stats_section = 1; |
| 3497 | } |
| 3498 | |
Yangster | af9aee7 | 2018-10-12 09:26:16 -0700 | [diff] [blame] | 3499 | message PowerProfileProto { |
| 3500 | optional double cpu_suspend = 1; |
| 3501 | |
| 3502 | optional double cpu_idle = 2; |
| 3503 | |
| 3504 | optional double cpu_active = 3; |
| 3505 | |
| 3506 | message CpuCluster { |
| 3507 | optional int32 id = 1; |
| 3508 | optional double cluster_power = 2; |
| 3509 | optional int32 cores = 3; |
| 3510 | repeated int64 speed = 4; |
| 3511 | repeated double core_power = 5; |
| 3512 | } |
| 3513 | |
| 3514 | repeated CpuCluster cpu_cluster = 40; |
| 3515 | |
| 3516 | optional double wifi_scan = 4; |
| 3517 | |
| 3518 | optional double wifi_on = 5; |
| 3519 | |
| 3520 | optional double wifi_active = 6; |
| 3521 | |
| 3522 | optional double wifi_controller_idle = 7; |
| 3523 | |
| 3524 | optional double wifi_controller_rx = 8; |
| 3525 | |
| 3526 | optional double wifi_controller_tx = 9; |
| 3527 | |
| 3528 | repeated double wifi_controller_tx_levels = 10; |
| 3529 | |
| 3530 | optional double wifi_controller_operating_voltage = 11; |
| 3531 | |
| 3532 | optional double bluetooth_controller_idle = 12; |
| 3533 | |
| 3534 | optional double bluetooth_controller_rx = 13; |
| 3535 | |
| 3536 | optional double bluetooth_controller_tx = 14; |
| 3537 | |
| 3538 | optional double bluetooth_controller_operating_voltage = 15; |
| 3539 | |
| 3540 | optional double modem_controller_sleep = 16; |
| 3541 | |
| 3542 | optional double modem_controller_idle = 17; |
| 3543 | |
| 3544 | optional double modem_controller_rx = 18; |
| 3545 | |
| 3546 | repeated double modem_controller_tx = 19; |
| 3547 | |
| 3548 | optional double modem_controller_operating_voltage = 20; |
| 3549 | |
| 3550 | optional double gps_on = 21; |
| 3551 | |
| 3552 | repeated double gps_signal_quality_based = 22; |
| 3553 | |
| 3554 | optional double gps_operating_voltage = 23; |
| 3555 | |
| 3556 | optional double bluetooth_on = 24; |
| 3557 | |
| 3558 | optional double bluetooth_active = 25; |
| 3559 | |
| 3560 | optional double bluetooth_at_cmd = 26; |
| 3561 | |
| 3562 | optional double ambient_display = 27; |
| 3563 | |
| 3564 | optional double screen_on = 28; |
| 3565 | |
| 3566 | optional double radio_on = 29; |
| 3567 | |
| 3568 | optional double radio_scanning = 30; |
| 3569 | |
| 3570 | optional double radio_active = 31; |
| 3571 | |
| 3572 | optional double screen_full = 32; |
| 3573 | |
| 3574 | optional double audio = 33; |
| 3575 | |
| 3576 | optional double video = 34; |
| 3577 | |
| 3578 | optional double flashlight = 35; |
| 3579 | |
| 3580 | optional double memory = 36; |
| 3581 | |
| 3582 | optional double camera = 37; |
| 3583 | |
| 3584 | optional double wifi_batched_scan = 38; |
| 3585 | |
| 3586 | optional double battery_capacity = 39; |
Chenjie Yu | 12e5e67 | 2018-09-14 15:54:59 -0700 | [diff] [blame] | 3587 | } |
Chenjie Yu | ab53020 | 2018-09-26 12:39:20 -0700 | [diff] [blame] | 3588 | |
| 3589 | /** |
| 3590 | * power_profile.xml and other constants for power model calculations. |
| 3591 | * Pulled from PowerProfile.java |
| 3592 | */ |
| 3593 | message PowerProfile { |
Yangster | af9aee7 | 2018-10-12 09:26:16 -0700 | [diff] [blame] | 3594 | optional PowerProfileProto power_profile = 1; |
Howard Ro | 9a862de | 2018-10-11 16:03:33 -0700 | [diff] [blame] | 3595 | } |
Chenjie Yu | b35b5f7 | 2018-10-13 23:25:11 -0700 | [diff] [blame] | 3596 | |
| 3597 | /** |
arangelov | d5db50e | 2018-10-12 20:24:39 +0100 | [diff] [blame] | 3598 | * Logs when a user restriction was added or removed. |
| 3599 | * |
| 3600 | * Logged from: |
| 3601 | * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java |
| 3602 | */ |
| 3603 | message UserRestrictionChanged { |
| 3604 | // The raw string of the user restriction as defined in UserManager. |
| 3605 | // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS. |
| 3606 | optional string restriction = 1; |
| 3607 | // Whether the restriction is enabled or disabled. |
| 3608 | optional bool enabled = 2; |
Howard Ro | 183c2bd | 2018-10-18 13:52:10 -0700 | [diff] [blame] | 3609 | } |
Yangster-mac | 308ea0c | 2018-10-22 13:10:25 -0700 | [diff] [blame] | 3610 | |
| 3611 | /** |
| 3612 | * Pulls process user time and system time. Puller takes a snapshot of all pids |
| 3613 | * in the system and returns cpu stats for those that are working at the time. |
| 3614 | * Dead pids will be dropped. Kernel processes are excluded. |
| 3615 | * Min cool-down is 5 sec. |
| 3616 | */ |
| 3617 | message ProcessCpuTime { |
| 3618 | optional int32 uid = 1 [(is_uid) = true]; |
| 3619 | |
| 3620 | optional string process_name = 2; |
| 3621 | // Process cpu time in user space, cumulative from boot/process start |
| 3622 | optional int64 user_time_millis = 3; |
| 3623 | // Process cpu time in system space, cumulative from boot/process start |
| 3624 | optional int64 system_time_millis = 4; |
Rafal Slawik | bf67d07 | 2018-10-23 11:07:54 +0100 | [diff] [blame] | 3625 | } |
Misha Wagner | 5a51e00 | 2018-10-03 15:04:09 +0100 | [diff] [blame] | 3626 | |
| 3627 | /** |
| 3628 | * Pulls the CPU usage for each thread. |
| 3629 | * |
| 3630 | * Read from /proc/$PID/task/$TID/time_in_state files. |
| 3631 | * |
| 3632 | * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and |
| 3633 | * time_in_state files not being present on some phones, have not been addressed. These should be |
| 3634 | * considered before a public release. |
| 3635 | */ |
| 3636 | message CpuTimePerThreadFreq { |
| 3637 | // UID that owns the process. |
| 3638 | optional int32 uid = 1 [(is_uid) = true]; |
| 3639 | // ID of the process. |
Misha Wagner | dfa548c | 2018-11-16 11:18:00 +0000 | [diff] [blame] | 3640 | optional int32 process_id = 2; |
Misha Wagner | 5a51e00 | 2018-10-03 15:04:09 +0100 | [diff] [blame] | 3641 | // ID of the thread. |
Misha Wagner | dfa548c | 2018-11-16 11:18:00 +0000 | [diff] [blame] | 3642 | optional int32 thread_id = 3; |
Misha Wagner | 5a51e00 | 2018-10-03 15:04:09 +0100 | [diff] [blame] | 3643 | // Name of the process taken from `/proc/$PID/cmdline`. |
| 3644 | optional string process_name = 4; |
| 3645 | // Name of the thread taken from `/proc/$PID/task/$TID/comm` |
| 3646 | optional string thread_name = 5; |
Misha Wagner | fde6958 | 2018-11-28 13:26:32 +0000 | [diff] [blame] | 3647 | |
| 3648 | // Report eight different frequencies, and how much time is spent in each frequency. Frequencies |
| 3649 | // are given in KHz, and time is given in milliseconds since the thread started. All eight |
| 3650 | // frequencies are given here as the alternative is sending eight separate atoms. This method |
| 3651 | // significantly reduces the amount of data created |
| 3652 | optional int32 frequency1_khz = 6; |
| 3653 | optional int32 time1_millis = 7; |
| 3654 | optional int32 frequency2_khz = 8; |
| 3655 | optional int32 time2_millis = 9; |
| 3656 | optional int32 frequency3_khz = 10; |
| 3657 | optional int32 time3_millis = 11; |
| 3658 | optional int32 frequency4_khz = 12; |
| 3659 | optional int32 time4_millis = 13; |
| 3660 | optional int32 frequency5_khz = 14; |
| 3661 | optional int32 time5_millis = 15; |
| 3662 | optional int32 frequency6_khz = 16; |
| 3663 | optional int32 time6_millis = 17; |
| 3664 | optional int32 frequency7_khz = 18; |
| 3665 | optional int32 time7_millis = 19; |
| 3666 | optional int32 frequency8_khz = 20; |
| 3667 | optional int32 time8_millis = 21; |
Misha Wagner | 5a51e00 | 2018-10-03 15:04:09 +0100 | [diff] [blame] | 3668 | } |
Bookatz | 75ee604 | 2018-11-09 12:27:37 -0800 | [diff] [blame] | 3669 | |
| 3670 | /** |
Bookatz | 366a443 | 2018-11-20 09:42:33 -0800 | [diff] [blame] | 3671 | * Pulls information about the device's build. |
| 3672 | */ |
| 3673 | message BuildInformation { |
| 3674 | // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse. |
| 3675 | // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags. |
| 3676 | optional string fingerprint = 1; |
| 3677 | |
| 3678 | // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated. |
| 3679 | optional string brand = 2; |
| 3680 | |
| 3681 | // Build.PRODUCT. The name of the overall product. |
| 3682 | optional string product = 3; |
| 3683 | |
| 3684 | // Build.DEVICE. The name of the industrial design. |
| 3685 | optional string device = 4; |
| 3686 | |
| 3687 | // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas". |
| 3688 | optional string version_release = 5; |
| 3689 | |
| 3690 | // Build.ID. E.g. a label like "M4-rc20". |
| 3691 | optional string id = 6; |
| 3692 | |
| 3693 | // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to |
| 3694 | // represent this build. |
| 3695 | optional string version_incremental = 7; |
| 3696 | |
| 3697 | // Build.TYPE. The type of build, like "user" or "eng". |
| 3698 | optional string type = 8; |
| 3699 | |
| 3700 | // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug". |
| 3701 | optional string tags = 9; |
| 3702 | } |
| 3703 | |
| 3704 | /** |
Bookatz | 75ee604 | 2018-11-09 12:27:37 -0800 | [diff] [blame] | 3705 | * Pulls on-device BatteryStats power use calculations for the overall device. |
| 3706 | */ |
| 3707 | message DeviceCalculatedPowerUse { |
Bookatz | 3dbc13a | 2018-12-21 12:16:51 -0800 | [diff] [blame] | 3708 | // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since |
| 3709 | // BatteryStats last reset (i.e. roughly since device was last significantly charged). |
| 3710 | // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()). |
| 3711 | optional int64 computed_power_nano_amp_secs = 1; |
Bookatz | 75ee604 | 2018-11-09 12:27:37 -0800 | [diff] [blame] | 3712 | } |
| 3713 | |
| 3714 | /** |
| 3715 | * Pulls on-device BatteryStats power use calculations broken down by uid. |
| 3716 | * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use |
| 3717 | * that is attributed to non-uid items. They must all be included to get the total power use. |
| 3718 | */ |
| 3719 | message DeviceCalculatedPowerBlameUid { |
| 3720 | // Uid being blamed. Note: isolated uids have already been mapped to host uid. |
| 3721 | optional int32 uid = 1 [(is_uid) = true]; |
| 3722 | |
Bookatz | 3dbc13a | 2018-12-21 12:16:51 -0800 | [diff] [blame] | 3723 | // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since |
| 3724 | // BatteryStats last reset (i.e. roughly since device was last significantly charged). |
| 3725 | optional int64 power_nano_amp_secs = 2; |
Bookatz | 75ee604 | 2018-11-09 12:27:37 -0800 | [diff] [blame] | 3726 | } |
| 3727 | |
| 3728 | /** |
| 3729 | * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by |
| 3730 | * drain type. |
| 3731 | * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that |
| 3732 | * is attributed uids. They must all be included to get the total power use. |
| 3733 | */ |
| 3734 | message DeviceCalculatedPowerBlameOther { |
| 3735 | // The type of item whose power use is being reported. |
| 3736 | enum DrainType { |
| 3737 | AMBIENT_DISPLAY = 0; |
| 3738 | // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid. |
| 3739 | BLUETOOTH = 2; |
| 3740 | CAMERA = 3; |
| 3741 | // Cell-standby |
| 3742 | CELL = 4; |
| 3743 | FLASHLIGHT = 5; |
| 3744 | IDLE = 6; |
| 3745 | MEMORY = 7; |
| 3746 | // Amount that total computed drain exceeded the drain estimated using the |
| 3747 | // battery level changes and capacity. |
| 3748 | OVERCOUNTED = 8; |
| 3749 | PHONE = 9; |
| 3750 | SCREEN = 10; |
| 3751 | // Amount that total computed drain was below the drain estimated using the |
| 3752 | // battery level changes and capacity. |
| 3753 | UNACCOUNTED = 11; |
| 3754 | // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported. |
| 3755 | WIFI = 13; |
| 3756 | } |
| 3757 | optional DrainType drain_type = 1; |
| 3758 | |
Bookatz | 3dbc13a | 2018-12-21 12:16:51 -0800 | [diff] [blame] | 3759 | // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since |
| 3760 | // BatteryStats last reset (i.e. roughly since device was last significantly charged). |
| 3761 | optional int64 power_nano_amp_secs = 2; |
Rafal Slawik | 3bea895 | 2018-11-15 12:39:33 +0000 | [diff] [blame] | 3762 | } |
arangelov | 4e99406 | 2018-11-13 16:12:38 +0000 | [diff] [blame] | 3763 | |
| 3764 | /** |
| 3765 | * Logs device policy features. |
| 3766 | * |
| 3767 | * Logged from: |
| 3768 | * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java |
| 3769 | * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/ |
| 3770 | */ |
| 3771 | message DevicePolicyEvent { |
| 3772 | // The event id - unique for each event. |
| 3773 | optional android.stats.devicepolicy.EventId event_id = 1; |
| 3774 | // The admin package name. |
| 3775 | optional string admin_package_name = 2; |
| 3776 | // A generic integer parameter. |
| 3777 | optional int32 integer_value = 3; |
| 3778 | // A generic boolean parameter. |
| 3779 | optional bool boolean_value = 4; |
| 3780 | // A parameter specifying a time period in milliseconds. |
| 3781 | optional uint64 time_period_millis = 5; |
| 3782 | // A parameter specifying a list of package names, bundle extras or string parameters. |
| 3783 | optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES]; |
| 3784 | } |
shawnlin | ea5b66b | 2018-11-13 15:05:29 +0800 | [diff] [blame] | 3785 | |
| 3786 | /** |
| 3787 | * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up. |
| 3788 | * |
| 3789 | * Logged from: |
| 3790 | * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java |
| 3791 | */ |
| 3792 | message DocsUILaunchReported { |
| 3793 | optional android.stats.docsui.LaunchAction launch_action = 1; |
| 3794 | optional bool has_initial_uri = 2; |
| 3795 | optional android.stats.docsui.MimeType mime_type = 3; |
| 3796 | optional android.stats.docsui.Root initial_root = 4; |
| 3797 | } |
| 3798 | |
| 3799 | /** |
| 3800 | * Logs root/app visited event in file managers/picker. Call this when the user |
| 3801 | * taps on root/app in hamburger menu. |
| 3802 | * |
| 3803 | * Logged from: |
| 3804 | * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java |
| 3805 | */ |
| 3806 | message DocsUIRootVisitedReported { |
| 3807 | optional android.stats.docsui.ContextScope scope = 1; |
| 3808 | optional android.stats.docsui.Root root = 2; |
| 3809 | } |
| 3810 | |
| 3811 | /** |
| 3812 | * Logs file operation stats. Call this when a file operation has completed. |
| 3813 | * |
| 3814 | * Logged from: |
| 3815 | * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java |
| 3816 | */ |
| 3817 | message DocsUIFileOperationReported { |
| 3818 | optional android.stats.docsui.Provider provider = 1; |
| 3819 | optional android.stats.docsui.FileOperation file_op = 2; |
| 3820 | } |
| 3821 | |
| 3822 | /** |
| 3823 | * Logs file operation stats. Call this when a copy/move operation has completed with a specific |
| 3824 | * mode. |
| 3825 | * |
| 3826 | * Logged from: |
| 3827 | * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java |
| 3828 | */ |
| 3829 | message DocsUIFileOperationCopyMoveModeReported { |
| 3830 | optional android.stats.docsui.FileOperation file_op = 1; |
| 3831 | optional android.stats.docsui.CopyMoveOpMode mode = 2; |
| 3832 | } |
| 3833 | |
| 3834 | |
| 3835 | /** |
| 3836 | * Logs file sub operation stats. Call this when a file operation has failed. |
| 3837 | * |
| 3838 | * Logged from: |
| 3839 | * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java |
| 3840 | */ |
| 3841 | message DocsUIFileOperationFailureReported { |
| 3842 | optional android.stats.docsui.Authority authority = 1; |
| 3843 | optional android.stats.docsui.SubFileOperation sub_op = 2; |
| 3844 | } |
| 3845 | |
| 3846 | /** |
| 3847 | * Logs the cancellation of a file operation. Call this when a job is canceled |
| 3848 | * |
| 3849 | * Logged from: |
| 3850 | * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java |
| 3851 | */ |
| 3852 | message DocsUIFileOperationCanceledReported { |
| 3853 | optional android.stats.docsui.FileOperation file_op = 1; |
| 3854 | } |
| 3855 | |
| 3856 | /** |
| 3857 | * Logs startup time in milliseconds. |
| 3858 | * |
| 3859 | * Logged from: |
| 3860 | * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java |
| 3861 | */ |
| 3862 | message DocsUIStartupMsReported { |
| 3863 | optional int32 startup_millis = 1; |
| 3864 | } |
| 3865 | |
| 3866 | /** |
| 3867 | * Logs the action that was started by user. |
| 3868 | * |
| 3869 | * Logged from: |
| 3870 | * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java |
| 3871 | */ |
| 3872 | message DocsUIUserActionReported { |
| 3873 | optional android.stats.docsui.UserAction action = 1; |
| 3874 | } |
| 3875 | |
| 3876 | /** |
| 3877 | * Logs the invalid type when invalid scoped access is requested. |
| 3878 | * |
| 3879 | * Logged from: |
| 3880 | * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java |
| 3881 | */ |
| 3882 | message DocsUIInvalidScopedAccessRequestReported { |
| 3883 | optional android.stats.docsui.InvalidScopedAccess type = 1; |
Rafal Slawik | da51b93 | 2018-12-13 16:31:33 +0000 | [diff] [blame] | 3884 | } |
Ben Murdoch | bab399f | 2018-12-06 11:01:38 +0000 | [diff] [blame] | 3885 | |
| 3886 | /** |
shawnlin | a75e82d | 2019-01-07 10:31:12 +0800 | [diff] [blame] | 3887 | * Logs the package name that launches docsui picker mode. |
| 3888 | * |
| 3889 | * Logged from: |
| 3890 | * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java |
| 3891 | */ |
| 3892 | message DocsUIPickerLaunchedFromReported { |
| 3893 | optional string package_name = 1; |
| 3894 | } |
| 3895 | |
| 3896 | /** |
| 3897 | * Logs the search type. |
| 3898 | * |
| 3899 | * Logged from: |
| 3900 | * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java |
| 3901 | */ |
| 3902 | message DocsUISearchTypeReported { |
| 3903 | optional android.stats.docsui.SearchType search_type = 1; |
| 3904 | } |
| 3905 | |
| 3906 | /** |
| 3907 | * Logs the search mode. |
| 3908 | * |
| 3909 | * Logged from: |
| 3910 | * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java |
| 3911 | */ |
| 3912 | message DocsUISearchModeReported { |
| 3913 | optional android.stats.docsui.SearchMode search_mode = 1; |
| 3914 | } |
| 3915 | |
| 3916 | /** |
| 3917 | * Logs the pick result information. |
| 3918 | * |
| 3919 | * Logged from: |
| 3920 | * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java |
| 3921 | */ |
| 3922 | message DocsUIPickResultReported { |
| 3923 | optional int32 total_action_count = 1; |
| 3924 | optional int64 duration_millis = 2; |
| 3925 | optional int32 file_count= 3; |
| 3926 | optional bool is_searching = 4; |
| 3927 | optional android.stats.docsui.Root picked_from = 5; |
| 3928 | optional android.stats.docsui.MimeType mime_type = 6; |
| 3929 | optional int32 repeatedly_pick_times = 7; |
| 3930 | } |
| 3931 | |
| 3932 | /** |
Ben Murdoch | bab399f | 2018-12-06 11:01:38 +0000 | [diff] [blame] | 3933 | * Logs when an app's memory is compacted. |
| 3934 | * |
| 3935 | * Logged from: |
| 3936 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 3937 | */ |
| 3938 | message AppCompacted { |
| 3939 | // The pid of the process being compacted. |
| 3940 | optional int32 pid = 1; |
| 3941 | |
| 3942 | // The name of the process being compacted. |
| 3943 | optional string process_name = 2; |
| 3944 | |
| 3945 | // The type of compaction. |
| 3946 | enum Action { |
| 3947 | UNKNOWN = 0; |
| 3948 | SOME = 1; |
| 3949 | FULL = 2; |
| 3950 | } |
Ben Murdoch | 01720b8 | 2018-12-19 18:03:44 +0000 | [diff] [blame] | 3951 | optional Action action = 3; |
Ben Murdoch | bab399f | 2018-12-06 11:01:38 +0000 | [diff] [blame] | 3952 | |
| 3953 | // Total RSS in kilobytes consumed by the process prior to compaction. |
| 3954 | optional int64 before_rss_total_kilobytes = 4; |
| 3955 | |
| 3956 | // File RSS in kilobytes consumed by the process prior to compaction. |
| 3957 | optional int64 before_rss_file_kilobytes = 5; |
| 3958 | |
| 3959 | // Anonymous RSS in kilobytes consumed by the process prior to compaction. |
| 3960 | optional int64 before_rss_anon_kilobytes = 6; |
| 3961 | |
| 3962 | // Swap in kilobytes consumed by the process prior to compaction. |
| 3963 | optional int64 before_swap_kilobytes = 7; |
| 3964 | |
| 3965 | // Total RSS in kilobytes consumed by the process after compaction. |
| 3966 | optional int64 after_rss_total_kilobytes = 8; |
| 3967 | |
| 3968 | // File RSS in kilobytes consumed by the process after compaction. |
| 3969 | optional int64 after_rss_file_kilobytes = 9; |
| 3970 | |
| 3971 | // Anonymous RSS in kilobytes consumed by the process after compaction. |
| 3972 | optional int64 after_rss_anon_kilobytes = 10; |
| 3973 | |
| 3974 | // Swap in kilobytes consumed by the process after compaction. |
| 3975 | optional int64 after_swap_kilobytes = 11; |
| 3976 | |
| 3977 | // The time taken to perform compaction in milliseconds. |
| 3978 | optional int64 time_to_compact_millis = 12; |
| 3979 | |
| 3980 | // The last compaction action performed for this app. |
| 3981 | optional Action last_action = 13; |
| 3982 | |
Ben Murdoch | 01720b8 | 2018-12-19 18:03:44 +0000 | [diff] [blame] | 3983 | // The last time that compaction was attempted on this process in milliseconds |
| 3984 | // since boot, not including sleep (see SystemClock.uptimeMillis()). |
| 3985 | optional int64 last_compact_timestamp_ms_since_boot = 14; |
Ben Murdoch | bab399f | 2018-12-06 11:01:38 +0000 | [diff] [blame] | 3986 | |
Ben Murdoch | 01720b8 | 2018-12-19 18:03:44 +0000 | [diff] [blame] | 3987 | // The oom_score_adj at the time of compaction. |
| 3988 | optional int32 oom_score_adj = 15; |
Ben Murdoch | bab399f | 2018-12-06 11:01:38 +0000 | [diff] [blame] | 3989 | |
| 3990 | // The process state at the time of compaction. |
| 3991 | optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN]; |
| 3992 | } |
lifr | 157fc55 | 2018-12-12 16:38:04 +0800 | [diff] [blame] | 3993 | |
| 3994 | /** |
| 3995 | * Logs the latency period(in microseconds) and the return code of |
| 3996 | * the DNS(Domain Name System) lookups. |
| 3997 | * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND) |
| 3998 | * to get info(address or hostname) from DNS server(or DNS cache). |
| 3999 | * Logged from: |
| 4000 | * /system/netd/server/DnsProxyListener.cpp |
| 4001 | */ |
| 4002 | message NetworkDnsEventReported { |
| 4003 | // The types of the DNS lookups, as defined in |
| 4004 | //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl |
| 4005 | enum EventType { |
| 4006 | EVENT_UNKNOWN = 0; |
| 4007 | EVENT_GETADDRINFO = 1; |
| 4008 | EVENT_GETHOSTBYNAME = 2; |
| 4009 | EVENT_GETHOSTBYADDR = 3; |
| 4010 | EVENT_RES_NSEND = 4; |
| 4011 | } |
| 4012 | optional EventType event_type = 1; |
| 4013 | |
| 4014 | // The return value of the DNS resolver for each DNS lookups. |
| 4015 | //bionic/libc/include/netdb.h |
| 4016 | //system/netd/resolv/include/netd_resolv/resolv.h |
| 4017 | enum ReturnCode { |
lifr | 357b7cf | 2019-01-15 02:05:45 +0800 | [diff] [blame] | 4018 | EAI_NO_ERROR = 0; |
lifr | 157fc55 | 2018-12-12 16:38:04 +0800 | [diff] [blame] | 4019 | EAI_ADDRFAMILY = 1; |
| 4020 | EAI_AGAIN = 2; |
| 4021 | EAI_BADFLAGS = 3; |
| 4022 | EAI_FAIL = 4; |
| 4023 | EAI_FAMILY = 5; |
| 4024 | EAI_MEMORY = 6; |
| 4025 | EAI_NODATA = 7; |
| 4026 | EAI_NONAME = 8; |
| 4027 | EAI_SERVICE = 9; |
| 4028 | EAI_SOCKTYPE = 10; |
| 4029 | EAI_SYSTEM = 11; |
| 4030 | EAI_BADHINTS = 12; |
| 4031 | EAI_PROTOCOL = 13; |
| 4032 | EAI_OVERFLOW = 14; |
| 4033 | RESOLV_TIMEOUT = 255; |
| 4034 | EAI_MAX = 256; |
| 4035 | } |
| 4036 | optional ReturnCode return_code = 2; |
| 4037 | |
| 4038 | // The latency period(in microseconds) it took for this DNS lookup to complete. |
| 4039 | optional int32 latency_micros = 3; |
| 4040 | } |
Chiachang Wang | f6bedc2 | 2019-01-14 11:54:32 +0800 | [diff] [blame] | 4041 | |
| 4042 | /** |
| 4043 | * Logs when a data stall event occurs. |
| 4044 | * |
| 4045 | * Log from: |
| 4046 | * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java |
| 4047 | */ |
| 4048 | message DataStallEvent { |
| 4049 | // Data stall evaluation type. |
| 4050 | // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java |
| 4051 | // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*. |
| 4052 | optional int32 evaluation_type = 1; |
| 4053 | // See definition in data_stall_event.proto. |
| 4054 | optional com.android.server.connectivity.ProbeResult validation_result = 2; |
| 4055 | // See definition in data_stall_event.proto. |
| 4056 | optional android.net.NetworkCapabilitiesProto.Transport network_type = 3; |
| 4057 | // See definition in data_stall_event.proto. |
| 4058 | optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES]; |
| 4059 | // See definition in data_stall_event.proto. |
| 4060 | optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES]; |
| 4061 | // See definition in data_stall_event.proto. |
| 4062 | optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES]; |
| 4063 | } |
Christian Brunschen | f86039e | 2018-12-21 12:26:14 +0000 | [diff] [blame] | 4064 | |
| 4065 | /* |
| 4066 | * Logs when RescueParty resets some set of experiment flags. |
| 4067 | * |
| 4068 | * Logged from: |
| 4069 | * frameworks/base/services/core/java/com/android/server/RescueParty.java |
| 4070 | */ |
| 4071 | message RescuePartyResetReported { |
| 4072 | // The rescue level of this reset. A value of 0 indicates missing or unknown level information. |
| 4073 | optional int32 rescue_level = 1; |
| 4074 | } |
Mathew Inwood | b375be5 | 2019-01-04 11:36:25 +0000 | [diff] [blame] | 4075 | |
| 4076 | /** |
| 4077 | * Logs when signed config is received from an APK, and if that config was applied successfully. |
| 4078 | * Logged from: |
| 4079 | * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java |
| 4080 | */ |
| 4081 | message SignedConfigReported { |
| 4082 | enum Type { |
| 4083 | UNKNOWN_TYPE = 0; |
| 4084 | GLOBAL_SETTINGS = 1; |
| 4085 | } |
| 4086 | optional Type type = 1; |
| 4087 | |
| 4088 | // The final status of the signed config received. |
| 4089 | enum Status { |
| 4090 | UNKNOWN_STATUS = 0; |
| 4091 | APPLIED = 1; |
| 4092 | BASE64_FAILURE_CONFIG = 2; |
| 4093 | BASE64_FAILURE_SIGNATURE = 3; |
| 4094 | SECURITY_EXCEPTION = 4; |
| 4095 | INVALID_CONFIG = 5; |
| 4096 | OLD_CONFIG = 6; |
| 4097 | SIGNATURE_CHECK_FAILED = 7; |
| 4098 | NOT_APPLICABLE = 8; |
Mathew Inwood | 610d096 | 2019-01-15 11:50:28 +0000 | [diff] [blame] | 4099 | SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9; |
Mathew Inwood | b375be5 | 2019-01-04 11:36:25 +0000 | [diff] [blame] | 4100 | } |
| 4101 | optional Status status = 2; |
| 4102 | |
| 4103 | // The version of the signed config processed. |
| 4104 | optional int32 version = 3; |
| 4105 | |
| 4106 | // The package name that the config was extracted from. |
| 4107 | optional string from_package = 4; |
| 4108 | |
| 4109 | enum Key { |
| 4110 | NO_KEY = 0; |
| 4111 | DEBUG = 1; |
| 4112 | PRODUCTION = 2; |
| 4113 | } |
| 4114 | // Which key was used to verify the config. |
| 4115 | optional Key verified_with = 5; |
| 4116 | } |
Yu-Han Yang | 8a1b51d | 2018-12-26 22:18:31 -0800 | [diff] [blame] | 4117 | |
| 4118 | /* |
| 4119 | * Logs GNSS Network-Initiated (NI) location events. |
| 4120 | * |
| 4121 | * Logged from: |
| 4122 | * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java |
| 4123 | */ |
| 4124 | message GnssNiEventReported { |
| 4125 | // The type of GnssNiEvent. |
| 4126 | enum EventType { |
| 4127 | UNKNOWN = 0; |
| 4128 | NI_REQUEST = 1; |
| 4129 | NI_RESPONSE = 2; |
| 4130 | } |
| 4131 | optional EventType event_type = 1; |
| 4132 | |
| 4133 | // An ID generated by HAL to associate NI notifications and UI responses. |
| 4134 | optional int32 notification_id = 2; |
| 4135 | |
| 4136 | // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc. |
Yu-Han Yang | 14d5fb4 | 2019-01-16 12:42:59 -0800 | [diff] [blame^] | 4137 | optional android.server.location.GnssNiType ni_type = 3; |
Yu-Han Yang | 8a1b51d | 2018-12-26 22:18:31 -0800 | [diff] [blame] | 4138 | |
| 4139 | // NI requires notification. |
| 4140 | optional bool need_notify = 4; |
| 4141 | |
| 4142 | // NI requires verification. |
| 4143 | optional bool need_verify = 5; |
| 4144 | |
| 4145 | // NI requires privacy override, no notification/minimal trace. |
| 4146 | optional bool privacy_override = 6; |
| 4147 | |
| 4148 | // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in |
| 4149 | // seconds. |
| 4150 | optional int32 timeout = 7; |
| 4151 | |
| 4152 | // Default response when timeout. |
Yu-Han Yang | 14d5fb4 | 2019-01-16 12:42:59 -0800 | [diff] [blame^] | 4153 | optional android.server.location.GnssUserResponseType default_response = 8; |
Yu-Han Yang | 8a1b51d | 2018-12-26 22:18:31 -0800 | [diff] [blame] | 4154 | |
| 4155 | // String representing the requester of the network inititated location request. |
| 4156 | optional string requestor_id = 9; |
| 4157 | |
| 4158 | // Notification message text string representing the service(for eg. SUPL-service) who sent the |
| 4159 | // network initiated location request. |
| 4160 | optional string text = 10; |
| 4161 | |
| 4162 | // requestorId decoding scheme. |
Yu-Han Yang | 14d5fb4 | 2019-01-16 12:42:59 -0800 | [diff] [blame^] | 4163 | optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11; |
Yu-Han Yang | 8a1b51d | 2018-12-26 22:18:31 -0800 | [diff] [blame] | 4164 | |
| 4165 | // Notification message text decoding scheme. |
Yu-Han Yang | 14d5fb4 | 2019-01-16 12:42:59 -0800 | [diff] [blame^] | 4166 | optional android.server.location.GnssNiEncodingType text_encoding = 12; |
Yu-Han Yang | 8a1b51d | 2018-12-26 22:18:31 -0800 | [diff] [blame] | 4167 | |
| 4168 | // True if SUPL ES is enabled. |
| 4169 | optional bool is_supl_es_enabled = 13; |
| 4170 | |
| 4171 | // True if GNSS location is enabled. |
| 4172 | optional bool is_location_enabled = 14; |
| 4173 | |
| 4174 | // GNSS NI responses which define the response in NI structures. |
Yu-Han Yang | 14d5fb4 | 2019-01-16 12:42:59 -0800 | [diff] [blame^] | 4175 | optional android.server.location.GnssUserResponseType user_response = 15; |
| 4176 | } |
| 4177 | |
| 4178 | /** |
| 4179 | * Logs GNSS non-framework (NFW) location notification. |
| 4180 | * |
| 4181 | * Logged from: |
| 4182 | * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java |
| 4183 | */ |
| 4184 | message GnssNfwNotificationReported { |
| 4185 | // Package name of the Android proxy application representing the non-framework entity that |
| 4186 | // requested location. Set to empty string if unknown. |
| 4187 | optional string proxy_app_package_name = 1; |
| 4188 | |
| 4189 | // Protocol stack that initiated the non-framework location request. |
| 4190 | optional android.server.location.NfwProtocolStack protocol_stack = 2; |
| 4191 | |
| 4192 | // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise, |
| 4193 | // set to empty string. This field is opaque to the framework and used for logging purposes. |
| 4194 | optional string other_protocol_stack_name = 3; |
| 4195 | |
| 4196 | // Source initiating/receiving the location information. |
| 4197 | optional android.server.location.NfwRequestor requestor = 4; |
| 4198 | |
| 4199 | // Identity of the endpoint receiving the location information. For example, carrier name, OEM |
| 4200 | // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework |
| 4201 | // and used for logging purposes. |
| 4202 | optional string requestor_id = 5; |
| 4203 | |
| 4204 | // Indicates whether location information was provided for this request. |
| 4205 | optional android.server.location.NfwResponseType response_type = 6; |
| 4206 | |
| 4207 | // True if the device is in user initiated emergency session. |
| 4208 | optional bool in_emergency_mode = 7; |
| 4209 | |
| 4210 | // True if cached location is provided. |
| 4211 | optional bool is_cached_location = 8; |
| 4212 | |
| 4213 | // True if proxy app permission mismatch between framework and GNSS HAL. |
| 4214 | optional bool is_permission_mismatched = 9; |
| 4215 | } |
| 4216 | |
| 4217 | /** |
| 4218 | * Logs GNSS configuration as defined in IGnssConfiguration.hal. |
| 4219 | * |
| 4220 | * Logged from: |
| 4221 | * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java |
| 4222 | */ |
| 4223 | message GnssConfigurationReported { |
| 4224 | // SUPL host name. |
| 4225 | optional string supl_host = 1; |
| 4226 | |
| 4227 | // SUPL port number. |
| 4228 | optional int32 supl_port = 2; |
| 4229 | |
| 4230 | // C2K host name. |
| 4231 | optional string c2k_host = 3; |
| 4232 | |
| 4233 | // C2K port number. |
| 4234 | optional int32 c2k_port = 4; |
| 4235 | |
| 4236 | // The SUPL version requested by Carrier. |
| 4237 | optional int32 supl_ver = 5; |
| 4238 | |
| 4239 | // The SUPL mode. |
| 4240 | optional android.server.location.SuplMode supl_mode = 6; |
| 4241 | |
| 4242 | // True if NI emergency SUPL restrictions is enabled. |
| 4243 | optional bool supl_es = 7; |
| 4244 | |
| 4245 | // LTE Positioning Profile settings |
| 4246 | optional android.server.location.LppProfile lpp_profile = 8; |
| 4247 | |
| 4248 | // Positioning protocol on A-Glonass system. |
| 4249 | optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9; |
| 4250 | |
| 4251 | // True if emergency PDN is used. Otherwise, regular PDN is used. |
| 4252 | optional bool use_emergency_pdn_for_emergency_supl= 10; |
| 4253 | |
| 4254 | // Configurations of how GPS functionalities should be locked when user turns off GPS On setting. |
| 4255 | optional android.server.location.GpsLock gps_lock = 11; |
| 4256 | |
| 4257 | // Number of seconds to extend the emergency session duration post emergency call. |
| 4258 | optional int32 es_extension_sec = 12; |
| 4259 | |
| 4260 | // The full list of package names of proxy Android applications representing the non-framework |
| 4261 | // location access entities (on/off the device) for which the framework user has granted |
| 4262 | // non-framework location access permission. The package names are concatenated in one string |
| 4263 | // with spaces as separators. |
| 4264 | optional string enabled_proxy_app_package_name_list = 13; |
Yu-Han Yang | 8a1b51d | 2018-12-26 22:18:31 -0800 | [diff] [blame] | 4265 | } |