From 27d51c89fcf8033f0624561db02dd4cab680bfcd Mon Sep 17 00:00:00 2001 From: Danning Chen Date: Wed, 6 Jan 2021 10:30:47 -0800 Subject: [PATCH] Add a semantic action IntDef in Notification for marking a conversation as a priority Test: build the framework Change-Id: Ieb5e782303b6884eb1b0e5bd0bbc811d82a83537 Bug: 163614153 --- core/api/system-current.txt | 4 ++++ core/java/android/app/Notification.java | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 7d82f43af975d..51ddf83c65184 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -650,6 +650,10 @@ package android.app { field public static final int FLAG_AUTOGROUP_SUMMARY = 1024; // 0x400 } + public static class Notification.Action implements android.os.Parcelable { + field public static final int SEMANTIC_ACTION_MARK_CONVERSATION_AS_PRIORITY = 11; // 0xb + } + public static final class Notification.TvExtender implements android.app.Notification.Extender { ctor public Notification.TvExtender(); ctor public Notification.TvExtender(android.app.Notification); diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index a886beddf64c8..91757479ff908 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -1520,6 +1520,14 @@ public class Notification implements Parcelable */ public static final int SEMANTIC_ACTION_CALL = 10; + /** + * {@code SemanticAction}: Mark the conversation associated with the notification as a + * priority. Note that this is only for use by the notification assistant services. + * @hide + */ + @SystemApi + public static final int SEMANTIC_ACTION_MARK_CONVERSATION_AS_PRIORITY = 11; + private final Bundle mExtras; @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) private Icon mIcon; @@ -2230,7 +2238,8 @@ public class Notification implements Parcelable SEMANTIC_ACTION_UNMUTE, SEMANTIC_ACTION_THUMBS_UP, SEMANTIC_ACTION_THUMBS_DOWN, - SEMANTIC_ACTION_CALL + SEMANTIC_ACTION_CALL, + SEMANTIC_ACTION_MARK_CONVERSATION_AS_PRIORITY }) @Retention(RetentionPolicy.SOURCE) public @interface SemanticAction {}