Loading api/current.txt +2 −0 Original line number Original line Diff line number Diff line Loading @@ -4293,7 +4293,9 @@ package android.app { public static class Notification.Builder { public static class Notification.Builder { ctor public Notification.Builder(android.content.Context); ctor public Notification.Builder(android.content.Context); method public android.app.Notification.Builder addAction(int, java.lang.CharSequence, android.app.PendingIntent); method public android.app.Notification.Builder addAction(int, java.lang.CharSequence, android.app.PendingIntent); method public android.app.Notification.Builder addExtras(android.os.Bundle); method public android.app.Notification build(); method public android.app.Notification build(); method public android.os.Bundle getExtras(); method public deprecated android.app.Notification getNotification(); method public deprecated android.app.Notification getNotification(); method public android.app.Notification.Builder setAutoCancel(boolean); method public android.app.Notification.Builder setAutoCancel(boolean); method public android.app.Notification.Builder setContent(android.widget.RemoteViews); method public android.app.Notification.Builder setContent(android.widget.RemoteViews); core/java/android/app/Notification.java +40 −4 Original line number Original line Diff line number Diff line Loading @@ -1680,12 +1680,31 @@ public class Notification implements Parcelable } } /** /** * Add metadata to this notification. * Merge additional metadata into this notification. * * * A reference to the Bundle is held for the lifetime of this Builder, and the Bundle's * <p>Values within the Bundle will replace existing extras values in this Builder. * * @see Notification#extras */ public Builder addExtras(Bundle bag) { if (mExtras == null) { mExtras = new Bundle(bag); } else { mExtras.putAll(bag); } return this; } /** * Set metadata for this notification. * * <p>A reference to the Bundle is held for the lifetime of this Builder, and the Bundle's * current contents are copied into the Notification each time {@link #build()} is * current contents are copied into the Notification each time {@link #build()} is * called. * called. * * * <p>Replaces any existing extras values with those from the provided Bundle. * Use {@link #addExtras} to merge in metadata instead. * * @see Notification#extras * @see Notification#extras */ */ public Builder setExtras(Bundle bag) { public Builder setExtras(Bundle bag) { Loading @@ -1693,6 +1712,23 @@ public class Notification implements Parcelable return this; return this; } } /** * Get the current metadata Bundle used by this notification Builder. * * <p>The returned Bundle is shared with this Builder. * * <p>The current contents of this Bundle are copied into the Notification each time * {@link #build()} is called. * * @see Notification#extras */ public Bundle getExtras() { if (mExtras == null) { mExtras = new Bundle(); } return mExtras; } /** /** * Add an action to this notification. Actions are typically displayed by * Add an action to this notification. Actions are typically displayed by * the system as a button adjacent to the notification content. * the system as a button adjacent to the notification content. Loading Loading @@ -1989,7 +2025,7 @@ public class Notification implements Parcelable * this Notification object. * this Notification object. * @hide * @hide */ */ public void addExtras(Bundle extras) { public void populateExtras(Bundle extras) { // Store original information used in the construction of this object // Store original information used in the construction of this object extras.putCharSequence(EXTRA_TITLE, mContentTitle); extras.putCharSequence(EXTRA_TITLE, mContentTitle); extras.putCharSequence(EXTRA_TEXT, mContentText); extras.putCharSequence(EXTRA_TEXT, mContentText); Loading Loading @@ -2027,7 +2063,7 @@ public class Notification implements Parcelable n.extras = mExtras != null ? new Bundle(mExtras) : new Bundle(); n.extras = mExtras != null ? new Bundle(mExtras) : new Bundle(); addExtras(n.extras); populateExtras(n.extras); if (mStyle != null) { if (mStyle != null) { mStyle.addExtras(n.extras); mStyle.addExtras(n.extras); } } Loading Loading
api/current.txt +2 −0 Original line number Original line Diff line number Diff line Loading @@ -4293,7 +4293,9 @@ package android.app { public static class Notification.Builder { public static class Notification.Builder { ctor public Notification.Builder(android.content.Context); ctor public Notification.Builder(android.content.Context); method public android.app.Notification.Builder addAction(int, java.lang.CharSequence, android.app.PendingIntent); method public android.app.Notification.Builder addAction(int, java.lang.CharSequence, android.app.PendingIntent); method public android.app.Notification.Builder addExtras(android.os.Bundle); method public android.app.Notification build(); method public android.app.Notification build(); method public android.os.Bundle getExtras(); method public deprecated android.app.Notification getNotification(); method public deprecated android.app.Notification getNotification(); method public android.app.Notification.Builder setAutoCancel(boolean); method public android.app.Notification.Builder setAutoCancel(boolean); method public android.app.Notification.Builder setContent(android.widget.RemoteViews); method public android.app.Notification.Builder setContent(android.widget.RemoteViews);
core/java/android/app/Notification.java +40 −4 Original line number Original line Diff line number Diff line Loading @@ -1680,12 +1680,31 @@ public class Notification implements Parcelable } } /** /** * Add metadata to this notification. * Merge additional metadata into this notification. * * * A reference to the Bundle is held for the lifetime of this Builder, and the Bundle's * <p>Values within the Bundle will replace existing extras values in this Builder. * * @see Notification#extras */ public Builder addExtras(Bundle bag) { if (mExtras == null) { mExtras = new Bundle(bag); } else { mExtras.putAll(bag); } return this; } /** * Set metadata for this notification. * * <p>A reference to the Bundle is held for the lifetime of this Builder, and the Bundle's * current contents are copied into the Notification each time {@link #build()} is * current contents are copied into the Notification each time {@link #build()} is * called. * called. * * * <p>Replaces any existing extras values with those from the provided Bundle. * Use {@link #addExtras} to merge in metadata instead. * * @see Notification#extras * @see Notification#extras */ */ public Builder setExtras(Bundle bag) { public Builder setExtras(Bundle bag) { Loading @@ -1693,6 +1712,23 @@ public class Notification implements Parcelable return this; return this; } } /** * Get the current metadata Bundle used by this notification Builder. * * <p>The returned Bundle is shared with this Builder. * * <p>The current contents of this Bundle are copied into the Notification each time * {@link #build()} is called. * * @see Notification#extras */ public Bundle getExtras() { if (mExtras == null) { mExtras = new Bundle(); } return mExtras; } /** /** * Add an action to this notification. Actions are typically displayed by * Add an action to this notification. Actions are typically displayed by * the system as a button adjacent to the notification content. * the system as a button adjacent to the notification content. Loading Loading @@ -1989,7 +2025,7 @@ public class Notification implements Parcelable * this Notification object. * this Notification object. * @hide * @hide */ */ public void addExtras(Bundle extras) { public void populateExtras(Bundle extras) { // Store original information used in the construction of this object // Store original information used in the construction of this object extras.putCharSequence(EXTRA_TITLE, mContentTitle); extras.putCharSequence(EXTRA_TITLE, mContentTitle); extras.putCharSequence(EXTRA_TEXT, mContentText); extras.putCharSequence(EXTRA_TEXT, mContentText); Loading Loading @@ -2027,7 +2063,7 @@ public class Notification implements Parcelable n.extras = mExtras != null ? new Bundle(mExtras) : new Bundle(); n.extras = mExtras != null ? new Bundle(mExtras) : new Bundle(); addExtras(n.extras); populateExtras(n.extras); if (mStyle != null) { if (mStyle != null) { mStyle.addExtras(n.extras); mStyle.addExtras(n.extras); } } Loading