Only set the task description if the colors are opaque.
Bug: 27214638
Change-Id: I75e0b8871087f0b8e6acd16dc751bb6374c0f968
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index ea58e29..e3adbda 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -49,6 +49,7 @@
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.Canvas;
+import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
@@ -3988,8 +3989,12 @@
a.recycle();
if (colorPrimary != 0) {
ActivityManager.TaskDescription td = new ActivityManager.TaskDescription();
- td.setPrimaryColor(colorPrimary);
- td.setBackgroundColor(colorBg);
+ if (Color.alpha(colorPrimary) == 0xFF) {
+ td.setPrimaryColor(colorPrimary);
+ }
+ if (Color.alpha(colorBg) == 0xFF) {
+ td.setBackgroundColor(colorBg);
+ }
setTaskDescription(td);
}
}