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