package androidx.activity;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import androidx.lifecycle.g;
import androidx.lifecycle.k;
import androidx.lifecycle.l;

/* JADX INFO: compiled from: ComponentDialog.kt */
/* JADX INFO: loaded from: classes.dex */
public class f extends Dialog implements k, h {

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private l f60e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private final OnBackPressedDispatcher f61f;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public f(Context context, int i3) {
        super(context, i3);
        w1.g.e(context, "context");
        this.f61f = new OnBackPressedDispatcher(new Runnable() { // from class: androidx.activity.e
            @Override // java.lang.Runnable
            public final void run() {
                f.f(this.f59e);
            }
        });
    }

    private final l e() {
        l lVar = this.f60e;
        if (lVar != null) {
            return lVar;
        }
        l lVar2 = new l(this);
        this.f60e = lVar2;
        return lVar2;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void f(f fVar) {
        w1.g.e(fVar, "this$0");
        super.onBackPressed();
    }

    @Override // androidx.lifecycle.k
    public final androidx.lifecycle.g a() {
        return e();
    }

    @Override // androidx.activity.h
    public final OnBackPressedDispatcher c() {
        return this.f61f;
    }

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

    @Override // android.app.Dialog
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        e().h(g.b.ON_CREATE);
    }

    @Override // android.app.Dialog
    protected void onStart() {
        super.onStart();
        e().h(g.b.ON_RESUME);
    }

    @Override // android.app.Dialog
    protected void onStop() {
        e().h(g.b.ON_DESTROY);
        this.f60e = null;
        super.onStop();
    }
}
