blob: 0a735029eead03a6b4329e66b3d4018add657b08 [file] [log] [blame]
Christopher Tate1d99c392017-12-07 16:54:04 -08001/*
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
17package com.android.server;
18
Suprabh Shukla0d51a8b2019-10-30 18:56:44 -070019import android.app.PendingIntent;
20
Christopher Tate1d99c392017-12-07 16:54:04 -080021public interface AlarmManagerInternal {
Christopher Tate2f558d22019-01-17 16:58:31 -080022 // Some other components in the system server need to know about
23 // broadcast alarms currently in flight
24 public interface InFlightListener {
25 /** There is now an alarm pending delivery to the given app */
26 void broadcastAlarmPending(int recipientUid);
27 /** A broadcast alarm targeted to the given app has completed delivery */
28 void broadcastAlarmComplete(int recipientUid);
29 }
30
Kweku Adamsb7ce1902019-01-30 10:55:34 -080031 /** Returns true if AlarmManager is delaying alarms due to device idle. */
32 boolean isIdling();
Christopher Tate2f558d22019-01-17 16:58:31 -080033 public void removeAlarmsForUid(int uid);
34 public void registerInFlightListener(InFlightListener callback);
Suprabh Shukla0d51a8b2019-10-30 18:56:44 -070035
36 /**
37 * Removes any alarm with the given pending intent with equality determined using
38 * {@link android.app.PendingIntent#equals(java.lang.Object) PendingIntent.equals}
39 */
40 void remove(PendingIntent rec);
Christopher Tate1d99c392017-12-07 16:54:04 -080041}