Loading api/current.txt +0 −5 Original line number Diff line number Diff line Loading @@ -4781,8 +4781,6 @@ package android.app { method public android.app.Notification clone(); method public int describeContents(); method public java.lang.String getGroup(); method public android.graphics.drawable.Icon getLargeIcon(); method public android.graphics.drawable.Icon getSmallIcon(); 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); Loading Loading @@ -4927,7 +4925,6 @@ package android.app { ctor public Notification.BigPictureStyle(); ctor public Notification.BigPictureStyle(android.app.Notification.Builder); method public android.app.Notification.BigPictureStyle bigLargeIcon(android.graphics.Bitmap); method public android.app.Notification.BigPictureStyle bigLargeIcon(android.graphics.drawable.Icon); method public android.app.Notification.BigPictureStyle bigPicture(android.graphics.Bitmap); method public android.app.Notification.BigPictureStyle setBigContentTitle(java.lang.CharSequence); method public android.app.Notification.BigPictureStyle setSummaryText(java.lang.CharSequence); Loading Loading @@ -4966,7 +4963,6 @@ package android.app { method public android.app.Notification.Builder setGroup(java.lang.String); method public android.app.Notification.Builder setGroupSummary(boolean); method public android.app.Notification.Builder setLargeIcon(android.graphics.Bitmap); method public android.app.Notification.Builder setLargeIcon(android.graphics.drawable.Icon); method public android.app.Notification.Builder setLights(int, int, int); method public android.app.Notification.Builder setLocalOnly(boolean); method public android.app.Notification.Builder setNumber(int); Loading @@ -4978,7 +4974,6 @@ package android.app { method public android.app.Notification.Builder setShowWhen(boolean); method public android.app.Notification.Builder setSmallIcon(int); method public android.app.Notification.Builder setSmallIcon(int, int); method public android.app.Notification.Builder setSmallIcon(android.graphics.drawable.Icon); method public android.app.Notification.Builder setSortKey(java.lang.String); method public android.app.Notification.Builder setSound(android.net.Uri); method public deprecated android.app.Notification.Builder setSound(android.net.Uri, int); api/system-current.txt +0 −5 Original line number Diff line number Diff line Loading @@ -4875,8 +4875,6 @@ package android.app { method public android.app.Notification clone(); method public int describeContents(); method public java.lang.String getGroup(); method public android.graphics.drawable.Icon getLargeIcon(); method public android.graphics.drawable.Icon getSmallIcon(); 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); Loading Loading @@ -5021,7 +5019,6 @@ package android.app { ctor public Notification.BigPictureStyle(); ctor public Notification.BigPictureStyle(android.app.Notification.Builder); method public android.app.Notification.BigPictureStyle bigLargeIcon(android.graphics.Bitmap); method public android.app.Notification.BigPictureStyle bigLargeIcon(android.graphics.drawable.Icon); method public android.app.Notification.BigPictureStyle bigPicture(android.graphics.Bitmap); method public android.app.Notification.BigPictureStyle setBigContentTitle(java.lang.CharSequence); method public android.app.Notification.BigPictureStyle setSummaryText(java.lang.CharSequence); Loading Loading @@ -5060,7 +5057,6 @@ package android.app { method public android.app.Notification.Builder setGroup(java.lang.String); method public android.app.Notification.Builder setGroupSummary(boolean); method public android.app.Notification.Builder setLargeIcon(android.graphics.Bitmap); method public android.app.Notification.Builder setLargeIcon(android.graphics.drawable.Icon); method public android.app.Notification.Builder setLights(int, int, int); method public android.app.Notification.Builder setLocalOnly(boolean); method public android.app.Notification.Builder setNumber(int); Loading @@ -5072,7 +5068,6 @@ package android.app { method public android.app.Notification.Builder setShowWhen(boolean); method public android.app.Notification.Builder setSmallIcon(int); method public android.app.Notification.Builder setSmallIcon(int, int); method public android.app.Notification.Builder setSmallIcon(android.graphics.drawable.Icon); method public android.app.Notification.Builder setSortKey(java.lang.String); method public android.app.Notification.Builder setSound(android.net.Uri); method public deprecated android.app.Notification.Builder setSound(android.net.Uri, int); core/java/android/app/Notification.java +38 −101 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.graphics.drawable.Icon; import android.media.AudioAttributes; import android.media.AudioManager; import android.media.session.MediaSession; Loading Loading @@ -886,9 +885,6 @@ public class Notification implements Parcelable */ public static final int HEADS_UP_REQUESTED = 2; private Icon mSmallIcon; private Icon mLargeIcon; /** * Structure to encapsulate a named action that can be shown as part of this notification. * It must include an icon, a label, and a {@link PendingIntent} to be fired when the action is Loading Loading @@ -1366,7 +1362,7 @@ public class Notification implements Parcelable int version = parcel.readInt(); when = parcel.readLong(); mSmallIcon = Icon.CREATOR.createFromParcel(parcel); icon = parcel.readInt(); number = parcel.readInt(); if (parcel.readInt() != 0) { contentIntent = PendingIntent.CREATOR.createFromParcel(parcel); Loading @@ -1384,7 +1380,7 @@ public class Notification implements Parcelable contentView = RemoteViews.CREATOR.createFromParcel(parcel); } if (parcel.readInt() != 0) { mLargeIcon = Icon.CREATOR.createFromParcel(parcel); largeIcon = Bitmap.CREATOR.createFromParcel(parcel); } defaults = parcel.readInt(); flags = parcel.readInt(); Loading Loading @@ -1449,7 +1445,7 @@ public class Notification implements Parcelable */ public void cloneInto(Notification that, boolean heavy) { that.when = this.when; that.mSmallIcon = this.mSmallIcon; that.icon = this.icon; that.number = this.number; // PendingIntents are global, so there's no reason (or way) to clone them. Loading @@ -1466,8 +1462,8 @@ public class Notification implements Parcelable if (heavy && this.contentView != null) { that.contentView = this.contentView.clone(); } if (heavy && this.mLargeIcon != null) { that.mLargeIcon = this.mLargeIcon; if (heavy && this.largeIcon != null) { that.largeIcon = Bitmap.createBitmap(this.largeIcon); } that.iconLevel = this.iconLevel; that.sound = this.sound; // android.net.Uri is immutable Loading Loading @@ -1548,7 +1544,7 @@ public class Notification implements Parcelable contentView = null; bigContentView = null; headsUpContentView = null; mLargeIcon = null; largeIcon = null; if (extras != null) { extras.remove(Notification.EXTRA_LARGE_ICON); extras.remove(Notification.EXTRA_LARGE_ICON_BIG); Loading Loading @@ -1590,7 +1586,7 @@ public class Notification implements Parcelable parcel.writeInt(1); parcel.writeLong(when); mSmallIcon.writeToParcel(parcel, 0); parcel.writeInt(icon); parcel.writeInt(number); if (contentIntent != null) { parcel.writeInt(1); Loading Loading @@ -1622,9 +1618,9 @@ public class Notification implements Parcelable } else { parcel.writeInt(0); } if (mLargeIcon != null) { if (largeIcon != null) { parcel.writeInt(1); mLargeIcon.writeToParcel(parcel, 0); largeIcon.writeToParcel(parcel, 0); } else { parcel.writeInt(0); } Loading Loading @@ -1868,27 +1864,6 @@ public class Notification implements Parcelable } } /** * The small icon representing this notification in the status bar and content view. * * @return the small icon representing this notification. * * @see Builder#getSmallIcon() * @see Builder#setSmallIcon(Icon) */ public Icon getSmallIcon() { return mSmallIcon; } /** * The large icon shown in this notification's content view. * @see Builder#getLargeIcon() * @see Builder#setLargeIcon(Icon) */ public Icon getLargeIcon() { return mLargeIcon; } /** * @hide */ Loading Loading @@ -1991,7 +1966,7 @@ public class Notification implements Parcelable private Context mContext; private long mWhen; private Icon mSmallIcon, mLargeIcon; private int mSmallIcon; private int mSmallIconLevel; private int mNumber; private CharSequence mContentTitle; Loading @@ -2004,6 +1979,7 @@ public class Notification implements Parcelable private PendingIntent mFullScreenIntent; private CharSequence mTickerText; private RemoteViews mTickerView; private Bitmap mLargeIcon; private Uri mSound; private int mAudioStreamType; private AudioAttributes mAudioAttributes; Loading Loading @@ -2184,7 +2160,8 @@ public class Notification implements Parcelable * @see Notification#icon */ public Builder setSmallIcon(@DrawableRes int icon) { return setSmallIcon(Icon.createWithResource(mContext.getResources(), icon)); mSmallIcon = icon; return this; } /** Loading @@ -2199,20 +2176,8 @@ public class Notification implements Parcelable * @see Notification#iconLevel */ public Builder setSmallIcon(@DrawableRes int icon, int level) { mSmallIconLevel = level; return setSmallIcon(icon); } /** * Set the small icon, which will be used to represent the notification in the * status bar and content view (unless overriden there by a * {@link #setLargeIcon(Bitmap) large icon}). * * @param icon An Icon object to use. * @see Notification#icon */ public Builder setSmallIcon(Icon icon) { mSmallIcon = icon; mSmallIconLevel = level; return this; } Loading Loading @@ -2359,24 +2324,14 @@ public class Notification implements Parcelable } /** * Add a large icon to the notification content view. * Add a large icon to the notification (and the ticker on some devices). * * In the platform template, this image will be shown on the left of the notification view * in place of the {@link #setSmallIcon(Icon) small icon} (which will be placed in a small * badge atop the large icon). */ public Builder setLargeIcon(Bitmap b) { return setLargeIcon(b != null ? Icon.createWithBitmap(b) : null); } /** * Add a large icon to the notification content view. * in place of the {@link #setSmallIcon(int) small icon} (which will move to the right side). * * In the platform template, this image will be shown on the left of the notification view * in place of the {@link #setSmallIcon(Icon) small icon} (which will be placed in a small * badge atop the large icon). * @see Notification#largeIcon */ public Builder setLargeIcon(Icon icon) { public Builder setLargeIcon(Bitmap icon) { mLargeIcon = icon; return this; } Loading Loading @@ -2885,13 +2840,13 @@ public class Notification implements Parcelable boolean contentTextInLine2 = false; if (mLargeIcon != null) { contentView.setImageViewIcon(R.id.icon, mLargeIcon); contentView.setImageViewBitmap(R.id.icon, mLargeIcon); processLargeLegacyIcon(mLargeIcon, contentView); contentView.setImageViewIcon(R.id.right_icon, mSmallIcon); contentView.setImageViewResource(R.id.right_icon, mSmallIcon); contentView.setViewVisibility(R.id.right_icon, View.VISIBLE); processSmallRightIcon(mSmallIcon, contentView); } else { // small icon at left contentView.setImageViewIcon(R.id.icon, mSmallIcon); contentView.setImageViewResource(R.id.icon, mSmallIcon); contentView.setViewVisibility(R.id.icon, View.VISIBLE); processSmallIconAsLarge(mSmallIcon, contentView); } Loading Loading @@ -3131,16 +3086,14 @@ public class Notification implements Parcelable /** * Apply any necessary background to smallIcons being used in the largeIcon spot. */ private void processSmallIconAsLarge(Icon largeIcon, RemoteViews contentView) { private void processSmallIconAsLarge(int largeIconId, RemoteViews contentView) { if (!isLegacy()) { contentView.setDrawableParameters(R.id.icon, false, -1, 0xFFFFFFFF, PorterDuff.Mode.SRC_ATOP, -1); applyLargeIconBackground(contentView); } else { if (mColorUtil.isGrayscaleIcon(mContext, largeIcon)) { applyLargeIconBackground(contentView); } if (!isLegacy() || mColorUtil.isGrayscaleIcon(mContext, largeIconId)) { applyLargeIconBackground(contentView); } } Loading @@ -3149,9 +3102,8 @@ public class Notification implements Parcelable * if it's grayscale). */ // TODO: also check bounds, transparency, that sort of thing. private void processLargeLegacyIcon(Icon largeIcon, RemoteViews contentView) { if (largeIcon != null && isLegacy() && mColorUtil.isGrayscaleIcon(mContext, largeIcon)) { private void processLargeLegacyIcon(Bitmap largeIcon, RemoteViews contentView) { if (isLegacy() && mColorUtil.isGrayscaleIcon(largeIcon)) { applyLargeIconBackground(contentView); } else { removeLargeIconBackground(contentView); Loading Loading @@ -3185,16 +3137,14 @@ public class Notification implements Parcelable /** * Recolor small icons when used in the R.id.right_icon slot. */ private void processSmallRightIcon(Icon smallIcon, RemoteViews contentView) { private void processSmallRightIcon(int smallIconDrawableId, RemoteViews contentView) { if (!isLegacy()) { contentView.setDrawableParameters(R.id.right_icon, false, -1, 0xFFFFFFFF, PorterDuff.Mode.SRC_ATOP, -1); } final boolean gray = isLegacy() && smallIcon.getType() == Icon.TYPE_RESOURCE && mColorUtil.isGrayscaleIcon(mContext, smallIcon.getResId()); if (!isLegacy() || gray) { if (!isLegacy() || mColorUtil.isGrayscaleIcon(mContext, smallIconDrawableId)) { contentView.setInt(R.id.right_icon, "setBackgroundResource", R.drawable.notification_icon_legacy_bg); Loading Loading @@ -3230,10 +3180,7 @@ public class Notification implements Parcelable public Notification buildUnstyled() { Notification n = new Notification(); n.when = mWhen; n.mSmallIcon = mSmallIcon; if (mSmallIcon.getType() == Icon.TYPE_RESOURCE) { n.icon = mSmallIcon.getResId(); } n.icon = mSmallIcon; n.iconLevel = mSmallIconLevel; n.number = mNumber; Loading @@ -3245,10 +3192,7 @@ public class Notification implements Parcelable n.fullScreenIntent = mFullScreenIntent; n.tickerText = mTickerText; n.tickerView = makeTickerView(); n.mLargeIcon = mLargeIcon; if (mLargeIcon != null && mLargeIcon.getType() == Icon.TYPE_BITMAP) { n.largeIcon = mLargeIcon.getBitmap(); } n.largeIcon = mLargeIcon; n.sound = mSound; n.audioStreamType = mAudioStreamType; n.audioAttributes = mAudioAttributes; Loading Loading @@ -3298,7 +3242,7 @@ public class Notification implements Parcelable extras.putCharSequence(EXTRA_TEXT, mContentText); extras.putCharSequence(EXTRA_SUB_TEXT, mSubText); extras.putCharSequence(EXTRA_INFO_TEXT, mContentInfo); extras.putParcelable(EXTRA_SMALL_ICON, mSmallIcon); extras.putInt(EXTRA_SMALL_ICON, mSmallIcon); extras.putInt(EXTRA_PROGRESS, mProgress); extras.putInt(EXTRA_PROGRESS_MAX, mProgressMax); extras.putBoolean(EXTRA_PROGRESS_INDETERMINATE, mProgressIndeterminate); Loading Loading @@ -3486,7 +3430,7 @@ public class Notification implements Parcelable // Notification fields. mWhen = n.when; mSmallIcon = n.mSmallIcon; mSmallIcon = n.icon; mSmallIconLevel = n.iconLevel; mNumber = n.number; Loading @@ -3497,7 +3441,7 @@ public class Notification implements Parcelable mFullScreenIntent = n.fullScreenIntent; mTickerText = n.tickerText; mTickerView = n.tickerView; mLargeIcon = n.mLargeIcon; mLargeIcon = n.largeIcon; mSound = n.sound; mAudioStreamType = n.audioStreamType; mAudioAttributes = n.audioAttributes; Loading Loading @@ -3528,7 +3472,7 @@ public class Notification implements Parcelable mContentText = extras.getCharSequence(EXTRA_TEXT); mSubText = extras.getCharSequence(EXTRA_SUB_TEXT); mContentInfo = extras.getCharSequence(EXTRA_INFO_TEXT); mSmallIcon = extras.getParcelable(EXTRA_SMALL_ICON); mSmallIcon = extras.getInt(EXTRA_SMALL_ICON); mProgress = extras.getInt(EXTRA_PROGRESS); mProgressMax = extras.getInt(EXTRA_PROGRESS_MAX); mProgressIndeterminate = extras.getBoolean(EXTRA_PROGRESS_INDETERMINATE); Loading Loading @@ -3820,7 +3764,7 @@ public class Notification implements Parcelable */ public static class BigPictureStyle extends Style { private Bitmap mPicture; private Icon mBigLargeIcon; private Bitmap mBigLargeIcon; private boolean mBigLargeIconSet = false; public BigPictureStyle() { Loading Loading @@ -3859,15 +3803,8 @@ public class Notification implements Parcelable * Override the large icon when the big notification is shown. */ public BigPictureStyle bigLargeIcon(Bitmap b) { return bigLargeIcon(b != null ? Icon.createWithBitmap(b) : null); } /** * Override the large icon when the big notification is shown. */ public BigPictureStyle bigLargeIcon(Icon icon) { mBigLargeIconSet = true; mBigLargeIcon = icon; mBigLargeIcon = b; return this; } Loading @@ -3878,7 +3815,7 @@ public class Notification implements Parcelable // 1. mBigLargeIconSet -> mBigLargeIcon (null or non-null) applies, overrides // mLargeIcon // 2. !mBigLargeIconSet -> mLargeIcon applies Icon oldLargeIcon = null; Bitmap oldLargeIcon = null; if (mBigLargeIconSet) { oldLargeIcon = mBuilder.mLargeIcon; mBuilder.mLargeIcon = mBigLargeIcon; Loading core/java/com/android/internal/statusbar/StatusBarIcon.java +12 −16 Original line number Diff line number Diff line Loading @@ -16,46 +16,40 @@ package com.android.internal.statusbar; import android.graphics.drawable.Icon; import android.os.Parcel; import android.os.Parcelable; import android.os.UserHandle; public class StatusBarIcon implements Parcelable { public String iconPackage; public UserHandle user; public Icon icon; public int iconId; public int iconLevel; public boolean visible = true; public int number; public CharSequence contentDescription; public StatusBarIcon(UserHandle user, Icon icon, int iconLevel, int number, public StatusBarIcon(String iconPackage, UserHandle user, int iconId, int iconLevel, int number, CharSequence contentDescription) { this.iconPackage = iconPackage; this.user = user; this.icon = icon; this.iconId = iconId; this.iconLevel = iconLevel; this.number = number; this.contentDescription = contentDescription; } public StatusBarIcon(String iconPackage, UserHandle user, int iconId, int iconLevel, int number, CharSequence contentDescription) { this(user, Icon.createWithResource(iconPackage, iconId), iconLevel, number, contentDescription); } @Override public String toString() { return "StatusBarIcon(icon=" + this.icon + " user=" + user.getIdentifier() return "StatusBarIcon(pkg=" + this.iconPackage + "user=" + user.getIdentifier() + " id=0x" + Integer.toHexString(this.iconId) + " level=" + this.iconLevel + " visible=" + visible + " num=" + this.number + " )"; } @Override public StatusBarIcon clone() { StatusBarIcon that = new StatusBarIcon(this.user, this.icon, StatusBarIcon that = new StatusBarIcon(this.iconPackage, this.user, this.iconId, this.iconLevel, this.number, this.contentDescription); that.visible = this.visible; return that; Loading @@ -69,8 +63,9 @@ public class StatusBarIcon implements Parcelable { } public void readFromParcel(Parcel in) { this.icon = (Icon) in.readParcelable(null); this.iconPackage = in.readString(); this.user = (UserHandle) in.readParcelable(null); this.iconId = in.readInt(); this.iconLevel = in.readInt(); this.visible = in.readInt() != 0; this.number = in.readInt(); Loading @@ -78,8 +73,9 @@ public class StatusBarIcon implements Parcelable { } public void writeToParcel(Parcel out, int flags) { out.writeParcelable(this.icon, 0); out.writeString(this.iconPackage); out.writeParcelable(this.user, 0); out.writeInt(this.iconId); out.writeInt(this.iconLevel); out.writeInt(this.visible ? 1 : 0); out.writeInt(this.number); Loading core/java/com/android/internal/util/NotificationColorUtil.java +0 −15 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import android.graphics.Color; import android.graphics.drawable.AnimationDrawable; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.Icon; import android.graphics.drawable.VectorDrawable; import android.text.SpannableStringBuilder; import android.text.Spanned; Loading Loading @@ -130,20 +129,6 @@ public class NotificationColorUtil { } } public boolean isGrayscaleIcon(Context context, Icon icon) { if (icon == null) { return false; } switch (icon.getType()) { case Icon.TYPE_BITMAP: return isGrayscaleIcon(icon.getBitmap()); case Icon.TYPE_RESOURCE: return isGrayscaleIcon(context, icon.getResId()); default: return false; } } /** * Checks whether a drawable with a resoure id is a small grayscale icon. * Grayscale here means "very close to a perfect gray"; icon means "no larger than 64dp". Loading Loading
api/current.txt +0 −5 Original line number Diff line number Diff line Loading @@ -4781,8 +4781,6 @@ package android.app { method public android.app.Notification clone(); method public int describeContents(); method public java.lang.String getGroup(); method public android.graphics.drawable.Icon getLargeIcon(); method public android.graphics.drawable.Icon getSmallIcon(); 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); Loading Loading @@ -4927,7 +4925,6 @@ package android.app { ctor public Notification.BigPictureStyle(); ctor public Notification.BigPictureStyle(android.app.Notification.Builder); method public android.app.Notification.BigPictureStyle bigLargeIcon(android.graphics.Bitmap); method public android.app.Notification.BigPictureStyle bigLargeIcon(android.graphics.drawable.Icon); method public android.app.Notification.BigPictureStyle bigPicture(android.graphics.Bitmap); method public android.app.Notification.BigPictureStyle setBigContentTitle(java.lang.CharSequence); method public android.app.Notification.BigPictureStyle setSummaryText(java.lang.CharSequence); Loading Loading @@ -4966,7 +4963,6 @@ package android.app { method public android.app.Notification.Builder setGroup(java.lang.String); method public android.app.Notification.Builder setGroupSummary(boolean); method public android.app.Notification.Builder setLargeIcon(android.graphics.Bitmap); method public android.app.Notification.Builder setLargeIcon(android.graphics.drawable.Icon); method public android.app.Notification.Builder setLights(int, int, int); method public android.app.Notification.Builder setLocalOnly(boolean); method public android.app.Notification.Builder setNumber(int); Loading @@ -4978,7 +4974,6 @@ package android.app { method public android.app.Notification.Builder setShowWhen(boolean); method public android.app.Notification.Builder setSmallIcon(int); method public android.app.Notification.Builder setSmallIcon(int, int); method public android.app.Notification.Builder setSmallIcon(android.graphics.drawable.Icon); method public android.app.Notification.Builder setSortKey(java.lang.String); method public android.app.Notification.Builder setSound(android.net.Uri); method public deprecated android.app.Notification.Builder setSound(android.net.Uri, int);
api/system-current.txt +0 −5 Original line number Diff line number Diff line Loading @@ -4875,8 +4875,6 @@ package android.app { method public android.app.Notification clone(); method public int describeContents(); method public java.lang.String getGroup(); method public android.graphics.drawable.Icon getLargeIcon(); method public android.graphics.drawable.Icon getSmallIcon(); 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); Loading Loading @@ -5021,7 +5019,6 @@ package android.app { ctor public Notification.BigPictureStyle(); ctor public Notification.BigPictureStyle(android.app.Notification.Builder); method public android.app.Notification.BigPictureStyle bigLargeIcon(android.graphics.Bitmap); method public android.app.Notification.BigPictureStyle bigLargeIcon(android.graphics.drawable.Icon); method public android.app.Notification.BigPictureStyle bigPicture(android.graphics.Bitmap); method public android.app.Notification.BigPictureStyle setBigContentTitle(java.lang.CharSequence); method public android.app.Notification.BigPictureStyle setSummaryText(java.lang.CharSequence); Loading Loading @@ -5060,7 +5057,6 @@ package android.app { method public android.app.Notification.Builder setGroup(java.lang.String); method public android.app.Notification.Builder setGroupSummary(boolean); method public android.app.Notification.Builder setLargeIcon(android.graphics.Bitmap); method public android.app.Notification.Builder setLargeIcon(android.graphics.drawable.Icon); method public android.app.Notification.Builder setLights(int, int, int); method public android.app.Notification.Builder setLocalOnly(boolean); method public android.app.Notification.Builder setNumber(int); Loading @@ -5072,7 +5068,6 @@ package android.app { method public android.app.Notification.Builder setShowWhen(boolean); method public android.app.Notification.Builder setSmallIcon(int); method public android.app.Notification.Builder setSmallIcon(int, int); method public android.app.Notification.Builder setSmallIcon(android.graphics.drawable.Icon); method public android.app.Notification.Builder setSortKey(java.lang.String); method public android.app.Notification.Builder setSound(android.net.Uri); method public deprecated android.app.Notification.Builder setSound(android.net.Uri, int);
core/java/android/app/Notification.java +38 −101 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.graphics.drawable.Icon; import android.media.AudioAttributes; import android.media.AudioManager; import android.media.session.MediaSession; Loading Loading @@ -886,9 +885,6 @@ public class Notification implements Parcelable */ public static final int HEADS_UP_REQUESTED = 2; private Icon mSmallIcon; private Icon mLargeIcon; /** * Structure to encapsulate a named action that can be shown as part of this notification. * It must include an icon, a label, and a {@link PendingIntent} to be fired when the action is Loading Loading @@ -1366,7 +1362,7 @@ public class Notification implements Parcelable int version = parcel.readInt(); when = parcel.readLong(); mSmallIcon = Icon.CREATOR.createFromParcel(parcel); icon = parcel.readInt(); number = parcel.readInt(); if (parcel.readInt() != 0) { contentIntent = PendingIntent.CREATOR.createFromParcel(parcel); Loading @@ -1384,7 +1380,7 @@ public class Notification implements Parcelable contentView = RemoteViews.CREATOR.createFromParcel(parcel); } if (parcel.readInt() != 0) { mLargeIcon = Icon.CREATOR.createFromParcel(parcel); largeIcon = Bitmap.CREATOR.createFromParcel(parcel); } defaults = parcel.readInt(); flags = parcel.readInt(); Loading Loading @@ -1449,7 +1445,7 @@ public class Notification implements Parcelable */ public void cloneInto(Notification that, boolean heavy) { that.when = this.when; that.mSmallIcon = this.mSmallIcon; that.icon = this.icon; that.number = this.number; // PendingIntents are global, so there's no reason (or way) to clone them. Loading @@ -1466,8 +1462,8 @@ public class Notification implements Parcelable if (heavy && this.contentView != null) { that.contentView = this.contentView.clone(); } if (heavy && this.mLargeIcon != null) { that.mLargeIcon = this.mLargeIcon; if (heavy && this.largeIcon != null) { that.largeIcon = Bitmap.createBitmap(this.largeIcon); } that.iconLevel = this.iconLevel; that.sound = this.sound; // android.net.Uri is immutable Loading Loading @@ -1548,7 +1544,7 @@ public class Notification implements Parcelable contentView = null; bigContentView = null; headsUpContentView = null; mLargeIcon = null; largeIcon = null; if (extras != null) { extras.remove(Notification.EXTRA_LARGE_ICON); extras.remove(Notification.EXTRA_LARGE_ICON_BIG); Loading Loading @@ -1590,7 +1586,7 @@ public class Notification implements Parcelable parcel.writeInt(1); parcel.writeLong(when); mSmallIcon.writeToParcel(parcel, 0); parcel.writeInt(icon); parcel.writeInt(number); if (contentIntent != null) { parcel.writeInt(1); Loading Loading @@ -1622,9 +1618,9 @@ public class Notification implements Parcelable } else { parcel.writeInt(0); } if (mLargeIcon != null) { if (largeIcon != null) { parcel.writeInt(1); mLargeIcon.writeToParcel(parcel, 0); largeIcon.writeToParcel(parcel, 0); } else { parcel.writeInt(0); } Loading Loading @@ -1868,27 +1864,6 @@ public class Notification implements Parcelable } } /** * The small icon representing this notification in the status bar and content view. * * @return the small icon representing this notification. * * @see Builder#getSmallIcon() * @see Builder#setSmallIcon(Icon) */ public Icon getSmallIcon() { return mSmallIcon; } /** * The large icon shown in this notification's content view. * @see Builder#getLargeIcon() * @see Builder#setLargeIcon(Icon) */ public Icon getLargeIcon() { return mLargeIcon; } /** * @hide */ Loading Loading @@ -1991,7 +1966,7 @@ public class Notification implements Parcelable private Context mContext; private long mWhen; private Icon mSmallIcon, mLargeIcon; private int mSmallIcon; private int mSmallIconLevel; private int mNumber; private CharSequence mContentTitle; Loading @@ -2004,6 +1979,7 @@ public class Notification implements Parcelable private PendingIntent mFullScreenIntent; private CharSequence mTickerText; private RemoteViews mTickerView; private Bitmap mLargeIcon; private Uri mSound; private int mAudioStreamType; private AudioAttributes mAudioAttributes; Loading Loading @@ -2184,7 +2160,8 @@ public class Notification implements Parcelable * @see Notification#icon */ public Builder setSmallIcon(@DrawableRes int icon) { return setSmallIcon(Icon.createWithResource(mContext.getResources(), icon)); mSmallIcon = icon; return this; } /** Loading @@ -2199,20 +2176,8 @@ public class Notification implements Parcelable * @see Notification#iconLevel */ public Builder setSmallIcon(@DrawableRes int icon, int level) { mSmallIconLevel = level; return setSmallIcon(icon); } /** * Set the small icon, which will be used to represent the notification in the * status bar and content view (unless overriden there by a * {@link #setLargeIcon(Bitmap) large icon}). * * @param icon An Icon object to use. * @see Notification#icon */ public Builder setSmallIcon(Icon icon) { mSmallIcon = icon; mSmallIconLevel = level; return this; } Loading Loading @@ -2359,24 +2324,14 @@ public class Notification implements Parcelable } /** * Add a large icon to the notification content view. * Add a large icon to the notification (and the ticker on some devices). * * In the platform template, this image will be shown on the left of the notification view * in place of the {@link #setSmallIcon(Icon) small icon} (which will be placed in a small * badge atop the large icon). */ public Builder setLargeIcon(Bitmap b) { return setLargeIcon(b != null ? Icon.createWithBitmap(b) : null); } /** * Add a large icon to the notification content view. * in place of the {@link #setSmallIcon(int) small icon} (which will move to the right side). * * In the platform template, this image will be shown on the left of the notification view * in place of the {@link #setSmallIcon(Icon) small icon} (which will be placed in a small * badge atop the large icon). * @see Notification#largeIcon */ public Builder setLargeIcon(Icon icon) { public Builder setLargeIcon(Bitmap icon) { mLargeIcon = icon; return this; } Loading Loading @@ -2885,13 +2840,13 @@ public class Notification implements Parcelable boolean contentTextInLine2 = false; if (mLargeIcon != null) { contentView.setImageViewIcon(R.id.icon, mLargeIcon); contentView.setImageViewBitmap(R.id.icon, mLargeIcon); processLargeLegacyIcon(mLargeIcon, contentView); contentView.setImageViewIcon(R.id.right_icon, mSmallIcon); contentView.setImageViewResource(R.id.right_icon, mSmallIcon); contentView.setViewVisibility(R.id.right_icon, View.VISIBLE); processSmallRightIcon(mSmallIcon, contentView); } else { // small icon at left contentView.setImageViewIcon(R.id.icon, mSmallIcon); contentView.setImageViewResource(R.id.icon, mSmallIcon); contentView.setViewVisibility(R.id.icon, View.VISIBLE); processSmallIconAsLarge(mSmallIcon, contentView); } Loading Loading @@ -3131,16 +3086,14 @@ public class Notification implements Parcelable /** * Apply any necessary background to smallIcons being used in the largeIcon spot. */ private void processSmallIconAsLarge(Icon largeIcon, RemoteViews contentView) { private void processSmallIconAsLarge(int largeIconId, RemoteViews contentView) { if (!isLegacy()) { contentView.setDrawableParameters(R.id.icon, false, -1, 0xFFFFFFFF, PorterDuff.Mode.SRC_ATOP, -1); applyLargeIconBackground(contentView); } else { if (mColorUtil.isGrayscaleIcon(mContext, largeIcon)) { applyLargeIconBackground(contentView); } if (!isLegacy() || mColorUtil.isGrayscaleIcon(mContext, largeIconId)) { applyLargeIconBackground(contentView); } } Loading @@ -3149,9 +3102,8 @@ public class Notification implements Parcelable * if it's grayscale). */ // TODO: also check bounds, transparency, that sort of thing. private void processLargeLegacyIcon(Icon largeIcon, RemoteViews contentView) { if (largeIcon != null && isLegacy() && mColorUtil.isGrayscaleIcon(mContext, largeIcon)) { private void processLargeLegacyIcon(Bitmap largeIcon, RemoteViews contentView) { if (isLegacy() && mColorUtil.isGrayscaleIcon(largeIcon)) { applyLargeIconBackground(contentView); } else { removeLargeIconBackground(contentView); Loading Loading @@ -3185,16 +3137,14 @@ public class Notification implements Parcelable /** * Recolor small icons when used in the R.id.right_icon slot. */ private void processSmallRightIcon(Icon smallIcon, RemoteViews contentView) { private void processSmallRightIcon(int smallIconDrawableId, RemoteViews contentView) { if (!isLegacy()) { contentView.setDrawableParameters(R.id.right_icon, false, -1, 0xFFFFFFFF, PorterDuff.Mode.SRC_ATOP, -1); } final boolean gray = isLegacy() && smallIcon.getType() == Icon.TYPE_RESOURCE && mColorUtil.isGrayscaleIcon(mContext, smallIcon.getResId()); if (!isLegacy() || gray) { if (!isLegacy() || mColorUtil.isGrayscaleIcon(mContext, smallIconDrawableId)) { contentView.setInt(R.id.right_icon, "setBackgroundResource", R.drawable.notification_icon_legacy_bg); Loading Loading @@ -3230,10 +3180,7 @@ public class Notification implements Parcelable public Notification buildUnstyled() { Notification n = new Notification(); n.when = mWhen; n.mSmallIcon = mSmallIcon; if (mSmallIcon.getType() == Icon.TYPE_RESOURCE) { n.icon = mSmallIcon.getResId(); } n.icon = mSmallIcon; n.iconLevel = mSmallIconLevel; n.number = mNumber; Loading @@ -3245,10 +3192,7 @@ public class Notification implements Parcelable n.fullScreenIntent = mFullScreenIntent; n.tickerText = mTickerText; n.tickerView = makeTickerView(); n.mLargeIcon = mLargeIcon; if (mLargeIcon != null && mLargeIcon.getType() == Icon.TYPE_BITMAP) { n.largeIcon = mLargeIcon.getBitmap(); } n.largeIcon = mLargeIcon; n.sound = mSound; n.audioStreamType = mAudioStreamType; n.audioAttributes = mAudioAttributes; Loading Loading @@ -3298,7 +3242,7 @@ public class Notification implements Parcelable extras.putCharSequence(EXTRA_TEXT, mContentText); extras.putCharSequence(EXTRA_SUB_TEXT, mSubText); extras.putCharSequence(EXTRA_INFO_TEXT, mContentInfo); extras.putParcelable(EXTRA_SMALL_ICON, mSmallIcon); extras.putInt(EXTRA_SMALL_ICON, mSmallIcon); extras.putInt(EXTRA_PROGRESS, mProgress); extras.putInt(EXTRA_PROGRESS_MAX, mProgressMax); extras.putBoolean(EXTRA_PROGRESS_INDETERMINATE, mProgressIndeterminate); Loading Loading @@ -3486,7 +3430,7 @@ public class Notification implements Parcelable // Notification fields. mWhen = n.when; mSmallIcon = n.mSmallIcon; mSmallIcon = n.icon; mSmallIconLevel = n.iconLevel; mNumber = n.number; Loading @@ -3497,7 +3441,7 @@ public class Notification implements Parcelable mFullScreenIntent = n.fullScreenIntent; mTickerText = n.tickerText; mTickerView = n.tickerView; mLargeIcon = n.mLargeIcon; mLargeIcon = n.largeIcon; mSound = n.sound; mAudioStreamType = n.audioStreamType; mAudioAttributes = n.audioAttributes; Loading Loading @@ -3528,7 +3472,7 @@ public class Notification implements Parcelable mContentText = extras.getCharSequence(EXTRA_TEXT); mSubText = extras.getCharSequence(EXTRA_SUB_TEXT); mContentInfo = extras.getCharSequence(EXTRA_INFO_TEXT); mSmallIcon = extras.getParcelable(EXTRA_SMALL_ICON); mSmallIcon = extras.getInt(EXTRA_SMALL_ICON); mProgress = extras.getInt(EXTRA_PROGRESS); mProgressMax = extras.getInt(EXTRA_PROGRESS_MAX); mProgressIndeterminate = extras.getBoolean(EXTRA_PROGRESS_INDETERMINATE); Loading Loading @@ -3820,7 +3764,7 @@ public class Notification implements Parcelable */ public static class BigPictureStyle extends Style { private Bitmap mPicture; private Icon mBigLargeIcon; private Bitmap mBigLargeIcon; private boolean mBigLargeIconSet = false; public BigPictureStyle() { Loading Loading @@ -3859,15 +3803,8 @@ public class Notification implements Parcelable * Override the large icon when the big notification is shown. */ public BigPictureStyle bigLargeIcon(Bitmap b) { return bigLargeIcon(b != null ? Icon.createWithBitmap(b) : null); } /** * Override the large icon when the big notification is shown. */ public BigPictureStyle bigLargeIcon(Icon icon) { mBigLargeIconSet = true; mBigLargeIcon = icon; mBigLargeIcon = b; return this; } Loading @@ -3878,7 +3815,7 @@ public class Notification implements Parcelable // 1. mBigLargeIconSet -> mBigLargeIcon (null or non-null) applies, overrides // mLargeIcon // 2. !mBigLargeIconSet -> mLargeIcon applies Icon oldLargeIcon = null; Bitmap oldLargeIcon = null; if (mBigLargeIconSet) { oldLargeIcon = mBuilder.mLargeIcon; mBuilder.mLargeIcon = mBigLargeIcon; Loading
core/java/com/android/internal/statusbar/StatusBarIcon.java +12 −16 Original line number Diff line number Diff line Loading @@ -16,46 +16,40 @@ package com.android.internal.statusbar; import android.graphics.drawable.Icon; import android.os.Parcel; import android.os.Parcelable; import android.os.UserHandle; public class StatusBarIcon implements Parcelable { public String iconPackage; public UserHandle user; public Icon icon; public int iconId; public int iconLevel; public boolean visible = true; public int number; public CharSequence contentDescription; public StatusBarIcon(UserHandle user, Icon icon, int iconLevel, int number, public StatusBarIcon(String iconPackage, UserHandle user, int iconId, int iconLevel, int number, CharSequence contentDescription) { this.iconPackage = iconPackage; this.user = user; this.icon = icon; this.iconId = iconId; this.iconLevel = iconLevel; this.number = number; this.contentDescription = contentDescription; } public StatusBarIcon(String iconPackage, UserHandle user, int iconId, int iconLevel, int number, CharSequence contentDescription) { this(user, Icon.createWithResource(iconPackage, iconId), iconLevel, number, contentDescription); } @Override public String toString() { return "StatusBarIcon(icon=" + this.icon + " user=" + user.getIdentifier() return "StatusBarIcon(pkg=" + this.iconPackage + "user=" + user.getIdentifier() + " id=0x" + Integer.toHexString(this.iconId) + " level=" + this.iconLevel + " visible=" + visible + " num=" + this.number + " )"; } @Override public StatusBarIcon clone() { StatusBarIcon that = new StatusBarIcon(this.user, this.icon, StatusBarIcon that = new StatusBarIcon(this.iconPackage, this.user, this.iconId, this.iconLevel, this.number, this.contentDescription); that.visible = this.visible; return that; Loading @@ -69,8 +63,9 @@ public class StatusBarIcon implements Parcelable { } public void readFromParcel(Parcel in) { this.icon = (Icon) in.readParcelable(null); this.iconPackage = in.readString(); this.user = (UserHandle) in.readParcelable(null); this.iconId = in.readInt(); this.iconLevel = in.readInt(); this.visible = in.readInt() != 0; this.number = in.readInt(); Loading @@ -78,8 +73,9 @@ public class StatusBarIcon implements Parcelable { } public void writeToParcel(Parcel out, int flags) { out.writeParcelable(this.icon, 0); out.writeString(this.iconPackage); out.writeParcelable(this.user, 0); out.writeInt(this.iconId); out.writeInt(this.iconLevel); out.writeInt(this.visible ? 1 : 0); out.writeInt(this.number); Loading
core/java/com/android/internal/util/NotificationColorUtil.java +0 −15 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import android.graphics.Color; import android.graphics.drawable.AnimationDrawable; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.Icon; import android.graphics.drawable.VectorDrawable; import android.text.SpannableStringBuilder; import android.text.Spanned; Loading Loading @@ -130,20 +129,6 @@ public class NotificationColorUtil { } } public boolean isGrayscaleIcon(Context context, Icon icon) { if (icon == null) { return false; } switch (icon.getType()) { case Icon.TYPE_BITMAP: return isGrayscaleIcon(icon.getBitmap()); case Icon.TYPE_RESOURCE: return isGrayscaleIcon(context, icon.getResId()); default: return false; } } /** * Checks whether a drawable with a resoure id is a small grayscale icon. * Grayscale here means "very close to a perfect gray"; icon means "no larger than 64dp". Loading