package X6FRs_4.IMuAHx_6.EuDEkJe_12;

import android.os.Build;
import android.util.Log;
import android.view.LayoutInflater;
import java.lang.reflect.Field;
/* compiled from: LayoutInflaterCompat.java */
/* loaded from: classes.dex */
public final class X6FRs_4 {
    public static Field KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public static boolean f385KQgRr5e_0;

    public static void KQgRr5e_0(LayoutInflater layoutInflater, LayoutInflater.Factory2 factory2) {
        if (!f385KQgRr5e_0) {
            try {
                Field declaredField = LayoutInflater.class.getDeclaredField("mFactory2");
                KQgRr5e_0 = declaredField;
                declaredField.setAccessible(true);
            } catch (NoSuchFieldException e) {
                Log.e("LayoutInflaterCompatHC", "forceSetFactory2 Could not find field 'mFactory2' on class " + LayoutInflater.class.getName() + "; inflation may have unexpected results.", e);
            }
            f385KQgRr5e_0 = true;
        }
        Field field = KQgRr5e_0;
        if (field != null) {
            try {
                field.set(layoutInflater, factory2);
            } catch (IllegalAccessException e2) {
                Log.e("LayoutInflaterCompatHC", "forceSetFactory2 could not set the Factory2 on LayoutInflater " + layoutInflater + "; inflation may have unexpected results.", e2);
            }
        }
    }

    public static void QxJ9d_1(LayoutInflater layoutInflater, LayoutInflater.Factory2 factory2) {
        layoutInflater.setFactory2(factory2);
        if (Build.VERSION.SDK_INT < 21) {
            LayoutInflater.Factory factory = layoutInflater.getFactory();
            if (factory instanceof LayoutInflater.Factory2) {
                KQgRr5e_0(layoutInflater, (LayoutInflater.Factory2) factory);
            } else {
                KQgRr5e_0(layoutInflater, factory2);
            }
        }
    }
}
