summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api/current.txt4
-rw-r--r--core/java/android/app/Notification.java25
2 files changed, 11 insertions, 18 deletions
diff --git a/api/current.txt b/api/current.txt
index dfe50bbd1f79..89938d4b6612 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -5478,7 +5478,7 @@ package android.app {
method public android.graphics.drawable.Icon getIcon();
method public android.app.PendingIntent getIntent();
method public boolean getSuppressInitialNotification();
- method public CharSequence getTitle();
+ method @Deprecated public CharSequence getTitle();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<android.app.Notification.BubbleMetadata> CREATOR;
}
@@ -5492,7 +5492,7 @@ package android.app {
method public android.app.Notification.BubbleMetadata.Builder setIcon(android.graphics.drawable.Icon);
method public android.app.Notification.BubbleMetadata.Builder setIntent(android.app.PendingIntent);
method public android.app.Notification.BubbleMetadata.Builder setSuppressInitialNotification(boolean);
- method public android.app.Notification.BubbleMetadata.Builder setTitle(CharSequence);
+ method @Deprecated public android.app.Notification.BubbleMetadata.Builder setTitle(CharSequence);
}
public static class Notification.Builder {
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 0166f521999e..2e7093db92f0 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -8409,7 +8409,6 @@ public class Notification implements Parcelable
private PendingIntent mPendingIntent;
private PendingIntent mDeleteIntent;
- private CharSequence mTitle;
private Icon mIcon;
private int mDesiredHeight;
private int mFlags;
@@ -8438,9 +8437,8 @@ public class Notification implements Parcelable
private static final int FLAG_SUPPRESS_INITIAL_NOTIFICATION = 0x00000002;
private BubbleMetadata(PendingIntent expandIntent, PendingIntent deleteIntent,
- CharSequence title, Icon icon, int height) {
+ Icon icon, int height) {
mPendingIntent = expandIntent;
- mTitle = title;
mIcon = icon;
mDesiredHeight = height;
mDeleteIntent = deleteIntent;
@@ -8448,7 +8446,6 @@ public class Notification implements Parcelable
private BubbleMetadata(Parcel in) {
mPendingIntent = PendingIntent.CREATOR.createFromParcel(in);
- mTitle = in.readCharSequence();
mIcon = Icon.CREATOR.createFromParcel(in);
mDesiredHeight = in.readInt();
mFlags = in.readInt();
@@ -8474,11 +8471,13 @@ public class Notification implements Parcelable
/**
* @return the title that will appear along with the app content defined by
* {@link #getIntent()} for this bubble.
+ *
+ * @deprecated titles are no longer required or shown.
*/
+ @Deprecated
public CharSequence getTitle() {
- return mTitle;
+ return "";
}
-
/**
* @return the icon that will be displayed for this bubble when it is collapsed.
*/
@@ -8534,7 +8533,6 @@ public class Notification implements Parcelable
@Override
public void writeToParcel(Parcel out, int flags) {
mPendingIntent.writeToParcel(out, 0);
- out.writeCharSequence(mTitle);
mIcon.writeToParcel(out, 0);
out.writeInt(mDesiredHeight);
out.writeInt(mFlags);
@@ -8554,7 +8552,6 @@ public class Notification implements Parcelable
public static class Builder {
private PendingIntent mPendingIntent;
- private CharSequence mTitle;
private Icon mIcon;
private int mDesiredHeight;
private int mFlags;
@@ -8583,12 +8580,11 @@ public class Notification implements Parcelable
*
* <p>A title is required and should expect to fit on a single line and make sense when
* shown with the content defined by {@link #setIntent(PendingIntent)}.</p>
+ *
+ * @deprecated titles are no longer required or shown.
*/
+ @Deprecated
public BubbleMetadata.Builder setTitle(CharSequence title) {
- if (TextUtils.isEmpty(title)) {
- throw new IllegalArgumentException("Bubbles require non-null or empty title");
- }
- mTitle = title;
return this;
}
@@ -8667,13 +8663,10 @@ public class Notification implements Parcelable
if (mPendingIntent == null) {
throw new IllegalStateException("Must supply pending intent to bubble");
}
- if (TextUtils.isEmpty(mTitle)) {
- throw new IllegalStateException("Must supply a title for the bubble");
- }
if (mIcon == null) {
throw new IllegalStateException("Must supply an icon for the bubble");
}
- BubbleMetadata data = new BubbleMetadata(mPendingIntent, mDeleteIntent, mTitle,
+ BubbleMetadata data = new BubbleMetadata(mPendingIntent, mDeleteIntent,
mIcon, mDesiredHeight);
data.setFlags(mFlags);
return data;