package X6FRs_4.IMuAHx_6.IFxWkV_5;

import X6FRs_4.IMuAHx_6.X6FRs_4.PGPF6hQ_2.IFxWkV_5;
import X6FRs_4.IMuAHx_6.X6FRs_4.PGPF6hQ_2.PGPF6hQ_2;
import X6FRs_4.IMuAHx_6.XnFJ5_9.QxJ9d_1;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.os.Build;
import android.os.CancellationSignal;
import android.os.Handler;
/* compiled from: TypefaceCompat.java */
/* loaded from: classes.dex */
public class PGPF6hQ_2 {
    public static final FSaI4_7 KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public static final X6FRs_4.Mqv2r_3.X6FRs_4<String, Typeface> f400KQgRr5e_0;

    static {
        int i = Build.VERSION.SDK_INT;
        if (i >= 28) {
            KQgRr5e_0 = new IMuAHx_6();
        } else if (i >= 26) {
            KQgRr5e_0 = new IFxWkV_5();
        } else if (i >= 24 && X6FRs_4.m289KQgRr5e_0()) {
            KQgRr5e_0 = new X6FRs_4();
        } else if (Build.VERSION.SDK_INT >= 21) {
            KQgRr5e_0 = new Mqv2r_3();
        } else {
            KQgRr5e_0 = new FSaI4_7();
        }
        f400KQgRr5e_0 = new X6FRs_4.Mqv2r_3.X6FRs_4<>(16);
    }

    public static Typeface KQgRr5e_0(Resources resources, int i, int i2) {
        return f400KQgRr5e_0.QxJ9d_1(m285KQgRr5e_0(resources, i, i2));
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public static String m285KQgRr5e_0(Resources resources, int i, int i2) {
        return resources.getResourcePackageName(i) + "-" + i + "-" + i2;
    }

    public static Typeface KQgRr5e_0(Context context, PGPF6hQ_2.KQgRr5e_0 kQgRr5e_0, Resources resources, int i, int i2, IFxWkV_5.KQgRr5e_0 kQgRr5e_02, Handler handler, boolean z) {
        Typeface KQgRr5e_02;
        if (kQgRr5e_0 instanceof PGPF6hQ_2.Mqv2r_3) {
            PGPF6hQ_2.Mqv2r_3 mqv2r_3 = (PGPF6hQ_2.Mqv2r_3) kQgRr5e_0;
            boolean z2 = false;
            if (!z ? kQgRr5e_02 == null : mqv2r_3.KQgRr5e_0() == 0) {
                z2 = true;
            }
            KQgRr5e_02 = X6FRs_4.IMuAHx_6.XnFJ5_9.QxJ9d_1.KQgRr5e_0(context, mqv2r_3.m337KQgRr5e_0(), kQgRr5e_02, handler, z2, z ? mqv2r_3.QxJ9d_1() : -1, i2);
        } else {
            KQgRr5e_02 = KQgRr5e_0.KQgRr5e_0(context, (PGPF6hQ_2.QxJ9d_1) kQgRr5e_0, resources, i2);
            if (kQgRr5e_02 != null) {
                if (KQgRr5e_02 != null) {
                    kQgRr5e_02.callbackSuccessAsync(KQgRr5e_02, handler);
                } else {
                    kQgRr5e_02.callbackFailAsync(-3, handler);
                }
            }
        }
        if (KQgRr5e_02 != null) {
            f400KQgRr5e_0.m513KQgRr5e_0((X6FRs_4.Mqv2r_3.X6FRs_4<String, Typeface>) m285KQgRr5e_0(resources, i, i2), (String) KQgRr5e_02);
        }
        return KQgRr5e_02;
    }

    public static Typeface KQgRr5e_0(Context context, Resources resources, int i, String str, int i2) {
        Typeface KQgRr5e_02 = KQgRr5e_0.KQgRr5e_0(context, resources, i, str, i2);
        if (KQgRr5e_02 != null) {
            f400KQgRr5e_0.m513KQgRr5e_0((X6FRs_4.Mqv2r_3.X6FRs_4<String, Typeface>) m285KQgRr5e_0(resources, i, i2), (String) KQgRr5e_02);
        }
        return KQgRr5e_02;
    }

    public static Typeface KQgRr5e_0(Context context, CancellationSignal cancellationSignal, QxJ9d_1.IFxWkV_5[] iFxWkV_5Arr, int i) {
        return KQgRr5e_0.KQgRr5e_0(context, cancellationSignal, iFxWkV_5Arr, i);
    }
}
