blob: ae6ee2af29fd82071a8f5d25d51b5bfa440f0d51 [file] [log] [blame]
Dan Sandlerf5aafb92017-05-28 12:18:53 -04001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
5 * except in compliance with the License. You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software distributed under the
10 * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
11 * KIND, either express or implied. See the License for the specific language governing
12 * permissions and limitations under the License.
13 */
14
15package com.android.systemui;
16
Julia Reynoldsfc640012018-02-21 12:25:27 -050017import android.annotation.Nullable;
Dan Sandlerf5aafb92017-05-28 12:18:53 -040018import android.service.notification.StatusBarNotification;
Julia Reynoldsfc640012018-02-21 12:25:27 -050019import android.util.ArraySet;
Dan Sandlerf5aafb92017-05-28 12:18:53 -040020
21public interface ForegroundServiceController {
22 /**
23 * @param sbn notification that was just posted
24 * @param importance
25 */
26 void addNotification(StatusBarNotification sbn, int importance);
27
28 /**
29 * @param sbn notification that was just changed in some way
30 * @param newImportance
31 */
32 void updateNotification(StatusBarNotification sbn, int newImportance);
33
34 /**
35 * @param sbn notification that was just canceled
36 */
37 boolean removeNotification(StatusBarNotification sbn);
38
39 /**
40 * @param userId
41 * @return true if this user has services missing notifications and therefore needs a
42 * disclosure notification.
43 */
44 boolean isDungeonNeededForUser(int userId);
45
46 /**
47 * @param sbn
48 * @return true if sbn is the system-provided "dungeon" (list of running foreground services).
49 */
50 boolean isDungeonNotification(StatusBarNotification sbn);
Julia Reynoldsfc640012018-02-21 12:25:27 -050051
52 /**
53 * @return true if sbn is one of the window manager "drawing over other apps" notifications
54 */
55 boolean isSystemAlertNotification(StatusBarNotification sbn);
56
57 /**
58 * Returns the key of the foreground service from this package using the standard template,
59 * if one exists.
60 */
61 @Nullable String getStandardLayoutKey(int userId, String pkg);
62
63 /**
64 * @return true if this user/pkg has a missing or custom layout notification and therefore needs
65 * a disclosure notification for system alert windows.
66 */
67 boolean isSystemAlertWarningNeeded(int userId, String pkg);
68
69 /**
70 * Records active app ops. App Ops are stored in FSC in addition to NotificationData in
71 * case they change before we have a notification to tag.
72 */
73 void onAppOpChanged(int code, int uid, String packageName, boolean active);
74
75 /**
Julia Reynolds91590062018-04-02 16:24:11 -040076 * Gets active app ops for this user and package
Julia Reynoldsfc640012018-02-21 12:25:27 -050077 */
78 @Nullable ArraySet<Integer> getAppOps(int userId, String packageName);
Dan Sandlerf5aafb92017-05-28 12:18:53 -040079}