diff --git a/api/current.txt b/api/current.txt index c8a7956075579..1227006dbe046 100644 --- a/api/current.txt +++ b/api/current.txt @@ -5943,7 +5943,7 @@ package android.app { method public boolean isImportantConversation(); method public void setAllowBubbles(boolean); method public void setBypassDnd(boolean); - method public void setConversationId(@Nullable String, @Nullable String); + method public void setConversationId(@NonNull String, @NonNull String); method public void setDescription(String); method public void setGroup(String); method public void setImportance(int); @@ -5956,7 +5956,6 @@ package android.app { method public boolean shouldShowLights(); method public boolean shouldVibrate(); method public void writeToParcel(android.os.Parcel, int); - field public static final String CONVERSATION_CHANNEL_ID_FORMAT = "%1$s : %2$s"; field @NonNull public static final android.os.Parcelable.Creator CREATOR; field public static final String DEFAULT_CHANNEL_ID = "miscellaneous"; } diff --git a/core/java/android/app/NotificationChannel.java b/core/java/android/app/NotificationChannel.java index 7212be82d1a94..3f2ec4487668a 100644 --- a/core/java/android/app/NotificationChannel.java +++ b/core/java/android/app/NotificationChannel.java @@ -15,6 +15,7 @@ */ package android.app; +import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; import android.annotation.TestApi; @@ -63,6 +64,7 @@ public final class NotificationChannel implements Parcelable { * string takes two arguments, in this order: the * {@link #getId()} of the original notification channel, and the * {@link ShortcutInfo#getId() id} of the conversation. + * @hide */ public static final String CONVERSATION_CHANNEL_ID_FORMAT = "%1$s : %2$s"; @@ -554,8 +556,8 @@ public final class NotificationChannel implements Parcelable { } /** - * Sets this channel as being person-centric. Different settings and functionality may be - * exposed for people-centric channels. + * Sets this channel as being converastion-centric. Different settings and functionality may be + * exposed for conversation-centric channels. * * @param parentChannelId The {@link #getId()} id} of the generic channel that notifications of * this type would be posted to in absence of a specific conversation id. @@ -564,8 +566,8 @@ public final class NotificationChannel implements Parcelable { * @param conversationId The {@link ShortcutInfo#getId()} of the shortcut representing this * channel's conversation. */ - public void setConversationId(@Nullable String parentChannelId, - @Nullable String conversationId) { + public void setConversationId(@NonNull String parentChannelId, + @NonNull String conversationId) { mParentId = parentChannelId; mConversationId = conversationId; } diff --git a/core/java/android/app/NotificationManager.java b/core/java/android/app/NotificationManager.java index 88edb05ba9683..cbbdf639d0369 100644 --- a/core/java/android/app/NotificationManager.java +++ b/core/java/android/app/NotificationManager.java @@ -1573,6 +1573,15 @@ public class NotificationManager { PRIORITY_CATEGORY_CONVERSATIONS, }; + /** @hide */ + @IntDef(prefix = { "PRIORITY_SENDERS_" }, value = { + PRIORITY_SENDERS_ANY, + PRIORITY_SENDERS_CONTACTS, + PRIORITY_SENDERS_STARRED, + }) + @Retention(RetentionPolicy.SOURCE) + public @interface PrioritySenders {} + /** Any sender is prioritized. */ public static final int PRIORITY_SENDERS_ANY = 0; /** Saved contacts are prioritized. */ @@ -1816,8 +1825,9 @@ public class NotificationManager { * @param suppressedVisualEffects which visual interruptions should be suppressed from * notifications that are filtered by DND. */ - public Policy(int priorityCategories, int priorityCallSenders, int priorityMessageSenders, - int suppressedVisualEffects, int priorityConversationSenders) { + public Policy(int priorityCategories, @PrioritySenders int priorityCallSenders, + @PrioritySenders int priorityMessageSenders, + int suppressedVisualEffects, @ConversationSenders int priorityConversationSenders) { this(priorityCategories, priorityCallSenders, priorityMessageSenders, suppressedVisualEffects, STATE_UNSET, priorityConversationSenders); }