package o; import android.app.Dialog; import android.content.Context; import android.os.Build; import android.os.Bundle; import android.view.View; import android.view.ViewGroup; import android.view.Window; import androidx.activity.OnBackPressedDispatcher; import o.C8069dAO; import o.UBQ; import o.wdQ; /* loaded from: classes.dex */ public class HBt extends Dialog implements NHB { private final OnBackPressedDispatcher b; private LPk c; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public HBt(Context context, int i) { super(context, i); C14957gcv.e(context, ""); this.b = new OnBackPressedDispatcher(new Runnable(this) { // from class: o.tOB public final HBt d; @Override // java.lang.Runnable public final void run() { HBt.e(this.d); } { this.d = this; } }); } private final LPk a() { LPk lPk = this.c; if (lPk != null) { return lPk; } LPk lPk2 = new LPk(this); this.c = lPk2; return lPk2; } @Override // o.InterfaceC16541pFg public final wdQ getLifecycle() { return a(); } @Override // android.app.Dialog public void onCreate(Bundle bundle) { super.onCreate(bundle); if (Build.VERSION.SDK_INT >= 33) { OnBackPressedDispatcher onBackPressedDispatcher = this.b; onBackPressedDispatcher.a = getOnBackInvokedDispatcher(); onBackPressedDispatcher.e(); } LPk a = a(); wdQ.HBt hBt = wdQ.HBt.ON_CREATE; a.d("handleLifecycleEvent"); a.d(hBt.a()); } @Override // android.app.Dialog public void onStart() { super.onStart(); LPk a = a(); wdQ.HBt hBt = wdQ.HBt.ON_RESUME; a.d("handleLifecycleEvent"); a.d(hBt.a()); } @Override // android.app.Dialog public void onStop() { LPk a = a(); wdQ.HBt hBt = wdQ.HBt.ON_DESTROY; a.d("handleLifecycleEvent"); a.d(hBt.a()); this.c = null; super.onStop(); } /* JADX INFO: Access modifiers changed from: private */ public static final void e(HBt hBt) { C14957gcv.e(hBt, ""); super.onBackPressed(); } @Override // android.app.Dialog public void onBackPressed() { this.b.a(); } @Override // android.app.Dialog public void setContentView(int i) { d(); super.setContentView(i); } @Override // android.app.Dialog public void setContentView(View view) { C14957gcv.e(view, ""); d(); super.setContentView(view); } @Override // android.app.Dialog public void setContentView(View view, ViewGroup.LayoutParams layoutParams) { C14957gcv.e(view, ""); d(); super.setContentView(view, layoutParams); } @Override // android.app.Dialog public void addContentView(View view, ViewGroup.LayoutParams layoutParams) { C14957gcv.e(view, ""); d(); super.addContentView(view, layoutParams); } private final void d() { Window window = getWindow(); C14957gcv.e(window); window.getDecorView().setTag(UBQ.HBt.view_tree_lifecycle_owner, this); Window window2 = getWindow(); C14957gcv.e(window2); View decorView = window2.getDecorView(); C14957gcv.c(decorView, ""); HBt hBt = this; C14957gcv.e(decorView, ""); C14957gcv.e(hBt, ""); decorView.setTag(C8069dAO.Sts.view_tree_on_back_pressed_dispatcher_owner, hBt); } @Override // o.NHB public final OnBackPressedDispatcher getOnBackPressedDispatcher() { return this.b; } }