package X6FRs_4.IMuAHx_6.WwEq_13;

import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.widget.ImageView;
/* compiled from: ImageViewCompat.java */
/* loaded from: classes.dex */
public class X6FRs_4 {
    public static ColorStateList KQgRr5e_0(ImageView imageView) {
        if (Build.VERSION.SDK_INT >= 21) {
            return imageView.getImageTintList();
        }
        if (imageView instanceof Nm6q_10) {
            return ((Nm6q_10) imageView).getSupportImageTintList();
        }
        return null;
    }

    public static void KQgRr5e_0(ImageView imageView, ColorStateList colorStateList) {
        Drawable drawable;
        if (Build.VERSION.SDK_INT >= 21) {
            imageView.setImageTintList(colorStateList);
            if (Build.VERSION.SDK_INT != 21 || (drawable = imageView.getDrawable()) == null || imageView.getImageTintList() == null) {
                return;
            }
            if (drawable.isStateful()) {
                drawable.setState(imageView.getDrawableState());
            }
            imageView.setImageDrawable(drawable);
        } else if (imageView instanceof Nm6q_10) {
            ((Nm6q_10) imageView).setSupportImageTintList(colorStateList);
        }
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public static PorterDuff.Mode m327KQgRr5e_0(ImageView imageView) {
        if (Build.VERSION.SDK_INT >= 21) {
            return imageView.getImageTintMode();
        }
        if (imageView instanceof Nm6q_10) {
            return ((Nm6q_10) imageView).getSupportImageTintMode();
        }
        return null;
    }

    public static void KQgRr5e_0(ImageView imageView, PorterDuff.Mode mode) {
        Drawable drawable;
        if (Build.VERSION.SDK_INT >= 21) {
            imageView.setImageTintMode(mode);
            if (Build.VERSION.SDK_INT != 21 || (drawable = imageView.getDrawable()) == null || imageView.getImageTintList() == null) {
                return;
            }
            if (drawable.isStateful()) {
                drawable.setState(imageView.getDrawableState());
            }
            imageView.setImageDrawable(drawable);
        } else if (imageView instanceof Nm6q_10) {
            ((Nm6q_10) imageView).setSupportImageTintMode(mode);
        }
    }
}
