blob: 3cb2a2aaeec7369787eb04739e2c7891748b52f4 [file] [log] [blame]
Eliot Courtney47098cb2017-10-18 17:30:30 +09001/*
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 */
16package com.android.systemui.statusbar;
17
Rohan Shah20790b82018-07-02 17:21:04 -070018import com.android.systemui.statusbar.notification.row.ActivatableNotificationView;
19import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
20
Eliot Courtney47098cb2017-10-18 17:30:30 +090021/**
22 * An abstraction of something that presents notifications, e.g. StatusBar. Contains methods
23 * for both querying the state of the system (some modularised piece of functionality may
24 * want to act differently based on e.g. whether the presenter is visible to the user or not) and
25 * for affecting the state of the system (e.g. starting an intent, given that the presenter may
26 * want to perform some action before doing so).
27 */
Jason Monk297c04e2018-08-23 17:16:59 -040028public interface NotificationPresenter extends ExpandableNotificationRow.OnExpandClickListener,
Ned Burnsc5864672019-02-20 12:57:29 -050029 ActivatableNotificationView.OnActivatedListener {
Eliot Courtney47098cb2017-10-18 17:30:30 +090030 /**
31 * Returns true if the presenter is not visible. For example, it may not be necessary to do
32 * animations if this returns true.
33 */
34 boolean isPresenterFullyCollapsed();
35
36 /**
Eliot Courtney3ebbccd2017-11-08 09:59:38 +090037 * Refresh or remove lockscreen artwork from media metadata or the lockscreen wallpaper.
38 */
39 void updateMediaMetaData(boolean metaDataChanged, boolean allowEnterAnimation);
40
Eliot Courtney09322282017-11-09 15:31:19 +090041 /**
Eliot Courtney09322282017-11-09 15:31:19 +090042 * Called when the current user changes.
43 * @param newUserId new user id
44 */
45 void onUserSwitched(int newUserId);
46
47 /**
Eliot Courtneya6d8cf22017-10-20 13:26:58 +090048 * @return true iff the device is in vr mode
49 */
50 boolean isDeviceInVrMode();
51
52 /**
Eliot Courtneya6d8cf22017-10-20 13:26:58 +090053 * Updates the visual representation of the notifications.
54 */
55 void updateNotificationViews();
56
57 /**
Eliot Courtney2b4c3a02017-11-27 13:27:46 +090058 * Returns the maximum number of notifications to show while locked.
59 *
60 * @param recompute whether something has changed that means we should recompute this value
61 * @return the maximum number of notifications to show while locked
62 */
63 int getMaxNotificationsWhileLocked(boolean recompute);
64
65 /**
Jason Monk297c04e2018-08-23 17:16:59 -040066 * Called when the row states are updated by {@link NotificationViewHierarchyManager}.
Eliot Courtney2b4c3a02017-11-27 13:27:46 +090067 */
68 void onUpdateRowStates();
Jason Monk297c04e2018-08-23 17:16:59 -040069
70 /**
71 * @return true if the shade is collapsing.
72 */
73 boolean isCollapsing();
Eliot Courtney47098cb2017-10-18 17:30:30 +090074}