Merge "New constructor for Notification.Builder takes a channelId."

This commit is contained in:
Geoffrey Pitsch
2017-01-26 14:15:13 +00:00
committed by Android (Google) Code Review
4 changed files with 21 additions and 4 deletions

View File

@@ -5197,7 +5197,8 @@ package android.app {
}
public static class Notification.Builder {
ctor public Notification.Builder(android.content.Context);
ctor public Notification.Builder(android.content.Context, java.lang.String);
ctor public deprecated Notification.Builder(android.content.Context);
method public deprecated android.app.Notification.Builder addAction(int, java.lang.CharSequence, android.app.PendingIntent);
method public android.app.Notification.Builder addAction(android.app.Notification.Action);
method public android.app.Notification.Builder addExtras(android.os.Bundle);

View File

@@ -5360,7 +5360,8 @@ package android.app {
}
public static class Notification.Builder {
ctor public Notification.Builder(android.content.Context);
ctor public Notification.Builder(android.content.Context, java.lang.String);
ctor public deprecated Notification.Builder(android.content.Context);
method public deprecated android.app.Notification.Builder addAction(int, java.lang.CharSequence, android.app.PendingIntent);
method public android.app.Notification.Builder addAction(android.app.Notification.Action);
method public android.app.Notification.Builder addExtras(android.os.Bundle);

View File

@@ -5207,7 +5207,8 @@ package android.app {
}
public static class Notification.Builder {
ctor public Notification.Builder(android.content.Context);
ctor public Notification.Builder(android.content.Context, java.lang.String);
ctor public deprecated Notification.Builder(android.content.Context);
method public deprecated android.app.Notification.Builder addAction(int, java.lang.CharSequence, android.app.PendingIntent);
method public android.app.Notification.Builder addAction(android.app.Notification.Action);
method public android.app.Notification.Builder addExtras(android.os.Bundle);

View File

@@ -2486,9 +2486,23 @@ public class Notification implements Parcelable
* A {@link Context} that will be used by the Builder to construct the
* RemoteViews. The Context will not be held past the lifetime of this Builder
* object.
* @param channelId
* The constructed Notification will be posted on this
* {@link NotificationChannel}. To use a NotificationChannel, it must first be
* created using {@link NotificationManager#createNotificationChannel}.
*/
public Builder(Context context, String channelId) {
this(context, (Notification) null);
mN.mChannelId = channelId;
}
/**
* @deprecated use {@link Notification.Builder#Notification.Builder(Context, String)}
* instead. All posted Notifications must specify a NotificationChannel Id.
*/
@Deprecated
public Builder(Context context) {
this(context, null);
this(context, (Notification) null);
}
/**