diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index f7300aa1561ba..e1dc8bf7e499b 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -32,6 +32,7 @@ import android.media.AudioManager; import android.media.session.MediaSession; import android.net.Uri; import android.os.BadParcelableException; +import android.os.Build; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; @@ -1904,7 +1905,8 @@ public class Notification implements Parcelable mPriority = PRIORITY_DEFAULT; mPeople = new ArrayList(); - mColorUtil = NotificationColorUtil.getInstance(); + mColorUtil = context.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.L ? + NotificationColorUtil.getInstance() : null; } /** @@ -2610,7 +2612,7 @@ public class Notification implements Parcelable if (mLargeIcon != null) { contentView.setImageViewBitmap(R.id.icon, mLargeIcon); - processLargeIcon(mLargeIcon, contentView); + processLargeLegacyIcon(mLargeIcon, contentView); contentView.setImageViewResource(R.id.right_icon, mSmallIcon); contentView.setViewVisibility(R.id.right_icon, View.VISIBLE); processSmallRightIcon(mSmallIcon, contentView); @@ -2813,13 +2815,10 @@ public class Notification implements Parcelable } private void processLegacyAction(Action action, RemoteViews button) { - if (isLegacy()) { - if (mColorUtil.isGrayscale(mContext, action.icon)) { - button.setTextViewCompoundDrawablesRelativeColorFilter(R.id.action0, 0, - mContext.getResources().getColor( - R.color.notification_action_legacy_color_filter), - PorterDuff.Mode.MULTIPLY); - } + if (!isLegacy() || mColorUtil.isGrayscale(mContext, action.icon)) { + button.setTextViewCompoundDrawablesRelativeColorFilter(R.id.action0, 0, + mContext.getResources().getColor(R.color.notification_action_color_filter), + PorterDuff.Mode.MULTIPLY); } } @@ -2845,8 +2844,8 @@ public class Notification implements Parcelable * if it's grayscale). */ // TODO: also check bounds, transparency, that sort of thing. - private void processLargeIcon(Bitmap largeIcon, RemoteViews contentView) { - if (!isLegacy() || mColorUtil.isGrayscale(largeIcon)) { + private void processLargeLegacyIcon(Bitmap largeIcon, RemoteViews contentView) { + if (isLegacy() && mColorUtil.isGrayscale(largeIcon)) { applyLargeIconBackground(contentView); } else { removeLargeIconBackground(contentView); diff --git a/core/res/res/values/colors.xml b/core/res/res/values/colors.xml index 036046041aa60..4470fc3beb08d 100644 --- a/core/res/res/values/colors.xml +++ b/core/res/res/values/colors.xml @@ -130,7 +130,7 @@ #29000000 #ff9e9e9e - #ff555555 + @color/secondary_text_material_light #00000000 #FFFFFFFF diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 11d712ef906a0..1d58223f24887 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1718,7 +1718,7 @@ - +