package c.b.e;

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.view.LayoutInflater;

/* JADX INFO: compiled from: ContextThemeWrapper.java */
/* JADX INFO: loaded from: classes.dex */
public class c extends ContextWrapper {
    public static Configuration a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public int f619b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public Resources.Theme f620c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public LayoutInflater f621d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public Configuration f622e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public Resources f623f;

    /* JADX INFO: compiled from: ContextThemeWrapper.java */
    public static class a {
        public static Context a(c cVar, Configuration configuration) {
            return cVar.createConfigurationContext(configuration);
        }
    }

    public c() {
        super(null);
    }

    public void a(Configuration configuration) {
        if (this.f623f != null) {
            throw new IllegalStateException("getResources() or getAssets() has already been called");
        }
        if (this.f622e != null) {
            throw new IllegalStateException("Override configuration has already been set");
        }
        this.f622e = new Configuration(configuration);
    }

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

    public final void b() {
        if (this.f620c == null) {
            this.f620c = getResources().newTheme();
            Resources.Theme theme = getBaseContext().getTheme();
            if (theme != null) {
                this.f620c.setTo(theme);
            }
        }
        this.f620c.applyStyle(this.f619b, true);
    }

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

    /* JADX WARN: Removed duplicated region for block: B:13:0x002c  */
    @Override // android.content.ContextWrapper, android.content.Context
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public android.content.res.Resources getResources() {
        /*
            r3 = this;
            android.content.res.Resources r0 = r3.f623f
            if (r0 != 0) goto L32
            android.content.res.Configuration r0 = r3.f622e
            if (r0 == 0) goto L2c
            android.content.res.Configuration r1 = c.b.e.c.a
            if (r1 != 0) goto L16
            android.content.res.Configuration r1 = new android.content.res.Configuration
            r1.<init>()
            r2 = 0
            r1.fontScale = r2
            c.b.e.c.a = r1
        L16:
            android.content.res.Configuration r1 = c.b.e.c.a
            boolean r0 = r0.equals(r1)
            if (r0 == 0) goto L1f
            goto L2c
        L1f:
            android.content.res.Configuration r0 = r3.f622e
            android.content.Context r0 = c.b.e.c.a.a(r3, r0)
            android.content.res.Resources r0 = r0.getResources()
            r3.f623f = r0
            goto L32
        L2c:
            android.content.res.Resources r0 = super.getResources()
            r3.f623f = r0
        L32:
            android.content.res.Resources r0 = r3.f623f
            return r0
        */
        throw new UnsupportedOperationException("Method not decompiled: c.b.e.c.getResources():android.content.res.Resources");
    }

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

    @Override // android.content.ContextWrapper, android.content.Context
    public Resources.Theme getTheme() {
        Resources.Theme theme = this.f620c;
        if (theme != null) {
            return theme;
        }
        if (this.f619b == 0) {
            this.f619b = 2131820821;
        }
        b();
        return this.f620c;
    }

    @Override // android.content.ContextWrapper, android.content.Context
    public void setTheme(int i2) {
        if (this.f619b != i2) {
            this.f619b = i2;
            b();
        }
    }

    public c(Context context, int i2) {
        super(context);
        this.f619b = i2;
    }
}
