blob: 0342c9c8952705639c16606335aa1ce38e461586 [file] [log] [blame]
Kweku Adams61e03292017-10-19 14:27:12 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
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";
Makoto Onuki2206af32017-11-21 16:25:35 -080023import "frameworks/base/core/proto/android/server/forceappstandbytracker.proto";
Kweku Adamsce9ab2d2018-01-25 15:49:34 -080024import "frameworks/base/libs/incident/proto/android/privacy.proto";
Kweku Adams61e03292017-10-19 14:27:12 -070025
26package com.android.server;
27
28option java_multiple_files = true;
29
Makoto Onukiadb50d82018-01-29 16:20:30 -080030// next ID: 43
Kweku Adams61e03292017-10-19 14:27:12 -070031message AlarmManagerServiceProto {
Kweku Adamsce9ab2d2018-01-25 15:49:34 -080032 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
33
Kweku Adams61e03292017-10-19 14:27:12 -070034 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;
Makoto Onuki2206af32017-11-21 16:25:35 -080040
41 // Dump from ForceAppStandbyTracker.
42 optional ForceAppStandbyTrackerProto force_app_standby_tracker = 6;
Kweku Adams61e03292017-10-19 14:27:12 -070043
Kweku Adams923ec432017-12-11 18:05:38 -080044 optional bool is_interactive = 7;
Kweku Adams61e03292017-10-19 14:27:12 -070045 // Only valid if is_interactive is false.
Kweku Adams923ec432017-12-11 18:05:38 -080046 optional int64 time_since_non_interactive_ms = 8;
Kweku Adams61e03292017-10-19 14:27:12 -070047 // Only valid if is_interactive is false.
Kweku Adams923ec432017-12-11 18:05:38 -080048 optional int64 max_wakeup_delay_ms = 9;
Kweku Adams61e03292017-10-19 14:27:12 -070049 // Only valid if is_interactive is false.
Kweku Adams923ec432017-12-11 18:05:38 -080050 optional int64 time_since_last_dispatch_ms = 10;
Kweku Adams61e03292017-10-19 14:27:12 -070051 // Only valid if is_interactive is false.
Kweku Adams923ec432017-12-11 18:05:38 -080052 optional int64 time_until_next_non_wakeup_delivery_ms = 11;
Kweku Adams61e03292017-10-19 14:27:12 -070053
Kweku Adamsf2e67df2018-01-23 16:47:12 -080054 // 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).
Kweku Adams923ec432017-12-11 18:05:38 -080056 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;
Kweku Adams61e03292017-10-19 14:27:12 -070059 // Time since the last wakeup was set.
Kweku Adams923ec432017-12-11 18:05:38 -080060 optional int64 time_since_last_wakeup_set_ms = 15;
61 optional int64 time_change_event_count = 16;
Kweku Adams61e03292017-10-19 14:27:12 -070062 // The current set of user whitelisted apps for device idle mode, meaning
63 // these are allowed to freely schedule alarms. These are app IDs, not UIDs.
Kweku Adams923ec432017-12-11 18:05:38 -080064 repeated int32 device_idle_user_whitelist_app_ids = 17;
Kweku Adams61e03292017-10-19 14:27:12 -070065
Kweku Adams923ec432017-12-11 18:05:38 -080066 repeated AlarmClockMetadataProto next_alarm_clock_metadata = 18;
Kweku Adams61e03292017-10-19 14:27:12 -070067
Kweku Adams923ec432017-12-11 18:05:38 -080068 repeated BatchProto pending_alarm_batches = 19;
Kweku Adams61e03292017-10-19 14:27:12 -070069
70 // List of alarms per uid deferred due to user applied background restrictions
71 // on the source app.
Kweku Adams923ec432017-12-11 18:05:38 -080072 repeated AlarmProto pending_user_blocked_background_alarms = 20;
Kweku Adams61e03292017-10-19 14:27:12 -070073
74 // When idling mode will end. Will be empty if the device is not currently
75 // idling.
Kweku Adams923ec432017-12-11 18:05:38 -080076 optional AlarmProto pending_idle_until = 21;
Kweku Adams61e03292017-10-19 14:27:12 -070077
78 // Any alarms that we don't want to run during idle mode. Will be empty if the
79 // device is not currently idling.
Kweku Adams923ec432017-12-11 18:05:38 -080080 repeated AlarmProto pending_while_idle_alarms = 22;
Kweku Adams61e03292017-10-19 14:27:12 -070081
82 // This is a special alarm that will put the system into idle until it goes
83 // off. The caller has given the time they want this to happen at.
Kweku Adams923ec432017-12-11 18:05:38 -080084 optional AlarmProto next_wake_from_idle = 23;
Kweku Adams61e03292017-10-19 14:27:12 -070085
Kweku Adams923ec432017-12-11 18:05:38 -080086 repeated AlarmProto past_due_non_wakeup_alarms = 24;
Kweku Adams61e03292017-10-19 14:27:12 -070087
88 // Number of delayed alarms.
Kweku Adams923ec432017-12-11 18:05:38 -080089 optional int32 delayed_alarm_count = 25;
Kweku Adams61e03292017-10-19 14:27:12 -070090 // The total amount of time alarms had been delayed. Overlapping alarms are
91 // only counted once (ie. If two alarms were meant to trigger at the same time
92 // but were delayed by 5 seconds, the total time would be 5 seconds).
Kweku Adams923ec432017-12-11 18:05:38 -080093 optional int64 total_delay_time_ms = 26;
94 optional int64 max_delay_duration_ms = 27;
95 optional int64 max_non_interactive_duration_ms = 28;
Kweku Adams61e03292017-10-19 14:27:12 -070096
Kweku Adams923ec432017-12-11 18:05:38 -080097 optional int32 broadcast_ref_count = 29;
Kweku Adams61e03292017-10-19 14:27:12 -070098 // Canonical count of (operation.send() - onSendFinished()) and listener
99 // send/complete/timeout invocations.
Kweku Adams923ec432017-12-11 18:05:38 -0800100 optional int32 pending_intent_send_count = 30;
101 optional int32 pending_intent_finish_count = 31;
102 optional int32 listener_send_count = 32;
103 optional int32 listener_finish_count = 33;
Kweku Adams61e03292017-10-19 14:27:12 -0700104
Kweku Adams923ec432017-12-11 18:05:38 -0800105 repeated InFlightProto outstanding_deliveries = 34;
Kweku Adams61e03292017-10-19 14:27:12 -0700106
107 // Minimum time between ALLOW_WHILE_IDLE alarms when system is idling. It
108 // should be either CosntantsProto.allow_while_idle_short_duration_ms or
109 // ConstantsProto.allow_while_idle_long_duration_ms.
Kweku Adams923ec432017-12-11 18:05:38 -0800110 optional int64 allow_while_idle_min_duration_ms = 35;
Kweku Adams61e03292017-10-19 14:27:12 -0700111
112 message LastAllowWhileIdleDispatch {
Kweku Adamsce9ab2d2018-01-25 15:49:34 -0800113 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
114
Kweku Adams61e03292017-10-19 14:27:12 -0700115 optional int32 uid = 1;
116 // In the 'elapsed' timebase.
117 optional int64 time_ms = 2;
Makoto Onukiadb50d82018-01-29 16:20:30 -0800118
119 // Time when the next while-idle is allowed, in the 'elapsed' timebase.
120 optional int64 next_allowed_ms = 3;
Kweku Adams61e03292017-10-19 14:27:12 -0700121 }
Makoto Onukiadb50d82018-01-29 16:20:30 -0800122
123 // Whether the short or long while-idle timeout should be used for each UID.
124 repeated int32 use_allow_while_idle_short_time = 42;
125
Kweku Adams61e03292017-10-19 14:27:12 -0700126 // For each uid, this is the last time we dispatched an "allow while idle"
127 // alarm, used to determine the earliest we can dispatch the next such alarm.
Kweku Adams923ec432017-12-11 18:05:38 -0800128 repeated LastAllowWhileIdleDispatch last_allow_while_idle_dispatch_times = 36;
Kweku Adams61e03292017-10-19 14:27:12 -0700129
Kweku Adams923ec432017-12-11 18:05:38 -0800130 optional com.android.internal.util.LocalLogProto recent_problems = 37;
Kweku Adams61e03292017-10-19 14:27:12 -0700131
132 message TopAlarm {
Kweku Adamsce9ab2d2018-01-25 15:49:34 -0800133 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
134
Kweku Adams61e03292017-10-19 14:27:12 -0700135 optional int32 uid = 1;
136 optional string package_name = 2;
137 optional FilterStatsProto filter = 3;
138 }
Kweku Adams923ec432017-12-11 18:05:38 -0800139 repeated TopAlarm top_alarms = 38;
Kweku Adams61e03292017-10-19 14:27:12 -0700140
141 message AlarmStat {
Kweku Adamsce9ab2d2018-01-25 15:49:34 -0800142 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
143
Kweku Adams61e03292017-10-19 14:27:12 -0700144 optional BroadcastStatsProto broadcast = 1;
145 repeated FilterStatsProto filters = 2;
146 }
Kweku Adams923ec432017-12-11 18:05:38 -0800147 repeated AlarmStat alarm_stats = 39;
Kweku Adams61e03292017-10-19 14:27:12 -0700148
Kweku Adams923ec432017-12-11 18:05:38 -0800149 repeated IdleDispatchEntryProto allow_while_idle_dispatches = 40;
150 repeated WakeupEventProto recent_wakeup_history = 41;
Kweku Adams61e03292017-10-19 14:27:12 -0700151}
152
153// This is a soft wrapper for alarm clock information. It is not representative
154// of an android.app.AlarmManager.AlarmClockInfo object.
155message AlarmClockMetadataProto {
Kweku Adamsce9ab2d2018-01-25 15:49:34 -0800156 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
157
Kweku Adams61e03292017-10-19 14:27:12 -0700158 optional int32 user = 1;
159 optional bool is_pending_send = 2;
160 // This value is UTC wall clock time in milliseconds, as returned by
161 // System#currentTimeMillis() for example.
162 optional int64 trigger_time_ms = 3;
163}
164
165// A com.android.server.AlarmManagerService.Alarm object.
166message AlarmProto {
Kweku Adamsce9ab2d2018-01-25 15:49:34 -0800167 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
168
169 optional string tag = 1 [ (.android.privacy).dest = DEST_EXPLICIT ];
Kweku Adams61e03292017-10-19 14:27:12 -0700170 optional .android.app.AlarmManagerProto.AlarmType type = 2;
Kweku Adams923ec432017-12-11 18:05:38 -0800171 // How long until the alarm goes off, in the 'elapsed' timebase. Can be
172 // negative if 'when' is in the past.
173 optional int64 time_until_when_elapsed_ms = 3;
Kweku Adams61e03292017-10-19 14:27:12 -0700174 optional int64 window_length_ms = 4;
175 optional int64 repeat_interval_ms = 5;
176 optional int32 count = 6;
177 optional int32 flags = 7;
178 optional .android.app.AlarmClockInfoProto alarm_clock = 8;
179 optional .android.app.PendingIntentProto operation = 9;
Kweku Adamsce9ab2d2018-01-25 15:49:34 -0800180 optional string listener = 10 [ (.android.privacy).dest = DEST_EXPLICIT ];
Kweku Adams61e03292017-10-19 14:27:12 -0700181}
182
183// A com.android.server.AlarmManagerService.Batch object.
184message BatchProto {
Kweku Adamsce9ab2d2018-01-25 15:49:34 -0800185 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
186
Kweku Adams61e03292017-10-19 14:27:12 -0700187 // Start time in terms of elapsed realtime.
188 optional int64 start_realtime = 1;
189 // End time in terms of elapsed realtime.
190 optional int64 end_realtime = 2;
191 optional int32 flags = 3;
192 repeated AlarmProto alarms = 4;
193}
194
195// A com.android.server.AlarmManagerService.BroadcastStats object.
196message BroadcastStatsProto {
Kweku Adamsce9ab2d2018-01-25 15:49:34 -0800197 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
198
Kweku Adams61e03292017-10-19 14:27:12 -0700199 optional int32 uid = 1;
200 optional string package_name = 2;
201 // The total amount of time this broadcast was in flight.
202 optional int64 total_flight_duration_ms = 3;
203 optional int32 count = 4;
204 optional int32 wakeup_count = 5;
205 // The last time this first became active (when nesting changed from 0 to 1)
206 // in terms of elapsed realtime.
207 optional int64 start_time_realtime = 6;
208 // The broadcast is active if nesting > 0.
209 optional int32 nesting = 7;
210}
211
212// A com.android.server.AlarmManagerService.Constants object.
213message ConstantsProto {
Kweku Adamsce9ab2d2018-01-25 15:49:34 -0800214 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
215
Kweku Adams61e03292017-10-19 14:27:12 -0700216 // Minimum futurity of a new alarm.
217 optional int64 min_futurity_duration_ms = 1;
218 // Minimum alarm recurrence interval.
219 optional int64 min_interval_duration_ms = 2;
220 // Direct alarm listener callback timeout.
221 optional int64 listener_timeout_duration_ms = 3;
222 // Minimum time between ALLOW_WHILE_IDLE alarms when system is not idle.
223 optional int64 allow_while_idle_short_duration_ms = 4;
224 // Minimum time between ALLOW_WHILE_IDLE alarms when system is idling.
225 optional int64 allow_while_idle_long_duration_ms = 5;
226 // BroadcastOptions.setTemporaryAppWhitelistDuration() to use for FLAG_ALLOW_WHILE_IDLE.
227 optional int64 allow_while_idle_whitelist_duration_ms = 6;
228}
229
230// A com.android.server.AlarmManagerService.FilterStats object.
231message FilterStatsProto {
Kweku Adamsce9ab2d2018-01-25 15:49:34 -0800232 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
233
234 optional string tag = 1 [ (.android.privacy).dest = DEST_EXPLICIT ];
Kweku Adams61e03292017-10-19 14:27:12 -0700235 // The last time this filter when in flight, in terms of elapsed realtime.
236 optional int64 last_flight_time_realtime = 2;
237 // The total amount of time this filter was in flight.
238 optional int64 total_flight_duration_ms = 3;
239 optional int32 count = 4;
240 optional int32 wakeup_count = 5;
241 // The last time this first became active (when nesting changed from 0 to 1)
242 // in terms of elapsed realtime.
243 optional int64 start_time_realtime = 6;
244 // The filter is active if nesting > 0.
245 optional int32 nesting = 7;
246}
247
248// A com.android.server.AlarmManagerService.IdleDispatchEntry object.
249message IdleDispatchEntryProto {
Kweku Adamsce9ab2d2018-01-25 15:49:34 -0800250 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
251
Kweku Adams61e03292017-10-19 14:27:12 -0700252 optional int32 uid = 1;
253 optional string pkg = 2;
Kweku Adamsce9ab2d2018-01-25 15:49:34 -0800254 optional string tag = 3 [ (.android.privacy).dest = DEST_EXPLICIT ];
Kweku Adams61e03292017-10-19 14:27:12 -0700255 optional string op = 4;
256 // Time when this entry was created, in terms of elapsed realtime.
257 optional int64 entry_creation_realtime = 5;
258 // For a RESCHEDULED op, this is the last time we dispatched an "allow while
259 // idle" alarm for the UID. For a SET op, this is when the alarm was
260 // triggered. Times are in the 'elapsed' timebase.
261 optional int64 arg_realtime = 6;
262}
263
264// A com.android.server.AlarmManagerService.InFlight object.
265message InFlightProto {
Kweku Adamsce9ab2d2018-01-25 15:49:34 -0800266 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
267
Kweku Adams61e03292017-10-19 14:27:12 -0700268 optional int32 uid = 1;
Kweku Adamsce9ab2d2018-01-25 15:49:34 -0800269 optional string tag = 2 [ (.android.privacy).dest = DEST_EXPLICIT ];
Kweku Adams61e03292017-10-19 14:27:12 -0700270 optional int64 when_elapsed_ms = 3;
271 optional .android.app.AlarmManagerProto.AlarmType alarm_type = 4;
272 optional .android.app.PendingIntentProto pending_intent = 5;
273 optional BroadcastStatsProto broadcast_stats = 6;
274 optional FilterStatsProto filter_stats = 7;
275 optional .android.os.WorkSourceProto work_source = 8;
276}
277
278// A com.android.server.AlarmManagerService.WakeupEvent object.
279message WakeupEventProto {
Kweku Adamsce9ab2d2018-01-25 15:49:34 -0800280 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
281
Kweku Adams61e03292017-10-19 14:27:12 -0700282 optional int32 uid = 1;
283 optional string action = 2;
284 optional int64 when = 3;
285}