blob: 9cbc7d7efa6615b1c96fd282981b6a5677b08366 [file] [log] [blame]
Ned Burnsf098dbf2019-09-13 19:17:53 -04001/*
Ned Burns012048d2020-01-08 19:57:30 -05002 * Copyright (C) 2020 The Android Open Source Project
Ned Burnsf098dbf2019-09-13 19:17:53 -04003 *
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 Burns012048d2020-01-08 19:57:30 -050017package com.android.systemui.statusbar.notification.collection.notifcollection;
Ned Burnsf098dbf2019-09-13 19:17:53 -040018
Ned Burns012048d2020-01-08 19:57:30 -050019import com.android.systemui.statusbar.notification.collection.NotifCollection;
Ned Burnsf098dbf2019-09-13 19:17:53 -040020import com.android.systemui.statusbar.notification.collection.NotifCollection.CancellationReason;
Ned Burns012048d2020-01-08 19:57:30 -050021import com.android.systemui.statusbar.notification.collection.NotificationEntry;
Ned Burnsf098dbf2019-09-13 19:17:53 -040022
23/**
24 * Listener interface for {@link NotifCollection}.
25 */
26public 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 Burns012048d2020-01-08 19:57:30 -050041 * 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 Burnsf098dbf2019-09-13 19:17:53 -040044 */
45 default void onEntryRemoved(
46 NotificationEntry entry,
47 @CancellationReason int reason,
48 boolean removedByUser) {
49 }
50}