package o; import android.app.Application; import android.content.Context; import android.content.ContextWrapper; import android.os.Bundle; import androidx.fragment.app.Fragment; import o.CWH; import o.VLM; import o.wdQ; /* loaded from: classes.dex */ public class RTE implements GvH, InterfaceC9254dgJ, InterfaceC0940Ryk { private VLM.LWm b; private final sUv c; private final Fragment d; private LPk e = null; C7432coF a = null; public RTE(Fragment fragment, sUv suv) { this.d = fragment; this.c = suv; } @Override // o.InterfaceC0940Ryk public sUv getViewModelStore() { e(); return this.c; } public final void e() { if (this.e == null) { this.e = new LPk(this); C7432coF a = C7432coF.a(this); this.a = a; a.b(); } } @Override // o.InterfaceC16541pFg public wdQ getLifecycle() { e(); return this.e; } @Override // o.GvH public VLM.LWm getDefaultViewModelProviderFactory() { Application application; VLM.LWm defaultViewModelProviderFactory = this.d.getDefaultViewModelProviderFactory(); if (!defaultViewModelProviderFactory.equals(this.d.mDefaultFactory)) { this.b = defaultViewModelProviderFactory; return defaultViewModelProviderFactory; } if (this.b == null) { Context applicationContext = this.d.requireContext().getApplicationContext(); while (true) { if (!(applicationContext instanceof ContextWrapper)) { application = null; break; } if (applicationContext instanceof Application) { application = (Application) applicationContext; break; } applicationContext = ((ContextWrapper) applicationContext).getBaseContext(); } Fragment fragment = this.d; this.b = new C16768rAP(application, fragment, fragment.getArguments()); } return this.b; } @Override // o.GvH public CWH getDefaultViewModelCreationExtras() { Application application; Context applicationContext = this.d.requireContext().getApplicationContext(); while (true) { if (!(applicationContext instanceof ContextWrapper)) { application = null; break; } if (applicationContext instanceof Application) { application = (Application) applicationContext; break; } applicationContext = ((ContextWrapper) applicationContext).getBaseContext(); } CVP cvp = new CVP(); if (application != null) { CWH.Sts sts = VLM.Sts.a; C14957gcv.e(sts, ""); cvp.d.put(sts, application); } CWH.Sts sts2 = HLt.a; Fragment fragment = this.d; C14957gcv.e(sts2, ""); cvp.d.put(sts2, fragment); CWH.Sts sts3 = HLt.b; C14957gcv.e(sts3, ""); cvp.d.put(sts3, this); if (this.d.getArguments() != null) { CWH.Sts sts4 = HLt.e; Bundle arguments = this.d.getArguments(); C14957gcv.e(sts4, ""); cvp.d.put(sts4, arguments); } return cvp; } @Override // o.InterfaceC9254dgJ public FNE getSavedStateRegistry() { e(); return this.a.d; } public final void zg_(Bundle bundle) { this.a.AL_(bundle); } public final void b(wdQ.HBt hBt) { LPk lPk = this.e; lPk.d("handleLifecycleEvent"); lPk.d(hBt.a()); } public final void c(wdQ.IeS ieS) { LPk lPk = this.e; lPk.d("setCurrentState"); lPk.d(ieS); } public final boolean b() { return this.e != null; } }