Loading core/java/android/app/Notification.java +10 −8 Original line number Original line Diff line number Diff line Loading @@ -5311,7 +5311,7 @@ public class Notification implements Parcelable contentView.setInt(R.id.expand_button, "setDefaultTextColor", textColor); contentView.setInt(R.id.expand_button, "setDefaultTextColor", textColor); contentView.setInt(R.id.expand_button, "setDefaultPillColor", pillColor); contentView.setInt(R.id.expand_button, "setDefaultPillColor", pillColor); // Use different highlighted colors except when low-priority mode prevents that // Use different highlighted colors except when low-priority mode prevents that if (!p.forceDefaultColor) { if (!p.mReduceHighlights) { textColor = getBackgroundColor(p); textColor = getBackgroundColor(p); pillColor = getAccentColor(p); pillColor = getAccentColor(p); } } Loading Loading @@ -5952,7 +5952,7 @@ public class Notification implements Parcelable .viewType(StandardTemplateParams.VIEW_TYPE_PUBLIC) .viewType(StandardTemplateParams.VIEW_TYPE_PUBLIC) .fillTextsFrom(this); .fillTextsFrom(this); if (isLowPriority) { if (isLowPriority) { params.forceDefaultColor(); params.reduceHighlights(); } } view = makeNotificationHeader(params); view = makeNotificationHeader(params); view.setBoolean(R.id.notification_header, "setExpandOnlyOnButton", true); view.setBoolean(R.id.notification_header, "setExpandOnlyOnButton", true); Loading @@ -5975,7 +5975,7 @@ public class Notification implements Parcelable public RemoteViews makeLowPriorityContentView(boolean useRegularSubtext) { public RemoteViews makeLowPriorityContentView(boolean useRegularSubtext) { StandardTemplateParams p = mParams.reset() StandardTemplateParams p = mParams.reset() .viewType(StandardTemplateParams.VIEW_TYPE_MINIMIZED) .viewType(StandardTemplateParams.VIEW_TYPE_MINIMIZED) .forceDefaultColor() .reduceHighlights() .fillTextsFrom(this); .fillTextsFrom(this); if (!useRegularSubtext || TextUtils.isEmpty(mParams.summaryText)) { if (!useRegularSubtext || TextUtils.isEmpty(mParams.summaryText)) { p.summaryText(createSummaryText()); p.summaryText(createSummaryText()); Loading Loading @@ -6315,7 +6315,9 @@ public class Notification implements Parcelable * @param p the template params to inflate this with * @param p the template params to inflate this with */ */ private @ColorInt int getRawColor(StandardTemplateParams p) { private @ColorInt int getRawColor(StandardTemplateParams p) { if (p.forceDefaultColor) { // When notifications are theme-tinted, the raw color is only used for the icon, so go // ahead and keep that color instead of changing the color for minimized notifs. if (p.mReduceHighlights && !mTintWithThemeAccent) { return COLOR_DEFAULT; return COLOR_DEFAULT; } } return mN.color; return mN.color; Loading Loading @@ -12182,7 +12184,7 @@ public class Notification implements Parcelable int maxRemoteInputHistory = Style.MAX_REMOTE_INPUT_HISTORY_LINES; int maxRemoteInputHistory = Style.MAX_REMOTE_INPUT_HISTORY_LINES; boolean hideLargeIcon; boolean hideLargeIcon; boolean allowColorization = true; boolean allowColorization = true; boolean forceDefaultColor = false; boolean mReduceHighlights = false; final StandardTemplateParams reset() { final StandardTemplateParams reset() { mViewType = VIEW_TYPE_UNSPECIFIED; mViewType = VIEW_TYPE_UNSPECIFIED; Loading @@ -12203,7 +12205,7 @@ public class Notification implements Parcelable headerTextSecondary = null; headerTextSecondary = null; maxRemoteInputHistory = Style.MAX_REMOTE_INPUT_HISTORY_LINES; maxRemoteInputHistory = Style.MAX_REMOTE_INPUT_HISTORY_LINES; allowColorization = true; allowColorization = true; forceDefaultColor = false; mReduceHighlights = false; return this; return this; } } Loading Loading @@ -12301,8 +12303,8 @@ public class Notification implements Parcelable return this; return this; } } final StandardTemplateParams forceDefaultColor() { final StandardTemplateParams reduceHighlights() { this.forceDefaultColor = true; this.mReduceHighlights = true; return this; return this; } } Loading Loading
core/java/android/app/Notification.java +10 −8 Original line number Original line Diff line number Diff line Loading @@ -5311,7 +5311,7 @@ public class Notification implements Parcelable contentView.setInt(R.id.expand_button, "setDefaultTextColor", textColor); contentView.setInt(R.id.expand_button, "setDefaultTextColor", textColor); contentView.setInt(R.id.expand_button, "setDefaultPillColor", pillColor); contentView.setInt(R.id.expand_button, "setDefaultPillColor", pillColor); // Use different highlighted colors except when low-priority mode prevents that // Use different highlighted colors except when low-priority mode prevents that if (!p.forceDefaultColor) { if (!p.mReduceHighlights) { textColor = getBackgroundColor(p); textColor = getBackgroundColor(p); pillColor = getAccentColor(p); pillColor = getAccentColor(p); } } Loading Loading @@ -5952,7 +5952,7 @@ public class Notification implements Parcelable .viewType(StandardTemplateParams.VIEW_TYPE_PUBLIC) .viewType(StandardTemplateParams.VIEW_TYPE_PUBLIC) .fillTextsFrom(this); .fillTextsFrom(this); if (isLowPriority) { if (isLowPriority) { params.forceDefaultColor(); params.reduceHighlights(); } } view = makeNotificationHeader(params); view = makeNotificationHeader(params); view.setBoolean(R.id.notification_header, "setExpandOnlyOnButton", true); view.setBoolean(R.id.notification_header, "setExpandOnlyOnButton", true); Loading @@ -5975,7 +5975,7 @@ public class Notification implements Parcelable public RemoteViews makeLowPriorityContentView(boolean useRegularSubtext) { public RemoteViews makeLowPriorityContentView(boolean useRegularSubtext) { StandardTemplateParams p = mParams.reset() StandardTemplateParams p = mParams.reset() .viewType(StandardTemplateParams.VIEW_TYPE_MINIMIZED) .viewType(StandardTemplateParams.VIEW_TYPE_MINIMIZED) .forceDefaultColor() .reduceHighlights() .fillTextsFrom(this); .fillTextsFrom(this); if (!useRegularSubtext || TextUtils.isEmpty(mParams.summaryText)) { if (!useRegularSubtext || TextUtils.isEmpty(mParams.summaryText)) { p.summaryText(createSummaryText()); p.summaryText(createSummaryText()); Loading Loading @@ -6315,7 +6315,9 @@ public class Notification implements Parcelable * @param p the template params to inflate this with * @param p the template params to inflate this with */ */ private @ColorInt int getRawColor(StandardTemplateParams p) { private @ColorInt int getRawColor(StandardTemplateParams p) { if (p.forceDefaultColor) { // When notifications are theme-tinted, the raw color is only used for the icon, so go // ahead and keep that color instead of changing the color for minimized notifs. if (p.mReduceHighlights && !mTintWithThemeAccent) { return COLOR_DEFAULT; return COLOR_DEFAULT; } } return mN.color; return mN.color; Loading Loading @@ -12182,7 +12184,7 @@ public class Notification implements Parcelable int maxRemoteInputHistory = Style.MAX_REMOTE_INPUT_HISTORY_LINES; int maxRemoteInputHistory = Style.MAX_REMOTE_INPUT_HISTORY_LINES; boolean hideLargeIcon; boolean hideLargeIcon; boolean allowColorization = true; boolean allowColorization = true; boolean forceDefaultColor = false; boolean mReduceHighlights = false; final StandardTemplateParams reset() { final StandardTemplateParams reset() { mViewType = VIEW_TYPE_UNSPECIFIED; mViewType = VIEW_TYPE_UNSPECIFIED; Loading @@ -12203,7 +12205,7 @@ public class Notification implements Parcelable headerTextSecondary = null; headerTextSecondary = null; maxRemoteInputHistory = Style.MAX_REMOTE_INPUT_HISTORY_LINES; maxRemoteInputHistory = Style.MAX_REMOTE_INPUT_HISTORY_LINES; allowColorization = true; allowColorization = true; forceDefaultColor = false; mReduceHighlights = false; return this; return this; } } Loading Loading @@ -12301,8 +12303,8 @@ public class Notification implements Parcelable return this; return this; } } final StandardTemplateParams forceDefaultColor() { final StandardTemplateParams reduceHighlights() { this.forceDefaultColor = true; this.mReduceHighlights = true; return this; return this; } } Loading