diff --git a/api/current.txt b/api/current.txt index 51a1e79255cdb..0208840554e97 100644 --- a/api/current.txt +++ b/api/current.txt @@ -35986,7 +35986,6 @@ package android.view { method public android.view.animation.Animation getAnimation(); method public android.os.IBinder getApplicationWindowToken(); method public android.graphics.drawable.Drawable getBackground(); - method public int getBackgroundColor(); method public android.content.res.ColorStateList getBackgroundTintList(); method public android.graphics.PorterDuff.Mode getBackgroundTintMode(); method public int getBaseline(); diff --git a/api/system-current.txt b/api/system-current.txt index 7ce111c9e2848..1392b46584cbc 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -38251,7 +38251,6 @@ package android.view { method public android.view.animation.Animation getAnimation(); method public android.os.IBinder getApplicationWindowToken(); method public android.graphics.drawable.Drawable getBackground(); - method public int getBackgroundColor(); method public android.content.res.ColorStateList getBackgroundTintList(); method public android.graphics.PorterDuff.Mode getBackgroundTintMode(); method public int getBaseline(); diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 126540f366296..9269fd2e14909 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -17148,6 +17148,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * drawable. * * @return The color of the ColorDrawable background, if set, otherwise 0. + * @hide */ @ColorInt public int getBackgroundColor() { diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java index 062ded2d99cea..6db4020e25c13 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java @@ -26,6 +26,7 @@ import android.content.Context; import android.content.res.ColorStateList; import android.graphics.Canvas; import android.graphics.Color; +import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.graphics.drawable.RippleDrawable; @@ -200,7 +201,8 @@ public class TaskViewHeader extends FrameLayout { mActivityDescription.setContentDescription(t.contentDescription); // Try and apply the system ui tint - int existingBgColor = getBackgroundColor(); + int existingBgColor = (getBackground() instanceof ColorDrawable) ? + ((ColorDrawable) getBackground()).getColor() : 0; if (existingBgColor != t.colorPrimary) { mBackgroundColorDrawable.setColor(t.colorPrimary); mBackgroundColor = t.colorPrimary;