package X6FRs_4.KQgRr5e_0.YghfZG_14;

import android.content.Context;
import android.content.ContextWrapper;
import android.content.res.AssetManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.view.LayoutInflater;
/* compiled from: ContextThemeWrapper.java */
/* loaded from: classes.dex */
public class Mqv2r_3 extends ContextWrapper {
    public int KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public Configuration f862KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public Resources.Theme f863KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public Resources f864KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public LayoutInflater f865KQgRr5e_0;

    public Mqv2r_3() {
        super(null);
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public final Resources m463KQgRr5e_0() {
        if (this.f864KQgRr5e_0 == null) {
            Configuration configuration = this.f862KQgRr5e_0;
            if (configuration == null) {
                this.f864KQgRr5e_0 = super.getResources();
            } else if (Build.VERSION.SDK_INT >= 17) {
                this.f864KQgRr5e_0 = createConfigurationContext(configuration).getResources();
            }
        }
        return this.f864KQgRr5e_0;
    }

    @Override // android.content.ContextWrapper
    public void attachBaseContext(Context context) {
        super.attachBaseContext(context);
    }

    @Override // android.content.ContextWrapper, android.content.Context
    public AssetManager getAssets() {
        return getResources().getAssets();
    }

    @Override // android.content.ContextWrapper, android.content.Context
    public Resources getResources() {
        return m463KQgRr5e_0();
    }

    @Override // android.content.ContextWrapper, android.content.Context
    public Object getSystemService(String str) {
        if ("layout_inflater".equals(str)) {
            if (this.f865KQgRr5e_0 == null) {
                this.f865KQgRr5e_0 = LayoutInflater.from(getBaseContext()).cloneInContext(this);
            }
            return this.f865KQgRr5e_0;
        }
        return getBaseContext().getSystemService(str);
    }

    @Override // android.content.ContextWrapper, android.content.Context
    public Resources.Theme getTheme() {
        Resources.Theme theme = this.f863KQgRr5e_0;
        if (theme != null) {
            return theme;
        }
        if (this.KQgRr5e_0 == 0) {
            this.KQgRr5e_0 = X6FRs_4.KQgRr5e_0.Xgtqvk_8.Theme_AppCompat_Light;
        }
        m464KQgRr5e_0();
        return this.f863KQgRr5e_0;
    }

    @Override // android.content.ContextWrapper, android.content.Context
    public void setTheme(int i) {
        if (this.KQgRr5e_0 != i) {
            this.KQgRr5e_0 = i;
            m464KQgRr5e_0();
        }
    }

    public Mqv2r_3(Context context, int i) {
        super(context);
        this.KQgRr5e_0 = i;
    }

    public Mqv2r_3(Context context, Resources.Theme theme) {
        super(context);
        this.f863KQgRr5e_0 = theme;
    }

    public int KQgRr5e_0() {
        return this.KQgRr5e_0;
    }

    public void KQgRr5e_0(Resources.Theme theme, int i, boolean z) {
        theme.applyStyle(i, true);
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public final void m464KQgRr5e_0() {
        boolean z = this.f863KQgRr5e_0 == null;
        if (z) {
            this.f863KQgRr5e_0 = getResources().newTheme();
            Resources.Theme theme = getBaseContext().getTheme();
            if (theme != null) {
                this.f863KQgRr5e_0.setTo(theme);
            }
        }
        KQgRr5e_0(this.f863KQgRr5e_0, this.KQgRr5e_0, z);
    }
}
