1 /* 2 * Copyright (C) 2020 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 17 package com.android.systemui.statusbar.notification.row; 18 19 import android.service.notification.NotificationListenerService; 20 21 import com.android.systemui.statusbar.notification.collection.NotificationEntry; 22 23 /** 24 * Callbacks for when a user interacts with an {@link ExpandableNotificationRow}. 25 */ 26 public interface OnUserInteractionCallback { 27 28 /** 29 * Handle a user interaction that triggers a notification dismissal. Called when a user clicks 30 * on an auto-cancelled notification or manually swipes to dismiss the notification. 31 * 32 * @param entry notification being dismissed 33 * @param cancellationReason reason for the cancellation 34 * @param groupSummaryToDismiss group summary to dismiss with `entry`. 35 */ onDismiss( NotificationEntry entry, @NotificationListenerService.NotificationCancelReason int cancellationReason, NotificationEntry groupSummaryToDismiss)36 void onDismiss( 37 NotificationEntry entry, 38 @NotificationListenerService.NotificationCancelReason int cancellationReason, 39 NotificationEntry groupSummaryToDismiss); 40 41 /** 42 * Triggered after a user has changed the importance of the notification via its 43 * {@link NotificationGuts}. 44 */ onImportanceChanged(NotificationEntry entry)45 void onImportanceChanged(NotificationEntry entry); 46 47 48 /** 49 * @param entry being dismissed by the user 50 * @return group summary that should be dismissed along with `entry`. Can be null if no 51 * relevant group summary exists or the group summary should not be dismissed with `entry`. 52 */ getGroupSummaryToDismiss(NotificationEntry entry)53 NotificationEntry getGroupSummaryToDismiss(NotificationEntry entry); 54 } 55