package M2;

import P2.w;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import h0.DialogInterfaceOnCancelListenerC1017q;

/* JADX INFO: loaded from: classes.dex */
public class i extends DialogInterfaceOnCancelListenerC1017q {

    /* JADX INFO: renamed from: E0, reason: collision with root package name */
    public AlertDialog f4176E0;

    /* JADX INFO: renamed from: F0, reason: collision with root package name */
    public DialogInterface.OnCancelListener f4177F0;

    /* JADX INFO: renamed from: G0, reason: collision with root package name */
    public AlertDialog f4178G0;

    @Override // h0.DialogInterfaceOnCancelListenerC1017q
    public final Dialog g0(Bundle bundle) {
        AlertDialog alertDialog = this.f4176E0;
        if (alertDialog != null) {
            return alertDialog;
        }
        this.f13233v0 = false;
        if (this.f4178G0 == null) {
            Context contextO = o();
            w.f(contextO);
            this.f4178G0 = new AlertDialog.Builder(contextO).create();
        }
        return this.f4178G0;
    }

    @Override // h0.DialogInterfaceOnCancelListenerC1017q, android.content.DialogInterface.OnCancelListener
    public final void onCancel(DialogInterface dialogInterface) {
        DialogInterface.OnCancelListener onCancelListener = this.f4177F0;
        if (onCancelListener != null) {
            onCancelListener.onCancel(dialogInterface);
        }
    }
}
