Loading core/java/android/service/notification/NotificationListenerService.java +2 −0 Original line number Diff line number Diff line Loading @@ -258,6 +258,8 @@ public abstract class NotificationListenerService extends Service { public static final int REASON_CLEAR_DATA = 21; /** Notification was canceled due to an assistant adjustment update. */ public static final int REASON_ASSISTANT_CANCEL = 22; // If adding a new notification cancellation reason, you must also add handling for it in // NotificationCancelledEvent.fromCancelReason. /** * @hide Loading services/core/java/com/android/server/notification/NotificationRecordLogger.java +8 −3 Original line number Diff line number Diff line Loading @@ -18,8 +18,8 @@ package com.android.server.notification; import static android.service.notification.NotificationListenerService.REASON_ASSISTANT_CANCEL; import static android.service.notification.NotificationListenerService.REASON_CANCEL; import static android.service.notification.NotificationListenerService.REASON_CLEAR_DATA; import static android.service.notification.NotificationListenerService.REASON_CLICK; import static android.service.notification.NotificationListenerService.REASON_TIMEOUT; import android.annotation.NonNull; import android.annotation.Nullable; Loading Loading @@ -172,7 +172,12 @@ public interface NotificationRecordLogger { NOTIFICATION_CANCEL_SNOOZED(181), @UiEvent(doc = "Notification was canceled due to timeout") NOTIFICATION_CANCEL_TIMEOUT(182), // Values 183-189 reserved for future system dismissal reasons @UiEvent(doc = "Notification was canceled due to the backing channel being deleted") NOTIFICATION_CANCEL_CHANNEL_REMOVED(1261), @UiEvent(doc = "Notification was canceled due to the app's storage being cleared") NOTIFICATION_CANCEL_CLEAR_DATA(1262), // Values above this line must remain in the same order as the corresponding // NotificationCancelReason enum values. @UiEvent(doc = "Notification was canceled due to user dismissal of a peeking notification.") NOTIFICATION_CANCEL_USER_PEEK(190), @UiEvent(doc = "Notification was canceled due to user dismissal from the always-on display") Loading Loading @@ -208,7 +213,7 @@ public interface NotificationRecordLogger { // Most cancel reasons do not have a meaningful surface. Reason codes map directly // to NotificationCancelledEvent codes. if (surface == NotificationStats.DISMISSAL_OTHER) { if ((REASON_CLICK <= reason) && (reason <= REASON_TIMEOUT)) { if ((REASON_CLICK <= reason) && (reason <= REASON_CLEAR_DATA)) { return NotificationCancelledEvent.values()[reason]; } if (reason == REASON_ASSISTANT_CANCEL) { Loading Loading
core/java/android/service/notification/NotificationListenerService.java +2 −0 Original line number Diff line number Diff line Loading @@ -258,6 +258,8 @@ public abstract class NotificationListenerService extends Service { public static final int REASON_CLEAR_DATA = 21; /** Notification was canceled due to an assistant adjustment update. */ public static final int REASON_ASSISTANT_CANCEL = 22; // If adding a new notification cancellation reason, you must also add handling for it in // NotificationCancelledEvent.fromCancelReason. /** * @hide Loading
services/core/java/com/android/server/notification/NotificationRecordLogger.java +8 −3 Original line number Diff line number Diff line Loading @@ -18,8 +18,8 @@ package com.android.server.notification; import static android.service.notification.NotificationListenerService.REASON_ASSISTANT_CANCEL; import static android.service.notification.NotificationListenerService.REASON_CANCEL; import static android.service.notification.NotificationListenerService.REASON_CLEAR_DATA; import static android.service.notification.NotificationListenerService.REASON_CLICK; import static android.service.notification.NotificationListenerService.REASON_TIMEOUT; import android.annotation.NonNull; import android.annotation.Nullable; Loading Loading @@ -172,7 +172,12 @@ public interface NotificationRecordLogger { NOTIFICATION_CANCEL_SNOOZED(181), @UiEvent(doc = "Notification was canceled due to timeout") NOTIFICATION_CANCEL_TIMEOUT(182), // Values 183-189 reserved for future system dismissal reasons @UiEvent(doc = "Notification was canceled due to the backing channel being deleted") NOTIFICATION_CANCEL_CHANNEL_REMOVED(1261), @UiEvent(doc = "Notification was canceled due to the app's storage being cleared") NOTIFICATION_CANCEL_CLEAR_DATA(1262), // Values above this line must remain in the same order as the corresponding // NotificationCancelReason enum values. @UiEvent(doc = "Notification was canceled due to user dismissal of a peeking notification.") NOTIFICATION_CANCEL_USER_PEEK(190), @UiEvent(doc = "Notification was canceled due to user dismissal from the always-on display") Loading Loading @@ -208,7 +213,7 @@ public interface NotificationRecordLogger { // Most cancel reasons do not have a meaningful surface. Reason codes map directly // to NotificationCancelledEvent codes. if (surface == NotificationStats.DISMISSAL_OTHER) { if ((REASON_CLICK <= reason) && (reason <= REASON_TIMEOUT)) { if ((REASON_CLICK <= reason) && (reason <= REASON_CLEAR_DATA)) { return NotificationCancelledEvent.values()[reason]; } if (reason == REASON_ASSISTANT_CANCEL) { Loading