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