Loading core/java/android/app/Notification.java +10 −11 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -1904,7 +1905,8 @@ public class Notification implements Parcelable mPriority = PRIORITY_DEFAULT; mPeople = new ArrayList<String>(); mColorUtil = NotificationColorUtil.getInstance(); mColorUtil = context.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.L ? NotificationColorUtil.getInstance() : null; } /** Loading Loading @@ -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); Loading Loading @@ -2813,15 +2815,12 @@ public class Notification implements Parcelable } private void processLegacyAction(Action action, RemoteViews button) { if (isLegacy()) { if (mColorUtil.isGrayscale(mContext, action.icon)) { if (!isLegacy() || mColorUtil.isGrayscale(mContext, action.icon)) { button.setTextViewCompoundDrawablesRelativeColorFilter(R.id.action0, 0, mContext.getResources().getColor( R.color.notification_action_legacy_color_filter), mContext.getResources().getColor(R.color.notification_action_color_filter), PorterDuff.Mode.MULTIPLY); } } } private CharSequence processLegacyText(CharSequence charSequence) { if (isLegacy()) { Loading @@ -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); Loading core/res/res/values/colors.xml +1 −1 Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ <drawable name="notification_template_divider">#29000000</drawable> <color name="notification_icon_bg_color">#ff9e9e9e</color> <color name="notification_action_legacy_color_filter">#ff555555</color> <color name="notification_action_color_filter">@color/secondary_text_material_light</color> <color name="notification_media_action_bg">#00000000</color> <color name="notification_media_progress">#FFFFFFFF</color> Loading core/res/res/values/symbols.xml +1 −1 Original line number Diff line number Diff line Loading @@ -1718,7 +1718,7 @@ <java-symbol type="layout" name="notification_template_material_big_text" /> <java-symbol type="layout" name="notification_template_icon_group" /> <java-symbol type="layout" name="notification_material_media_action" /> <java-symbol type="color" name="notification_action_legacy_color_filter" /> <java-symbol type="color" name="notification_action_color_filter" /> <java-symbol type="color" name="notification_icon_bg_color" /> <java-symbol type="drawable" name="notification_icon_legacy_bg" /> <java-symbol type="drawable" name="notification_material_media_progress" /> Loading Loading
core/java/android/app/Notification.java +10 −11 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -1904,7 +1905,8 @@ public class Notification implements Parcelable mPriority = PRIORITY_DEFAULT; mPeople = new ArrayList<String>(); mColorUtil = NotificationColorUtil.getInstance(); mColorUtil = context.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.L ? NotificationColorUtil.getInstance() : null; } /** Loading Loading @@ -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); Loading Loading @@ -2813,15 +2815,12 @@ public class Notification implements Parcelable } private void processLegacyAction(Action action, RemoteViews button) { if (isLegacy()) { if (mColorUtil.isGrayscale(mContext, action.icon)) { if (!isLegacy() || mColorUtil.isGrayscale(mContext, action.icon)) { button.setTextViewCompoundDrawablesRelativeColorFilter(R.id.action0, 0, mContext.getResources().getColor( R.color.notification_action_legacy_color_filter), mContext.getResources().getColor(R.color.notification_action_color_filter), PorterDuff.Mode.MULTIPLY); } } } private CharSequence processLegacyText(CharSequence charSequence) { if (isLegacy()) { Loading @@ -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); Loading
core/res/res/values/colors.xml +1 −1 Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ <drawable name="notification_template_divider">#29000000</drawable> <color name="notification_icon_bg_color">#ff9e9e9e</color> <color name="notification_action_legacy_color_filter">#ff555555</color> <color name="notification_action_color_filter">@color/secondary_text_material_light</color> <color name="notification_media_action_bg">#00000000</color> <color name="notification_media_progress">#FFFFFFFF</color> Loading
core/res/res/values/symbols.xml +1 −1 Original line number Diff line number Diff line Loading @@ -1718,7 +1718,7 @@ <java-symbol type="layout" name="notification_template_material_big_text" /> <java-symbol type="layout" name="notification_template_icon_group" /> <java-symbol type="layout" name="notification_material_media_action" /> <java-symbol type="color" name="notification_action_legacy_color_filter" /> <java-symbol type="color" name="notification_action_color_filter" /> <java-symbol type="color" name="notification_icon_bg_color" /> <java-symbol type="drawable" name="notification_icon_legacy_bg" /> <java-symbol type="drawable" name="notification_material_media_progress" /> Loading