summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Geoffrey Pitsch <gpitsch@google.com> 2017-01-26 14:15:13 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-01-26 14:15:16 +0000
commit60eef134af95b6fe17ec272f9bc123c221b9d42e (patch)
tree0391873c3054469adce5c3148f6f13080b13b20b
parent132dffbc83b2dd91218a8e82a4df9e4d2da128ac (diff)
parent5caa276305e3f6807959cbc938c42048c74153bc (diff)
Merge "New constructor for Notification.Builder takes a channelId."
-rw-r--r--api/current.txt3
-rw-r--r--api/system-current.txt3
-rw-r--r--api/test-current.txt3
-rw-r--r--core/java/android/app/Notification.java16
4 files changed, 21 insertions, 4 deletions
diff --git a/api/current.txt b/api/current.txt
index 829df43d95a4..e50a72b1c7b8 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -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);
diff --git a/api/system-current.txt b/api/system-current.txt
index 84efdf7fbd7c..d1ecf956ffe9 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -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);
diff --git a/api/test-current.txt b/api/test-current.txt
index 28b9af1c6ff0..556bd4179f81 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -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);
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 34d2039988e6..7bdf4cc15852 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -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);
}
/**