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