package c.a;

import android.app.Dialog;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import androidx.activity.OnBackPressedDispatcher;
import c.l.j;
import c.l.n;
import c.l.o;
import g.h0.c.l;

/* JADX INFO: compiled from: ComponentDialog.kt */
/* JADX INFO: loaded from: classes.dex */
@g.i
public class i extends Dialog implements n, k {

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

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final OnBackPressedDispatcher f529e;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public i(Context context, int i2) {
        super(context, i2);
        l.f(context, "context");
        this.f529e = new OnBackPressedDispatcher(new Runnable() { // from class: c.a.f
            @Override // java.lang.Runnable
            public final void run() {
                i.b(this.f527b);
            }
        });
    }

    public static void b(i iVar) {
        l.f(iVar, "this$0");
        super.onBackPressed();
    }

    public final o a() {
        o oVar = this.f528b;
        if (oVar != null) {
            return oVar;
        }
        o oVar2 = new o(this);
        this.f528b = oVar2;
        return oVar2;
    }

    @Override // c.l.n
    public final c.l.j getLifecycle() {
        return a();
    }

    @Override // c.a.k
    public final OnBackPressedDispatcher getOnBackPressedDispatcher() {
        return this.f529e;
    }

    @Override // android.app.Dialog
    public void onBackPressed() {
        this.f529e.a();
    }

    @Override // android.app.Dialog
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        if (Build.VERSION.SDK_INT >= 33) {
            OnBackPressedDispatcher onBackPressedDispatcher = this.f529e;
            onBackPressedDispatcher.f17e = getOnBackInvokedDispatcher();
            onBackPressedDispatcher.b();
        }
        a().f(j.a.ON_CREATE);
    }

    @Override // android.app.Dialog
    public void onStart() {
        super.onStart();
        a().f(j.a.ON_RESUME);
    }

    @Override // android.app.Dialog
    public void onStop() {
        a().f(j.a.ON_DESTROY);
        this.f528b = null;
        super.onStop();
    }
}
