package a1;

import android.R;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.os.Build;
import android.util.Log;

/* JADX INFO: compiled from: RippleUtils.java */
/* JADX INFO: loaded from: classes.dex */
public class b {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public static final boolean f21a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private static final int[] f22b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    static final String f23c;

    static {
        f21a = Build.VERSION.SDK_INT >= 21;
        f22b = new int[]{R.attr.state_enabled, R.attr.state_pressed};
        f23c = b.class.getSimpleName();
    }

    private b() {
    }

    public static ColorStateList a(ColorStateList colorStateList) {
        if (colorStateList == null) {
            return ColorStateList.valueOf(0);
        }
        int i3 = Build.VERSION.SDK_INT;
        if (i3 >= 22 && i3 <= 27 && Color.alpha(colorStateList.getDefaultColor()) == 0 && Color.alpha(colorStateList.getColorForState(f22b, 0)) != 0) {
            Log.w(f23c, "Use a non-transparent color for the default color as it will be used to finish ripple animations.");
        }
        return colorStateList;
    }

    public static boolean b(int[] iArr) {
        boolean z2 = false;
        boolean z3 = false;
        for (int i3 : iArr) {
            if (i3 == 16842910) {
                z2 = true;
            } else if (i3 == 16842908 || i3 == 16842919 || i3 == 16843623) {
                z3 = true;
            }
        }
        return z2 && z3;
    }
}
