Don't apply color filter on header icons if animations are disabled.

Disabling animations altogether reduces the flakiness, however, icon's alpha seem to be changed and then cleared, and there was 1 out of 24 runs where it flaked; so, avoiding the toggle of alpha when animations are disabled.

Bug: 337916664
Test: Screenshot tests
Flag: N/A
Change-Id: I4e9d703d005e3916ee01cf74baa2a804a3c1efd1
diff --git a/src/com/android/launcher3/widget/picker/WidgetsListHeader.java b/src/com/android/launcher3/widget/picker/WidgetsListHeader.java
index d373a3b..d164dd0 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsListHeader.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsListHeader.java
@@ -15,6 +15,8 @@
  */
 package com.android.launcher3.widget.picker;
 
+import static android.animation.ValueAnimator.areAnimatorsEnabled;
+
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.graphics.drawable.Drawable;
@@ -201,7 +203,7 @@
     public void reapplyItemInfo(ItemInfoWithIcon info) {
         if (getTag() == info) {
             mIconLoadRequest = null;
-            mEnableIconUpdateAnimation = true;
+            mEnableIconUpdateAnimation = areAnimatorsEnabled();
 
             // Optimization: Starting in N, pre-uploads the bitmap to RenderThread.
             info.bitmap.icon.prepareToDraw();