Loading api/current.txt +6 −3 Original line number Diff line number Diff line Loading @@ -4559,6 +4559,7 @@ package android.app { method public java.lang.String getSortKey(); method public deprecated void setLatestEventInfo(android.content.Context, java.lang.CharSequence, java.lang.CharSequence, android.app.PendingIntent); method public void writeToParcel(android.os.Parcel, int); field public static final android.media.AudioAttributes AUDIO_ATTRIBUTES_DEFAULT; field public static final java.lang.String CATEGORY_ALARM = "alarm"; field public static final java.lang.String CATEGORY_CALL = "call"; field public static final java.lang.String CATEGORY_EMAIL = "email"; Loading Loading @@ -4615,12 +4616,13 @@ package android.app { field public static final int PRIORITY_LOW = -1; // 0xffffffff field public static final int PRIORITY_MAX = 2; // 0x2 field public static final int PRIORITY_MIN = -2; // 0xfffffffe field public static final int STREAM_DEFAULT = -1; // 0xffffffff field public static final deprecated int STREAM_DEFAULT = -1; // 0xffffffff field public static final int VISIBILITY_PRIVATE = 0; // 0x0 field public static final int VISIBILITY_PUBLIC = 1; // 0x1 field public static final int VISIBILITY_SECRET = -1; // 0xffffffff field public android.app.Notification.Action[] actions; field public int audioStreamType; field public android.media.AudioAttributes audioAttributes; field public deprecated int audioStreamType; field public android.widget.RemoteViews bigContentView; field public java.lang.String category; field public int color; Loading Loading @@ -4739,7 +4741,8 @@ package android.app { method public android.app.Notification.Builder setSmallIcon(int, int); method public android.app.Notification.Builder setSortKey(java.lang.String); method public android.app.Notification.Builder setSound(android.net.Uri); method public android.app.Notification.Builder setSound(android.net.Uri, int); method public deprecated android.app.Notification.Builder setSound(android.net.Uri, int); method public android.app.Notification.Builder setSound(android.net.Uri, android.media.AudioAttributes); method public android.app.Notification.Builder setStyle(android.app.Notification.Style); method public android.app.Notification.Builder setSubText(java.lang.CharSequence); method public android.app.Notification.Builder setTicker(java.lang.CharSequence); core/java/android/app/Notification.java +55 −3 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.media.AudioAttributes; import android.media.AudioManager; import android.media.session.MediaSession; import android.net.Uri; Loading Loading @@ -274,6 +275,8 @@ public class Notification implements Parcelable * Use this constant as the value for audioStreamType to request that * the default stream type for notifications be used. Currently the * default stream type is {@link AudioManager#STREAM_NOTIFICATION}. * * @deprecated Use {@link #audioAttributes} instead. */ public static final int STREAM_DEFAULT = -1; Loading @@ -281,9 +284,24 @@ public class Notification implements Parcelable * The audio stream type to use when playing the sound. * Should be one of the STREAM_ constants from * {@link android.media.AudioManager}. * * @deprecated Use {@link #audioAttributes} instead. */ public int audioStreamType = STREAM_DEFAULT; /** * The default value of {@link #audioAttributes}. */ public static final AudioAttributes AUDIO_ATTRIBUTES_DEFAULT = new AudioAttributes.Builder() .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) .setUsage(AudioAttributes.USAGE_NOTIFICATION) .build(); /** * The {@link AudioAttributes audio attributes} to use when playing the sound. */ public AudioAttributes audioAttributes = AUDIO_ATTRIBUTES_DEFAULT; /** * The pattern with which to vibrate. * Loading Loading @@ -1221,6 +1239,9 @@ public class Notification implements Parcelable } audioStreamType = parcel.readInt(); if (parcel.readInt() != 0) { audioAttributes = AudioAttributes.CREATOR.createFromParcel(parcel); } vibrate = parcel.createLongArray(); ledARGB = parcel.readInt(); ledOnMS = parcel.readInt(); Loading Loading @@ -1297,6 +1318,9 @@ public class Notification implements Parcelable that.iconLevel = this.iconLevel; that.sound = this.sound; // android.net.Uri is immutable that.audioStreamType = this.audioStreamType; if (this.audioAttributes != null) { that.audioAttributes = new AudioAttributes.Builder(this.audioAttributes).build(); } final long[] vibrate = this.vibrate; if (vibrate != null) { Loading Loading @@ -1454,6 +1478,14 @@ public class Notification implements Parcelable parcel.writeInt(0); } parcel.writeInt(audioStreamType); if (audioAttributes != null) { parcel.writeInt(1); audioAttributes.writeToParcel(parcel, 0); } else { parcel.writeInt(0); } parcel.writeLongArray(vibrate); parcel.writeInt(ledARGB); parcel.writeInt(ledOnMS); Loading Loading @@ -1715,6 +1747,7 @@ public class Notification implements Parcelable private Bitmap mLargeIcon; private Uri mSound; private int mAudioStreamType; private AudioAttributes mAudioAttributes; private long[] mVibrate; private int mLedArgb; private int mLedOnMs; Loading Loading @@ -1773,6 +1806,7 @@ public class Notification implements Parcelable // Set defaults to match the defaults of a Notification mWhen = System.currentTimeMillis(); mAudioStreamType = STREAM_DEFAULT; mAudioAttributes = AUDIO_ATTRIBUTES_DEFAULT; mPriority = PRIORITY_DEFAULT; mPeople = new ArrayList<String>(); Loading Loading @@ -2010,7 +2044,8 @@ public class Notification implements Parcelable /** * Set the sound to play. * * It will be played on the {@link #STREAM_DEFAULT default stream} for notifications. * It will be played using the {@link #AUDIO_ATTRIBUTES_DEFAULT default audio attributes} * for notifications. * * <p> * A notification that is noisy is more likely to be presented as a heads-up notification. Loading @@ -2020,7 +2055,7 @@ public class Notification implements Parcelable */ public Builder setSound(Uri sound) { mSound = sound; mAudioStreamType = STREAM_DEFAULT; mAudioAttributes = AUDIO_ATTRIBUTES_DEFAULT; return this; } Loading @@ -2032,7 +2067,7 @@ public class Notification implements Parcelable * <p> * A notification that is noisy is more likely to be presented as a heads-up notification. * </p> * * @deprecated use {@link #setSound(Uri, AudioAttributes)} instead. * @see Notification#sound */ public Builder setSound(Uri sound, int streamType) { Loading @@ -2041,6 +2076,22 @@ public class Notification implements Parcelable return this; } /** * Set the sound to play, along with specific {@link AudioAttributes audio attributes} to * use during playback. * * <p> * A notification that is noisy is more likely to be presented as a heads-up notification. * </p> * * @see Notification#sound */ public Builder setSound(Uri sound, AudioAttributes audioAttributes) { mSound = sound; mAudioAttributes = audioAttributes; return this; } /** * Set the vibration pattern to use. * Loading Loading @@ -2692,6 +2743,7 @@ public class Notification implements Parcelable n.largeIcon = mLargeIcon; n.sound = mSound; n.audioStreamType = mAudioStreamType; n.audioAttributes = mAudioAttributes; n.vibrate = mVibrate; n.ledARGB = mLedArgb; n.ledOnMS = mLedOnMs; Loading Loading
api/current.txt +6 −3 Original line number Diff line number Diff line Loading @@ -4559,6 +4559,7 @@ package android.app { method public java.lang.String getSortKey(); method public deprecated void setLatestEventInfo(android.content.Context, java.lang.CharSequence, java.lang.CharSequence, android.app.PendingIntent); method public void writeToParcel(android.os.Parcel, int); field public static final android.media.AudioAttributes AUDIO_ATTRIBUTES_DEFAULT; field public static final java.lang.String CATEGORY_ALARM = "alarm"; field public static final java.lang.String CATEGORY_CALL = "call"; field public static final java.lang.String CATEGORY_EMAIL = "email"; Loading Loading @@ -4615,12 +4616,13 @@ package android.app { field public static final int PRIORITY_LOW = -1; // 0xffffffff field public static final int PRIORITY_MAX = 2; // 0x2 field public static final int PRIORITY_MIN = -2; // 0xfffffffe field public static final int STREAM_DEFAULT = -1; // 0xffffffff field public static final deprecated int STREAM_DEFAULT = -1; // 0xffffffff field public static final int VISIBILITY_PRIVATE = 0; // 0x0 field public static final int VISIBILITY_PUBLIC = 1; // 0x1 field public static final int VISIBILITY_SECRET = -1; // 0xffffffff field public android.app.Notification.Action[] actions; field public int audioStreamType; field public android.media.AudioAttributes audioAttributes; field public deprecated int audioStreamType; field public android.widget.RemoteViews bigContentView; field public java.lang.String category; field public int color; Loading Loading @@ -4739,7 +4741,8 @@ package android.app { method public android.app.Notification.Builder setSmallIcon(int, int); method public android.app.Notification.Builder setSortKey(java.lang.String); method public android.app.Notification.Builder setSound(android.net.Uri); method public android.app.Notification.Builder setSound(android.net.Uri, int); method public deprecated android.app.Notification.Builder setSound(android.net.Uri, int); method public android.app.Notification.Builder setSound(android.net.Uri, android.media.AudioAttributes); method public android.app.Notification.Builder setStyle(android.app.Notification.Style); method public android.app.Notification.Builder setSubText(java.lang.CharSequence); method public android.app.Notification.Builder setTicker(java.lang.CharSequence);
core/java/android/app/Notification.java +55 −3 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.media.AudioAttributes; import android.media.AudioManager; import android.media.session.MediaSession; import android.net.Uri; Loading Loading @@ -274,6 +275,8 @@ public class Notification implements Parcelable * Use this constant as the value for audioStreamType to request that * the default stream type for notifications be used. Currently the * default stream type is {@link AudioManager#STREAM_NOTIFICATION}. * * @deprecated Use {@link #audioAttributes} instead. */ public static final int STREAM_DEFAULT = -1; Loading @@ -281,9 +284,24 @@ public class Notification implements Parcelable * The audio stream type to use when playing the sound. * Should be one of the STREAM_ constants from * {@link android.media.AudioManager}. * * @deprecated Use {@link #audioAttributes} instead. */ public int audioStreamType = STREAM_DEFAULT; /** * The default value of {@link #audioAttributes}. */ public static final AudioAttributes AUDIO_ATTRIBUTES_DEFAULT = new AudioAttributes.Builder() .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) .setUsage(AudioAttributes.USAGE_NOTIFICATION) .build(); /** * The {@link AudioAttributes audio attributes} to use when playing the sound. */ public AudioAttributes audioAttributes = AUDIO_ATTRIBUTES_DEFAULT; /** * The pattern with which to vibrate. * Loading Loading @@ -1221,6 +1239,9 @@ public class Notification implements Parcelable } audioStreamType = parcel.readInt(); if (parcel.readInt() != 0) { audioAttributes = AudioAttributes.CREATOR.createFromParcel(parcel); } vibrate = parcel.createLongArray(); ledARGB = parcel.readInt(); ledOnMS = parcel.readInt(); Loading Loading @@ -1297,6 +1318,9 @@ public class Notification implements Parcelable that.iconLevel = this.iconLevel; that.sound = this.sound; // android.net.Uri is immutable that.audioStreamType = this.audioStreamType; if (this.audioAttributes != null) { that.audioAttributes = new AudioAttributes.Builder(this.audioAttributes).build(); } final long[] vibrate = this.vibrate; if (vibrate != null) { Loading Loading @@ -1454,6 +1478,14 @@ public class Notification implements Parcelable parcel.writeInt(0); } parcel.writeInt(audioStreamType); if (audioAttributes != null) { parcel.writeInt(1); audioAttributes.writeToParcel(parcel, 0); } else { parcel.writeInt(0); } parcel.writeLongArray(vibrate); parcel.writeInt(ledARGB); parcel.writeInt(ledOnMS); Loading Loading @@ -1715,6 +1747,7 @@ public class Notification implements Parcelable private Bitmap mLargeIcon; private Uri mSound; private int mAudioStreamType; private AudioAttributes mAudioAttributes; private long[] mVibrate; private int mLedArgb; private int mLedOnMs; Loading Loading @@ -1773,6 +1806,7 @@ public class Notification implements Parcelable // Set defaults to match the defaults of a Notification mWhen = System.currentTimeMillis(); mAudioStreamType = STREAM_DEFAULT; mAudioAttributes = AUDIO_ATTRIBUTES_DEFAULT; mPriority = PRIORITY_DEFAULT; mPeople = new ArrayList<String>(); Loading Loading @@ -2010,7 +2044,8 @@ public class Notification implements Parcelable /** * Set the sound to play. * * It will be played on the {@link #STREAM_DEFAULT default stream} for notifications. * It will be played using the {@link #AUDIO_ATTRIBUTES_DEFAULT default audio attributes} * for notifications. * * <p> * A notification that is noisy is more likely to be presented as a heads-up notification. Loading @@ -2020,7 +2055,7 @@ public class Notification implements Parcelable */ public Builder setSound(Uri sound) { mSound = sound; mAudioStreamType = STREAM_DEFAULT; mAudioAttributes = AUDIO_ATTRIBUTES_DEFAULT; return this; } Loading @@ -2032,7 +2067,7 @@ public class Notification implements Parcelable * <p> * A notification that is noisy is more likely to be presented as a heads-up notification. * </p> * * @deprecated use {@link #setSound(Uri, AudioAttributes)} instead. * @see Notification#sound */ public Builder setSound(Uri sound, int streamType) { Loading @@ -2041,6 +2076,22 @@ public class Notification implements Parcelable return this; } /** * Set the sound to play, along with specific {@link AudioAttributes audio attributes} to * use during playback. * * <p> * A notification that is noisy is more likely to be presented as a heads-up notification. * </p> * * @see Notification#sound */ public Builder setSound(Uri sound, AudioAttributes audioAttributes) { mSound = sound; mAudioAttributes = audioAttributes; return this; } /** * Set the vibration pattern to use. * Loading Loading @@ -2692,6 +2743,7 @@ public class Notification implements Parcelable n.largeIcon = mLargeIcon; n.sound = mSound; n.audioStreamType = mAudioStreamType; n.audioAttributes = mAudioAttributes; n.vibrate = mVibrate; n.ledARGB = mLedArgb; n.ledOnMS = mLedOnMs; Loading