Home | History | Annotate | Download | only in server
      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";
     23 import "frameworks/base/core/proto/android/server/forceappstandbytracker.proto";
     24 import "frameworks/base/libs/incident/proto/android/privacy.proto";
     25 
     26 package com.android.server;
     27 
     28 option java_multiple_files = true;
     29 
     30 // next ID: 43
     31 message 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 ForceAppStandbyTracker.
     42     optional ForceAppStandbyTrackerProto force_app_standby_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 whitelisted apps for device idle mode, meaning
     63     // these are allowed to freely schedule alarms. These are app IDs, not UIDs.
     64     repeated int32 device_idle_user_whitelist_app_ids = 17;
     65 
     66     repeated AlarmClockMetadataProto next_alarm_clock_metadata = 18;
     67 
     68     repeated BatchProto pending_alarm_batches = 19;
     69 
     70     // List of alarms per uid deferred due to user applied background restrictions
     71     // on the source app.
     72     repeated AlarmProto pending_user_blocked_background_alarms = 20;
     73 
     74     // When idling mode will end. Will be empty if the device is not currently
     75     // idling.
     76     optional AlarmProto pending_idle_until = 21;
     77 
     78     // Any alarms that we don't want to run during idle mode. Will be empty if the
     79     // device is not currently idling.
     80     repeated AlarmProto pending_while_idle_alarms = 22;
     81 
     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.
     84     optional AlarmProto next_wake_from_idle = 23;
     85 
     86     repeated AlarmProto past_due_non_wakeup_alarms = 24;
     87 
     88     // Number of delayed alarms.
     89     optional int32 delayed_alarm_count = 25;
     90     // 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).
     93     optional int64 total_delay_time_ms = 26;
     94     optional int64 max_delay_duration_ms = 27;
     95     optional int64 max_non_interactive_duration_ms = 28;
     96 
     97     optional int32 broadcast_ref_count = 29;
     98     // Canonical count of (operation.send() - onSendFinished()) and listener
     99     // send/complete/timeout invocations.
    100     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;
    104 
    105     repeated InFlightProto outstanding_deliveries = 34;
    106 
    107     message LastAllowWhileIdleDispatch {
    108         option (.android.msg_privacy).dest = DEST_AUTOMATIC;
    109 
    110         optional int32 uid = 1;
    111         // In the 'elapsed' timebase.
    112         optional int64 time_ms = 2;
    113 
    114         // Time when the next while-idle is allowed, in the 'elapsed' timebase.
    115         optional int64 next_allowed_ms = 3;
    116     }
    117 
    118     // Whether the short or long while-idle timeout should be used for each UID.
    119     repeated int32 use_allow_while_idle_short_time = 35;
    120 
    121     // For each uid, this is the last time we dispatched an "allow while idle"
    122     // alarm, used to determine the earliest we can dispatch the next such alarm.
    123     repeated LastAllowWhileIdleDispatch last_allow_while_idle_dispatch_times = 36;
    124 
    125     optional com.android.internal.util.LocalLogProto recent_problems = 37;
    126 
    127     message TopAlarm {
    128         option (.android.msg_privacy).dest = DEST_AUTOMATIC;
    129 
    130         optional int32 uid = 1;
    131         optional string package_name = 2;
    132         optional FilterStatsProto filter = 3;
    133     }
    134     repeated TopAlarm top_alarms = 38;
    135 
    136     message AlarmStat {
    137         option (.android.msg_privacy).dest = DEST_AUTOMATIC;
    138 
    139         optional BroadcastStatsProto broadcast = 1;
    140         repeated FilterStatsProto filters = 2;
    141     }
    142     repeated AlarmStat alarm_stats = 39;
    143 
    144     repeated IdleDispatchEntryProto allow_while_idle_dispatches = 40;
    145     repeated WakeupEventProto recent_wakeup_history = 41;
    146 }
    147 
    148 // This is a soft wrapper for alarm clock information. It is not representative
    149 // of an android.app.AlarmManager.AlarmClockInfo object.
    150 message AlarmClockMetadataProto {
    151     option (.android.msg_privacy).dest = DEST_AUTOMATIC;
    152 
    153     optional int32 user = 1;
    154     optional bool is_pending_send = 2;
    155     // This value is UTC wall clock time in milliseconds, as returned by
    156     // System#currentTimeMillis() for example.
    157     optional int64 trigger_time_ms = 3;
    158 }
    159 
    160 // A com.android.server.AlarmManagerService.Alarm object.
    161 message AlarmProto {
    162     option (.android.msg_privacy).dest = DEST_AUTOMATIC;
    163 
    164     optional string tag = 1 [ (.android.privacy).dest = DEST_EXPLICIT ];
    165     optional .android.app.AlarmManagerProto.AlarmType type = 2;
    166     // How long until the alarm goes off, in the 'elapsed' timebase. Can be
    167     // negative if 'when' is in the past.
    168     optional int64 time_until_when_elapsed_ms = 3;
    169     optional int64 window_length_ms = 4;
    170     optional int64 repeat_interval_ms = 5;
    171     optional int32 count = 6;
    172     optional int32 flags = 7;
    173     optional .android.app.AlarmClockInfoProto alarm_clock = 8;
    174     optional .android.app.PendingIntentProto operation = 9;
    175     optional string listener = 10 [ (.android.privacy).dest = DEST_EXPLICIT ];
    176 }
    177 
    178 // A com.android.server.AlarmManagerService.Batch object.
    179 message BatchProto {
    180     option (.android.msg_privacy).dest = DEST_AUTOMATIC;
    181 
    182     // Start time in terms of elapsed realtime.
    183     optional int64 start_realtime = 1;
    184     // End time in terms of elapsed realtime.
    185     optional int64 end_realtime = 2;
    186     optional int32 flags = 3;
    187     repeated AlarmProto alarms = 4;
    188 }
    189 
    190 // A com.android.server.AlarmManagerService.BroadcastStats object.
    191 message BroadcastStatsProto {
    192     option (.android.msg_privacy).dest = DEST_AUTOMATIC;
    193 
    194     optional int32 uid = 1;
    195     optional string package_name = 2;
    196     // The total amount of time this broadcast was in flight.
    197     optional int64 total_flight_duration_ms = 3;
    198     optional int32 count = 4;
    199     optional int32 wakeup_count = 5;
    200     // The last time this first became active (when nesting changed from 0 to 1)
    201     // in terms of elapsed realtime.
    202     optional int64 start_time_realtime = 6;
    203     // The broadcast is active if nesting > 0.
    204     optional int32 nesting = 7;
    205 }
    206 
    207 // A com.android.server.AlarmManagerService.Constants object.
    208 message ConstantsProto {
    209     option (.android.msg_privacy).dest = DEST_AUTOMATIC;
    210 
    211     // Minimum futurity of a new alarm.
    212     optional int64 min_futurity_duration_ms = 1;
    213     // Minimum alarm recurrence interval.
    214     optional int64 min_interval_duration_ms = 2;
    215     // Direct alarm listener callback timeout.
    216     optional int64 listener_timeout_duration_ms = 3;
    217     // Minimum time between ALLOW_WHILE_IDLE alarms when system is not idle.
    218     optional int64 allow_while_idle_short_duration_ms = 4;
    219     // Minimum time between ALLOW_WHILE_IDLE alarms when system is idling.
    220     optional int64 allow_while_idle_long_duration_ms = 5;
    221     // BroadcastOptions.setTemporaryAppWhitelistDuration() to use for FLAG_ALLOW_WHILE_IDLE.
    222     optional int64 allow_while_idle_whitelist_duration_ms = 6;
    223     // Maximum alarm recurrence interval.
    224     optional int64 max_interval_duration_ms = 7;
    225 }
    226 
    227 // A com.android.server.AlarmManagerService.FilterStats object.
    228 message FilterStatsProto {
    229     option (.android.msg_privacy).dest = DEST_AUTOMATIC;
    230 
    231     optional string tag = 1 [ (.android.privacy).dest = DEST_EXPLICIT ];
    232     // The last time this filter when in flight, in terms of elapsed realtime.
    233     optional int64 last_flight_time_realtime = 2;
    234     // The total amount of time this filter was in flight.
    235     optional int64 total_flight_duration_ms = 3;
    236     optional int32 count = 4;
    237     optional int32 wakeup_count = 5;
    238     // The last time this first became active (when nesting changed from 0 to 1)
    239     // in terms of elapsed realtime.
    240     optional int64 start_time_realtime = 6;
    241     // The filter is active if nesting > 0.
    242     optional int32 nesting = 7;
    243 }
    244 
    245 // A com.android.server.AlarmManagerService.IdleDispatchEntry object.
    246 message IdleDispatchEntryProto {
    247     option (.android.msg_privacy).dest = DEST_AUTOMATIC;
    248 
    249     optional int32 uid = 1;
    250     optional string pkg = 2;
    251     optional string tag = 3 [ (.android.privacy).dest = DEST_EXPLICIT ];
    252     optional string op = 4;
    253     // Time when this entry was created, in terms of elapsed realtime.
    254     optional int64 entry_creation_realtime = 5;
    255     // For a RESCHEDULED op, this is the last time we dispatched an "allow while
    256     // idle" alarm for the UID. For a SET op, this is when the alarm was
    257     // triggered. Times are in the 'elapsed' timebase.
    258     optional int64 arg_realtime = 6;
    259 }
    260 
    261 // A com.android.server.AlarmManagerService.InFlight object.
    262 message InFlightProto {
    263     option (.android.msg_privacy).dest = DEST_AUTOMATIC;
    264 
    265     optional int32 uid = 1;
    266     optional string tag = 2 [ (.android.privacy).dest = DEST_EXPLICIT ];
    267     optional int64 when_elapsed_ms = 3;
    268     optional .android.app.AlarmManagerProto.AlarmType alarm_type = 4;
    269     optional .android.app.PendingIntentProto pending_intent = 5;
    270     optional BroadcastStatsProto broadcast_stats = 6;
    271     optional FilterStatsProto filter_stats = 7;
    272     optional .android.os.WorkSourceProto work_source = 8;
    273 }
    274 
    275 // A com.android.server.AlarmManagerService.WakeupEvent object.
    276 message WakeupEventProto {
    277     option (.android.msg_privacy).dest = DEST_AUTOMATIC;
    278 
    279     optional int32 uid = 1;
    280     optional string action = 2;
    281     optional int64 when = 3;
    282 }
    283