Skip to content

Commit da64907

Browse files
Winson ChungAndroid (Google) Code Review
authored andcommitted
Merge "Fixing regression with black task bar background. (Bug 17584337)" into lmp-dev
2 parents c3328ca + ae12dae commit da64907

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

core/java/android/app/ActivityManager.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ public TaskDescription() {
579579
public TaskDescription(TaskDescription td) {
580580
mLabel = td.mLabel;
581581
mIcon = td.mIcon;
582-
setPrimaryColor(td.mColorPrimary);
582+
mColorPrimary = td.mColorPrimary;
583583
mIconFilename = td.mIconFilename;
584584
}
585585

@@ -600,7 +600,11 @@ public void setLabel(String label) {
600600
* @hide
601601
*/
602602
public void setPrimaryColor(int primaryColor) {
603-
mColorPrimary = 0xFF000000 | primaryColor;
603+
// 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;
604608
}
605609

606610
/**

0 commit comments

Comments
 (0)