We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c3328ca + ae12dae commit da64907Copy full SHA for da64907
1 file changed
core/java/android/app/ActivityManager.java
@@ -579,7 +579,7 @@ public TaskDescription() {
579
public TaskDescription(TaskDescription td) {
580
mLabel = td.mLabel;
581
mIcon = td.mIcon;
582
- setPrimaryColor(td.mColorPrimary);
+ mColorPrimary = td.mColorPrimary;
583
mIconFilename = td.mIconFilename;
584
}
585
@@ -600,7 +600,11 @@ public void setLabel(String label) {
600
* @hide
601
*/
602
public void setPrimaryColor(int primaryColor) {
603
- mColorPrimary = 0xFF000000 | primaryColor;
+ // Ensure that the given color is valid
604
+ if ((primaryColor != 0) && (Color.alpha(primaryColor) != 255)) {
605
+ throw new RuntimeException("A TaskDescription's primary color should be opaque");
606
+ }
607
+ mColorPrimary = primaryColor;
608
609
610
/**
0 commit comments