package o; 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; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import o.SYO; /* loaded from: classes.dex */ public final class mhG extends ContextWrapper { private static Configuration d; private Configuration a; private Resources b; private LayoutInflater c; public int e; private Resources.Theme f; public mhG() { super(null); } public mhG(Context context, int i) { super(context); this.e = i; } public mhG(Context context, Resources.Theme theme) { super(context); this.f = theme; } @Override // android.content.ContextWrapper protected final void attachBaseContext(Context context) { super.attachBaseContext(context); } public final void eb_(Configuration configuration) { if (this.b != null) { throw new IllegalStateException("getResources() or getAssets() has already been called"); } if (this.a != null) { throw new IllegalStateException("Override configuration has already been set"); } this.a = new Configuration(configuration); } @Override // android.content.ContextWrapper, android.content.Context public final Resources getResources() { if (this.b == null) { Configuration configuration = this.a; if (configuration != null && configuration != null) { if (d == null) { Configuration configuration2 = new Configuration(); configuration2.fontScale = BitmapDescriptorFactory.HUE_RED; d = configuration2; } if (!configuration.equals(d)) { this.b = IeS.ec_(this, this.a).getResources(); } } this.b = super.getResources(); } return this.b; } @Override // android.content.ContextWrapper, android.content.Context public final void setTheme(int i) { if (this.e != i) { this.e = i; b(); } } @Override // android.content.ContextWrapper, android.content.Context public final Resources.Theme getTheme() { Resources.Theme theme = this.f; if (theme != null) { return theme; } if (this.e == 0) { this.e = SYO.jbe.Theme_AppCompat_Light; } b(); return this.f; } @Override // android.content.ContextWrapper, android.content.Context public final Object getSystemService(String str) { if (!"layout_inflater".equals(str)) { return getBaseContext().getSystemService(str); } if (this.c == null) { this.c = LayoutInflater.from(getBaseContext()).cloneInContext(this); } return this.c; } private void b() { if (this.f == null) { this.f = getResources().newTheme(); Resources.Theme theme = getBaseContext().getTheme(); if (theme != null) { this.f.setTo(theme); } } this.f.applyStyle(this.e, true); } @Override // android.content.ContextWrapper, android.content.Context public final AssetManager getAssets() { return getResources().getAssets(); } /* loaded from: classes.dex */ static class IeS { static Context ec_(mhG mhg, Configuration configuration) { return mhg.createConfigurationContext(configuration); } } }