Eliot Courtney | 47098cb | 2017-10-18 17:30:30 +0900 | [diff] [blame] | 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 | |
Rohan Shah | 20790b8 | 2018-07-02 17:21:04 -0700 | [diff] [blame] | 18 | import com.android.systemui.statusbar.notification.row.ActivatableNotificationView; |
| 19 | import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; |
| 20 | |
Eliot Courtney | 47098cb | 2017-10-18 17:30:30 +0900 | [diff] [blame] | 21 | /** |
| 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 Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 28 | public interface NotificationPresenter extends ExpandableNotificationRow.OnExpandClickListener, |
Ned Burns | c586467 | 2019-02-20 12:57:29 -0500 | [diff] [blame] | 29 | ActivatableNotificationView.OnActivatedListener { |
Eliot Courtney | 47098cb | 2017-10-18 17:30:30 +0900 | [diff] [blame] | 30 | /** |
| 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 Courtney | 3ebbccd | 2017-11-08 09:59:38 +0900 | [diff] [blame] | 37 | * Refresh or remove lockscreen artwork from media metadata or the lockscreen wallpaper. |
| 38 | */ |
| 39 | void updateMediaMetaData(boolean metaDataChanged, boolean allowEnterAnimation); |
| 40 | |
Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 41 | /** |
Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 42 | * Called when the current user changes. |
| 43 | * @param newUserId new user id |
| 44 | */ |
| 45 | void onUserSwitched(int newUserId); |
| 46 | |
| 47 | /** |
Eliot Courtney | a6d8cf2 | 2017-10-20 13:26:58 +0900 | [diff] [blame] | 48 | * @return true iff the device is in vr mode |
| 49 | */ |
| 50 | boolean isDeviceInVrMode(); |
| 51 | |
| 52 | /** |
Eliot Courtney | a6d8cf2 | 2017-10-20 13:26:58 +0900 | [diff] [blame] | 53 | * Updates the visual representation of the notifications. |
| 54 | */ |
Steve Elliott | 1ba1b7c | 2020-05-05 14:16:32 -0400 | [diff] [blame] | 55 | void updateNotificationViews(String reason); |
Eliot Courtney | a6d8cf2 | 2017-10-20 13:26:58 +0900 | [diff] [blame] | 56 | |
| 57 | /** |
Eliot Courtney | 2b4c3a0 | 2017-11-27 13:27:46 +0900 | [diff] [blame] | 58 | * 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 Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 66 | * Called when the row states are updated by {@link NotificationViewHierarchyManager}. |
Eliot Courtney | 2b4c3a0 | 2017-11-27 13:27:46 +0900 | [diff] [blame] | 67 | */ |
| 68 | void onUpdateRowStates(); |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 69 | |
| 70 | /** |
| 71 | * @return true if the shade is collapsing. |
| 72 | */ |
| 73 | boolean isCollapsing(); |
Eliot Courtney | 47098cb | 2017-10-18 17:30:30 +0900 | [diff] [blame] | 74 | } |