Only set the task description if the colors are opaque.

Bug: 27214638
Change-Id: I75e0b8871087f0b8e6acd16dc751bb6374c0f968
This commit is contained in:
Winson
2016-02-17 14:53:46 -08:00
committed by Winson Chung
parent 7998e48ce3
commit 2d47683ab9

View File

@@ -49,6 +49,7 @@ import android.content.res.TypedArray;
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 @@ public class Activity extends ContextThemeWrapper
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);
}
}