diff options
| author | Yuri Lin <yurilin@google.com> | 2022-01-10 14:33:01 -0500 |
|---|---|---|
| committer | Yuri Lin <yurilin@google.com> | 2022-02-08 15:34:11 -0500 |
| commit | ef3f660d722d12560958c43543a94dec1f8787e9 (patch) | |
| tree | bc94a9bedd16c8044cd020aed311284564d613f9 /core/java | |
| parent | 37da147fdfde55bd7e7236b37004f616c286c63a (diff) | |
Log assistant notification cancels accordingly.
This change adds the NOTIFICATION_CANCEL_ASSISTANT uievent and reports any cancellations due to assistants as REASON_ASSISTANT_CANCEL. Listeners below T (when this reason is added) are notified with the same reason that was previously used in all cases, REASON_LISTENER_CANCEL.
Bug: 201417230
Test: NotificationManagerServiceTest, manually by statsd_testdrive
Change-Id: Iae50053d325b62b479b3c31aea97d35d8847f381
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/service/notification/NotificationListenerService.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/java/android/service/notification/NotificationListenerService.java b/core/java/android/service/notification/NotificationListenerService.java index ae39d3d3c2da..b9e60a11a8f3 100644 --- a/core/java/android/service/notification/NotificationListenerService.java +++ b/core/java/android/service/notification/NotificationListenerService.java @@ -256,6 +256,8 @@ public abstract class NotificationListenerService extends Service { public static final int REASON_CHANNEL_REMOVED = 20; /** Notification was canceled due to the app's storage being cleared */ 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; /** * @hide @@ -279,7 +281,10 @@ public abstract class NotificationListenerService extends Service { REASON_UNAUTOBUNDLED, REASON_CHANNEL_BANNED, REASON_SNOOZED, - REASON_TIMEOUT + REASON_TIMEOUT, + REASON_CHANNEL_REMOVED, + REASON_CLEAR_DATA, + REASON_ASSISTANT_CANCEL, }) public @interface NotificationCancelReason{}; |
