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 package com.android.systemui.statusbar;
17 
18 import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
19 
20 /**
21  * An abstraction of something that presents notifications, e.g. CentralSurfaces. Contains methods
22  * for both querying the state of the system (some modularised piece of functionality may
23  * want to act differently based on e.g. whether the presenter is visible to the user or not) and
24  * for affecting the state of the system (e.g. starting an intent, given that the presenter may
25  * want to perform some action before doing so).
26  */
27 public interface NotificationPresenter extends ExpandableNotificationRow.OnExpandClickListener {
28     /**
29      * Returns true if the presenter is not visible. For example, it may not be necessary to do
30      * animations if this returns true.
31      */
isPresenterFullyCollapsed()32     boolean isPresenterFullyCollapsed();
33 
34     /**
35      * Refresh or remove lockscreen artwork from media metadata or the lockscreen wallpaper.
36      */
updateMediaMetaData(boolean metaDataChanged, boolean allowEnterAnimation)37     void updateMediaMetaData(boolean metaDataChanged, boolean allowEnterAnimation);
38 
39     /**
40      * Called when the current user changes.
41      * @param newUserId new user id
42      */
onUserSwitched(int newUserId)43     void onUserSwitched(int newUserId);
44 
45     /**
46      * Called when a new row is created and bound to a notification.
47      */
onBindRow(ExpandableNotificationRow row)48     void onBindRow(ExpandableNotificationRow row);
49 
50     /**
51      * @return true iff the device is in vr mode
52      */
isDeviceInVrMode()53     boolean isDeviceInVrMode();
54 
55     /**
56      * @return true if the shade is collapsing.
57      */
isCollapsing()58     boolean isCollapsing();
59 }
60