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 17syntax = "proto2"; 18 19import "frameworks/base/core/proto/android/app/alarmmanager.proto"; 20import "frameworks/base/core/proto/android/app/pendingintent.proto"; 21import "frameworks/base/core/proto/android/internal/locallog.proto"; 22import "frameworks/base/core/proto/android/os/worksource.proto"; 23import "frameworks/base/core/proto/android/server/appstatetracker.proto"; 24import "frameworks/base/core/proto/android/privacy.proto"; 25 26package com.android.server.alarm; 27 28option java_multiple_files = true; 29 30// next ID: 43 31message AlarmManagerServiceDumpProto { 32 option (.android.msg_privacy).dest = DEST_AUTOMATIC; 33 34 optional int64 current_time = 1; 35 optional int64 elapsed_realtime = 2; 36 optional int64 last_time_change_clock_time = 3; 37 optional int64 last_time_change_realtime = 4; 38 // Current settings 39 optional ConstantsProto settings = 5; 40 41 // Dump from AppStateTracker. 42 optional AppStateTrackerProto app_state_tracker = 6; 43 44 optional bool is_interactive = 7; 45 // Only valid if is_interactive is false. 46 optional int64 time_since_non_interactive_ms = 8; 47 // Only valid if is_interactive is false. 48 optional int64 max_wakeup_delay_ms = 9; 49 // Only valid if is_interactive is false. 50 optional int64 time_since_last_dispatch_ms = 10; 51 // Only valid if is_interactive is false. 52 optional int64 time_until_next_non_wakeup_delivery_ms = 11; 53 54 // Can be negative if the non-wakeup alarm time is in the past (non-wakeup 55 // alarms aren't delivered unil the next time the device wakes up). 56 optional int64 time_until_next_non_wakeup_alarm_ms = 12; 57 optional int64 time_until_next_wakeup_ms = 13; 58 optional int64 time_since_last_wakeup_ms = 14; 59 // Time since the last wakeup was set. 60 optional int64 time_since_last_wakeup_set_ms = 15; 61 optional int64 time_change_event_count = 16; 62 // The current set of user exempted apps for device idle mode, meaning 63 // these are allowed to freely schedule alarms. These are app IDs, not UIDs. 64 // This field is currently unused. 65 repeated int32 device_idle_user_exempt_app_ids = 17; 66 67 repeated AlarmClockMetadataProto next_alarm_clock_metadata = 18; 68 69 repeated BatchProto pending_alarm_batches = 19; 70 71 // List of alarms per uid deferred due to user applied background restrictions 72 // on the source app. 73 repeated AlarmProto pending_user_blocked_background_alarms = 20; 74 75 // When idling mode will end. Will be empty if the device is not currently 76 // idling. 77 optional AlarmProto pending_idle_until = 21; 78 79 // Any alarms that we don't want to run during idle mode. Will be empty if the 80 // device is not currently idling. 81 repeated AlarmProto pending_while_idle_alarms = 22; 82 83 // This is a special alarm that will put the system into idle until it goes 84 // off. The caller has given the time they want this to happen at. 85 optional AlarmProto next_wake_from_idle = 23; 86 87 repeated AlarmProto past_due_non_wakeup_alarms = 24; 88 89 // Number of delayed alarms. 90 optional int32 delayed_alarm_count = 25; 91 // The total amount of time alarms had been delayed. Overlapping alarms are 92 // only counted once (ie. If two alarms were meant to trigger at the same time 93 // but were delayed by 5 seconds, the total time would be 5 seconds). 94 optional int64 total_delay_time_ms = 26; 95 optional int64 max_delay_duration_ms = 27; 96 optional int64 max_non_interactive_duration_ms = 28; 97 98 optional int32 broadcast_ref_count = 29; 99 // Canonical count of (operation.send() - onSendFinished()) and listener 100 // send/complete/timeout invocations. 101 optional int32 pending_intent_send_count = 30; 102 optional int32 pending_intent_finish_count = 31; 103 optional int32 listener_send_count = 32; 104 optional int32 listener_finish_count = 33; 105 106 repeated InFlightProto outstanding_deliveries = 34; 107 108 message LastAllowWhileIdleDispatch { 109 option (.android.msg_privacy).dest = DEST_AUTOMATIC; 110 111 optional int32 uid = 1; 112 // In the 'elapsed' timebase. 113 optional int64 time_ms = 2; 114 115 // Time when the next while-idle is allowed, in the 'elapsed' timebase. 116 optional int64 next_allowed_ms = 3; 117 } 118 119 // Whether the short or long while-idle timeout should be used for each UID. 120 repeated int32 use_allow_while_idle_short_time = 35; 121 122 // For each uid, this is the last time we dispatched an "allow while idle" 123 // alarm, used to determine the earliest we can dispatch the next such alarm. 124 repeated LastAllowWhileIdleDispatch last_allow_while_idle_dispatch_times = 36; 125 126 optional com.android.internal.util.LocalLogProto recent_problems = 37; 127 128 message TopAlarm { 129 option (.android.msg_privacy).dest = DEST_AUTOMATIC; 130 131 optional int32 uid = 1; 132 optional string package_name = 2; 133 optional FilterStatsProto filter = 3; 134 } 135 repeated TopAlarm top_alarms = 38; 136 137 message AlarmStat { 138 option (.android.msg_privacy).dest = DEST_AUTOMATIC; 139 140 optional BroadcastStatsProto broadcast = 1; 141 repeated FilterStatsProto filters = 2; 142 } 143 repeated AlarmStat alarm_stats = 39; 144 145 repeated IdleDispatchEntryProto allow_while_idle_dispatches = 40; 146 repeated WakeupEventProto recent_wakeup_history = 41; 147 148 repeated AlarmProto pending_alarms = 42; 149} 150 151// This is a soft wrapper for alarm clock information. It is not representative 152// of an android.app.AlarmManager.AlarmClockInfo object. 153message AlarmClockMetadataProto { 154 option (.android.msg_privacy).dest = DEST_AUTOMATIC; 155 156 optional int32 user = 1; 157 optional bool is_pending_send = 2; 158 // This value is UTC wall clock time in milliseconds, as returned by 159 // System#currentTimeMillis() for example. 160 optional int64 trigger_time_ms = 3; 161} 162 163// A com.android.server.AlarmManagerService.Alarm object. 164message AlarmProto { 165 option (.android.msg_privacy).dest = DEST_AUTOMATIC; 166 167 optional string tag = 1 [ (.android.privacy).dest = DEST_EXPLICIT ]; 168 optional .android.app.AlarmManagerProto.AlarmType type = 2; 169 // How long until the alarm goes off, in the 'elapsed' timebase. Can be 170 // negative if 'when' is in the past. 171 optional int64 time_until_when_elapsed_ms = 3; 172 optional int64 window_length_ms = 4; 173 optional int64 repeat_interval_ms = 5; 174 optional int32 count = 6; 175 optional int32 flags = 7; 176 optional .android.app.AlarmClockInfoProto alarm_clock = 8; 177 optional .android.app.PendingIntentProto operation = 9; 178 optional string listener = 10 [ (.android.privacy).dest = DEST_EXPLICIT ]; 179} 180 181// A com.android.server.AlarmManagerService.Batch object. 182message BatchProto { 183 option (.android.msg_privacy).dest = DEST_AUTOMATIC; 184 185 // Start time in terms of elapsed realtime. 186 optional int64 start_realtime = 1; 187 // End time in terms of elapsed realtime. 188 optional int64 end_realtime = 2; 189 optional int32 flags = 3; 190 repeated AlarmProto alarms = 4; 191} 192 193// A com.android.server.AlarmManagerService.BroadcastStats object. 194message BroadcastStatsProto { 195 option (.android.msg_privacy).dest = DEST_AUTOMATIC; 196 197 optional int32 uid = 1; 198 optional string package_name = 2; 199 // The total amount of time this broadcast was in flight. 200 optional int64 total_flight_duration_ms = 3; 201 optional int32 count = 4; 202 optional int32 wakeup_count = 5; 203 // The last time this first became active (when nesting changed from 0 to 1) 204 // in terms of elapsed realtime. 205 optional int64 start_time_realtime = 6; 206 // The broadcast is active if nesting > 0. 207 optional int32 nesting = 7; 208} 209 210// A com.android.server.AlarmManagerService.Constants object. 211message ConstantsProto { 212 option (.android.msg_privacy).dest = DEST_AUTOMATIC; 213 214 // Minimum futurity of a new alarm. 215 optional int64 min_futurity_duration_ms = 1; 216 // Minimum alarm recurrence interval. 217 optional int64 min_interval_duration_ms = 2; 218 // Direct alarm listener callback timeout. 219 optional int64 listener_timeout_duration_ms = 3; 220 // Minimum time between ALLOW_WHILE_IDLE alarms when system is not idle. 221 optional int64 allow_while_idle_short_duration_ms = 4; 222 // Minimum time between ALLOW_WHILE_IDLE alarms when system is idling. 223 optional int64 allow_while_idle_long_duration_ms = 5; 224 // BroadcastOptions.setTemporaryAppWhitelistDuration() to use for FLAG_ALLOW_WHILE_IDLE. 225 optional int64 allow_while_idle_whitelist_duration_ms = 6; 226 // Maximum alarm recurrence interval. 227 optional int64 max_interval_duration_ms = 7; 228} 229 230// A com.android.server.AlarmManagerService.FilterStats object. 231message FilterStatsProto { 232 option (.android.msg_privacy).dest = DEST_AUTOMATIC; 233 234 // Tag given to AlarmManager by the app or component scheduling the alarm. 235 // As some of them are app-supplied, some tags may contain PII. 236 optional string tag = 1 [ (.android.privacy).dest = DEST_EXPLICIT ]; 237 // The last time this filter when in flight, in terms of elapsed realtime. 238 optional int64 last_flight_time_realtime = 2; 239 // The total amount of time this filter was in flight. 240 optional int64 total_flight_duration_ms = 3; 241 optional int32 count = 4; 242 optional int32 wakeup_count = 5; 243 // The last time this first became active (when nesting changed from 0 to 1) 244 // in terms of elapsed realtime. 245 optional int64 start_time_realtime = 6; 246 // The filter is active if nesting > 0. 247 optional int32 nesting = 7; 248} 249 250// A com.android.server.AlarmManagerService.IdleDispatchEntry object. 251message IdleDispatchEntryProto { 252 option (.android.msg_privacy).dest = DEST_AUTOMATIC; 253 254 optional int32 uid = 1; 255 optional string pkg = 2; 256 // Tag given to AlarmManager by the app or component scheduling the alarm. 257 // As some of them are app-supplied, some tags may contain PII. 258 optional string tag = 3 [ (.android.privacy).dest = DEST_EXPLICIT ]; 259 optional string op = 4; 260 // Time when this entry was created, in terms of elapsed realtime. 261 optional int64 entry_creation_realtime = 5; 262 // For a RESCHEDULED op, this is the last time we dispatched an "allow while 263 // idle" alarm for the UID. For a SET op, this is when the alarm was 264 // triggered. Times are in the 'elapsed' timebase. 265 optional int64 arg_realtime = 6; 266} 267 268// A com.android.server.AlarmManagerService.InFlight object. 269message InFlightProto { 270 option (.android.msg_privacy).dest = DEST_AUTOMATIC; 271 272 optional int32 uid = 1; 273 // Tag given to AlarmManager by the app or component scheduling the alarm. 274 // As some of them are app-supplied, some tags may contain PII. 275 optional string tag = 2 [ (.android.privacy).dest = DEST_EXPLICIT ]; 276 optional int64 when_elapsed_ms = 3; 277 optional .android.app.AlarmManagerProto.AlarmType alarm_type = 4; 278 optional .android.app.PendingIntentProto pending_intent = 5; 279 optional BroadcastStatsProto broadcast_stats = 6; 280 optional FilterStatsProto filter_stats = 7; 281 optional .android.os.WorkSourceProto work_source = 8; 282} 283 284// A com.android.server.AlarmManagerService.WakeupEvent object. 285message WakeupEventProto { 286 option (.android.msg_privacy).dest = DEST_AUTOMATIC; 287 288 optional int32 uid = 1; 289 // The operation that caused the wakeup. May be an Intent action or a 290 // listener tag. 291 optional string action = 2; 292 optional int64 when = 3; 293} 294