1 /*
2  * Copyright (C) 2018 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 package android.platform.helpers;
18 
19 /** An App Helper interface for the Notification. */
20 public interface INotificationHelper extends IAppHelper {
21     /**
22      * Setup expectations: Notification shade opened.
23      *
24      * <p>Opens a notification from notification shade.
25      *
26      * @param index The index of the notification to open.
27      */
openNotificationbyIndex(int index)28     default public void openNotificationbyIndex(int index) {
29         throw new UnsupportedOperationException("Not yet implemented.");
30     }
31 
32     /**
33      * Setup Expectations: None
34      *
35      * <p>Posts a number of notifications to the device. Successive calls to this should post
36      * new notifications to those previously posted. Note that this may fail if the helper has
37      * surpassed the system-defined limit for per-package notifications.
38      *
39      * @param count The number of notifications to post.
40      */
postNotifications(int count)41     default public void postNotifications(int count) {
42         throw new UnsupportedOperationException("Not yet implemented.");
43     }
44 
45     /**
46      * Setup Expectations: None
47      *
48      * <p>Posts a number of notifications to the device with a package to launch. Successive calls
49      * to this should post new notifications in addition to those previously posted. Note that this
50      * may fail if the helper has surpassed the system-defined limit for per-package notifications.
51      *
52      * @param count The number of notifications to post.
53      * @param pkg The application that will be launched by notifications.
54      */
postNotifications(int count, String pkg)55     public default void postNotifications(int count, String pkg) {
56         throw new UnsupportedOperationException("Not yet implemented.");
57     }
58 
59     /**
60      * Setup Expectations: None
61      *
62      * <p>Cancel any notifications posted by this helper.
63      */
cancelNotifications()64     default public void cancelNotifications() {
65         throw new UnsupportedOperationException("Not yet implemented.");
66     }
67 
68     /**
69      * Setup expectations: Notification shade opened.
70      *
71      * <p>Opens the first notification by the specified title and checks if the expected application
72      * is in foreground or not
73      *
74      * @param title The title of the notification to open.
75      * @param expectedPkg The foreground application after opening a notification. Won't check the
76      *     foreground application if the application is null
77      */
openNotificationByTitle(String title, String expectedPkg)78     public default void openNotificationByTitle(String title, String expectedPkg) {
79         throw new UnsupportedOperationException("Not yet implemented.");
80     }
81 }
82