Merge "Address api feedback" into rvc-dev am: 7d5dfe8f44

Change-Id: I14495ee2346275fd3be71d38c0aed26a87425d70
This commit is contained in:
Automerger Merge Worker
2020-02-24 16:55:07 +00:00
3 changed files with 19 additions and 8 deletions

View File

@@ -5943,7 +5943,7 @@ package android.app {
method public boolean isImportantConversation(); method public boolean isImportantConversation();
method public void setAllowBubbles(boolean); method public void setAllowBubbles(boolean);
method public void setBypassDnd(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 setDescription(String);
method public void setGroup(String); method public void setGroup(String);
method public void setImportance(int); method public void setImportance(int);
@@ -5956,7 +5956,6 @@ package android.app {
method public boolean shouldShowLights(); method public boolean shouldShowLights();
method public boolean shouldVibrate(); method public boolean shouldVibrate();
method public void writeToParcel(android.os.Parcel, int); 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<android.app.NotificationChannel> CREATOR; field @NonNull public static final android.os.Parcelable.Creator<android.app.NotificationChannel> CREATOR;
field public static final String DEFAULT_CHANNEL_ID = "miscellaneous"; field public static final String DEFAULT_CHANNEL_ID = "miscellaneous";
} }

View File

@@ -15,6 +15,7 @@
*/ */
package android.app; package android.app;
import android.annotation.NonNull;
import android.annotation.Nullable; import android.annotation.Nullable;
import android.annotation.SystemApi; import android.annotation.SystemApi;
import android.annotation.TestApi; import android.annotation.TestApi;
@@ -63,6 +64,7 @@ public final class NotificationChannel implements Parcelable {
* string takes two arguments, in this order: the * string takes two arguments, in this order: the
* {@link #getId()} of the original notification channel, and the * {@link #getId()} of the original notification channel, and the
* {@link ShortcutInfo#getId() id} of the conversation. * {@link ShortcutInfo#getId() id} of the conversation.
* @hide
*/ */
public static final String CONVERSATION_CHANNEL_ID_FORMAT = "%1$s : %2$s"; 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 * Sets this channel as being converastion-centric. Different settings and functionality may be
* exposed for people-centric channels. * exposed for conversation-centric channels.
* *
* @param parentChannelId The {@link #getId()} id} of the generic channel that notifications of * @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. * 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 * @param conversationId The {@link ShortcutInfo#getId()} of the shortcut representing this
* channel's conversation. * channel's conversation.
*/ */
public void setConversationId(@Nullable String parentChannelId, public void setConversationId(@NonNull String parentChannelId,
@Nullable String conversationId) { @NonNull String conversationId) {
mParentId = parentChannelId; mParentId = parentChannelId;
mConversationId = conversationId; mConversationId = conversationId;
} }

View File

@@ -1573,6 +1573,15 @@ public class NotificationManager {
PRIORITY_CATEGORY_CONVERSATIONS, 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. */ /** Any sender is prioritized. */
public static final int PRIORITY_SENDERS_ANY = 0; public static final int PRIORITY_SENDERS_ANY = 0;
/** Saved contacts are prioritized. */ /** Saved contacts are prioritized. */
@@ -1816,8 +1825,9 @@ public class NotificationManager {
* @param suppressedVisualEffects which visual interruptions should be suppressed from * @param suppressedVisualEffects which visual interruptions should be suppressed from
* notifications that are filtered by DND. * notifications that are filtered by DND.
*/ */
public Policy(int priorityCategories, int priorityCallSenders, int priorityMessageSenders, public Policy(int priorityCategories, @PrioritySenders int priorityCallSenders,
int suppressedVisualEffects, int priorityConversationSenders) { @PrioritySenders int priorityMessageSenders,
int suppressedVisualEffects, @ConversationSenders int priorityConversationSenders) {
this(priorityCategories, priorityCallSenders, priorityMessageSenders, this(priorityCategories, priorityCallSenders, priorityMessageSenders,
suppressedVisualEffects, STATE_UNSET, priorityConversationSenders); suppressedVisualEffects, STATE_UNSET, priorityConversationSenders);
} }