Ned Burns | f098dbf | 2019-09-13 19:17:53 -0400 | [diff] [blame] | 1 | /* |
Ned Burns | 012048d | 2020-01-08 19:57:30 -0500 | [diff] [blame] | 2 | * Copyright (C) 2020 The Android Open Source Project |
Ned Burns | f098dbf | 2019-09-13 19:17:53 -0400 | [diff] [blame] | 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 | |
Ned Burns | 012048d | 2020-01-08 19:57:30 -0500 | [diff] [blame] | 17 | package com.android.systemui.statusbar.notification.collection.notifcollection; |
Ned Burns | f098dbf | 2019-09-13 19:17:53 -0400 | [diff] [blame] | 18 | |
Ned Burns | 012048d | 2020-01-08 19:57:30 -0500 | [diff] [blame] | 19 | import com.android.systemui.statusbar.notification.collection.NotifCollection; |
Ned Burns | f098dbf | 2019-09-13 19:17:53 -0400 | [diff] [blame] | 20 | import com.android.systemui.statusbar.notification.collection.NotifCollection.CancellationReason; |
Ned Burns | 012048d | 2020-01-08 19:57:30 -0500 | [diff] [blame] | 21 | import com.android.systemui.statusbar.notification.collection.NotificationEntry; |
Ned Burns | f098dbf | 2019-09-13 19:17:53 -0400 | [diff] [blame] | 22 | |
| 23 | /** |
| 24 | * Listener interface for {@link NotifCollection}. |
| 25 | */ |
| 26 | public interface NotifCollectionListener { |
| 27 | /** |
| 28 | * Called whenever a notification with a new key is posted. |
| 29 | */ |
| 30 | default void onEntryAdded(NotificationEntry entry) { |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Called whenever a notification with the same key as an existing notification is posted. By |
| 35 | * the time this listener is called, the entry's SBN and Ranking will already have been updated. |
| 36 | */ |
| 37 | default void onEntryUpdated(NotificationEntry entry) { |
| 38 | } |
| 39 | |
| 40 | /** |
Ned Burns | 012048d | 2020-01-08 19:57:30 -0500 | [diff] [blame] | 41 | * Called whenever a notification is retracted by system server. This method is not called |
| 42 | * immediately after a user dismisses a notification: we wait until we receive confirmation from |
| 43 | * system server before considering the notification removed. |
Ned Burns | f098dbf | 2019-09-13 19:17:53 -0400 | [diff] [blame] | 44 | */ |
| 45 | default void onEntryRemoved( |
| 46 | NotificationEntry entry, |
| 47 | @CancellationReason int reason, |
| 48 | boolean removedByUser) { |
| 49 | } |
| 50 | } |