package defpackage;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import ar.tvplayer.tv.R;

/* JADX INFO: renamed from: ʾˉˉ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public class DialogInterfaceOnCancelListenerC0244 extends AbstractComponentCallbacksC3393 implements DialogInterface.OnCancelListener, DialogInterface.OnDismissListener {

    /* JADX INFO: renamed from: ˆᵱʣ, reason: contains not printable characters */
    public Dialog f1797;

    /* JADX INFO: renamed from: ˋᵤᵦ, reason: contains not printable characters */
    public boolean f1800;

    /* JADX INFO: renamed from: ᵘᵫᵡ, reason: contains not printable characters */
    public boolean f1801;

    /* JADX INFO: renamed from: ᵟᵴᵥ, reason: contains not printable characters */
    public Handler f1802;

    /* JADX INFO: renamed from: ᵥﹶ, reason: contains not printable characters */
    public boolean f1806;

    /* JADX INFO: renamed from: ᵰʜ, reason: contains not printable characters */
    public boolean f1808;

    /* JADX INFO: renamed from: ᵽˀᵥ, reason: contains not printable characters */
    public final RunnableC1500 f1810 = new RunnableC1500(6, this);

    /* JADX INFO: renamed from: ᵠᵲˁ, reason: contains not printable characters */
    public final DialogInterfaceOnCancelListenerC5111 f1804 = new DialogInterfaceOnCancelListenerC5111(this);

    /* JADX INFO: renamed from: ᵠᵚˀᵫ, reason: contains not printable characters */
    public final DialogInterfaceOnDismissListenerC0969 f1803 = new DialogInterfaceOnDismissListenerC0969(this);

    /* JADX INFO: renamed from: ˀᵛᵟ, reason: contains not printable characters */
    public int f1795 = 0;

    /* JADX INFO: renamed from: ˀᵝᵙᵛ, reason: contains not printable characters */
    public int f1796 = 0;

    /* JADX INFO: renamed from: ᵣʚʿ, reason: contains not printable characters */
    public boolean f1805 = true;

    /* JADX INFO: renamed from: ˊʧᵖ, reason: contains not printable characters */
    public boolean f1798 = true;

    /* JADX INFO: renamed from: ᵧᵠᵾ, reason: contains not printable characters */
    public int f1807 = -1;

    /* JADX INFO: renamed from: ˊᵶᵕᵛ, reason: contains not printable characters */
    public final C3620 f1799 = new C3620(this);

    /* JADX INFO: renamed from: ᵱʢᵢ, reason: contains not printable characters */
    public boolean f1809 = false;

    @Override // android.content.DialogInterface.OnCancelListener
    public void onCancel(DialogInterface dialogInterface) {
    }

    @Override // android.content.DialogInterface.OnDismissListener
    public void onDismiss(DialogInterface dialogInterface) {
        if (this.f1800) {
            return;
        }
        if (AbstractC0651.m2324(3)) {
            toString();
        }
        m1440(true);
    }

    @Override // defpackage.AbstractComponentCallbacksC3393
    /* JADX INFO: renamed from: ʿᵯᴵ, reason: contains not printable characters */
    public final void mo1435() {
        this.f13066 = true;
        Dialog dialog = this.f1797;
        if (dialog != null) {
            this.f1800 = true;
            dialog.setOnDismissListener(null);
            this.f1797.dismiss();
            if (!this.f1808) {
                onDismiss(this.f1797);
            }
            this.f1797 = null;
            this.f1809 = false;
        }
    }

    @Override // defpackage.AbstractComponentCallbacksC3393
    /* JADX INFO: renamed from: ˀᵛᵟ, reason: contains not printable characters */
    public void mo1436(Bundle bundle) {
        Dialog dialog = this.f1797;
        if (dialog != null) {
            Bundle bundleOnSaveInstanceState = dialog.onSaveInstanceState();
            bundleOnSaveInstanceState.putBoolean("android:dialogShowing", false);
            bundle.putBundle("android:savedDialogState", bundleOnSaveInstanceState);
        }
        int i = this.f1795;
        if (i != 0) {
            bundle.putInt("android:style", i);
        }
        int i2 = this.f1796;
        if (i2 != 0) {
            bundle.putInt("android:theme", i2);
        }
        boolean z = this.f1805;
        if (!z) {
            bundle.putBoolean("android:cancelable", z);
        }
        boolean z2 = this.f1798;
        if (!z2) {
            bundle.putBoolean("android:showsDialog", z2);
        }
        int i3 = this.f1807;
        if (i3 != -1) {
            bundle.putInt("android:backStackId", i3);
        }
    }

    @Override // defpackage.AbstractComponentCallbacksC3393
    /* JADX INFO: renamed from: ˀᵝᵙᵛ, reason: contains not printable characters */
    public void mo1437() {
        this.f13066 = true;
        Dialog dialog = this.f1797;
        if (dialog != null) {
            this.f1800 = false;
            dialog.show();
            View decorView = this.f1797.getWindow().getDecorView();
            decorView.setTag(R.id.dl, this);
            decorView.setTag(R.id.rf, this);
            decorView.setTag(R.id._13q_res_0x7f0b0447, this);
        }
    }

    @Override // defpackage.AbstractComponentCallbacksC3393
    /* JADX INFO: renamed from: ˁʢᵛ, reason: contains not printable characters */
    public final ˀᵳˎᵹ mo1438() {
        return new C5493(this, new C2305(this));
    }

    @Override // defpackage.AbstractComponentCallbacksC3393
    /* JADX INFO: renamed from: ˆˀᵯ, reason: contains not printable characters */
    public void mo1439(Bundle bundle) {
        super.mo1439(bundle);
        this.f1802 = new Handler();
        this.f1798 = this.f13043 == 0;
        if (bundle != null) {
            this.f1795 = bundle.getInt("android:style", 0);
            this.f1796 = bundle.getInt("android:theme", 0);
            this.f1805 = bundle.getBoolean("android:cancelable", true);
            this.f1798 = bundle.getBoolean("android:showsDialog", this.f1798);
            this.f1807 = bundle.getInt("android:backStackId", -1);
        }
    }

    /* JADX INFO: renamed from: ˈˊˑˑ, reason: contains not printable characters */
    public final void m1440(boolean z) {
        if (this.f1808) {
            return;
        }
        this.f1808 = true;
        this.f1806 = false;
        Dialog dialog = this.f1797;
        if (dialog != null) {
            dialog.setOnDismissListener(null);
            this.f1797.dismiss();
            if (!z) {
                if (Looper.myLooper() == this.f1802.getLooper()) {
                    onDismiss(this.f1797);
                } else {
                    this.f1802.post(this.f1810);
                }
            }
        }
        this.f1800 = true;
        if (this.f1807 >= 0) {
            m7758().m2331(this.f1807, 1, true);
            this.f1807 = -1;
        } else {
            C0586 c0586 = new C0586(m7758());
            c0586.f2873 = true;
            c0586.m2208(this);
            c0586.m2217(true, true);
        }
    }

    /* JADX INFO: renamed from: ᵕʢ, reason: contains not printable characters */
    public Dialog mo1441(Bundle bundle) {
        if (AbstractC0651.m2324(3)) {
            toString();
        }
        return new DialogC1635(m7785(), this.f1796);
    }

    @Override // defpackage.AbstractComponentCallbacksC3393
    /* JADX INFO: renamed from: ᵕᵜʽᵰ, reason: contains not printable characters */
    public final void mo1442() {
        this.f13066 = true;
        if (!this.f1806 && !this.f1808) {
            this.f1808 = true;
        }
        this.f13073.m7560(this.f1799);
    }

    @Override // defpackage.AbstractComponentCallbacksC3393
    /* JADX INFO: renamed from: ᵘᵫᵡ, reason: contains not printable characters */
    public final void mo1443(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        Bundle bundle2;
        super.mo1443(layoutInflater, viewGroup, bundle);
        if (this.f13046 != null || this.f1797 == null || bundle == null || (bundle2 = bundle.getBundle("android:savedDialogState")) == null) {
            return;
        }
        this.f1797.onRestoreInstanceState(bundle2);
    }

    /* JADX WARN: Removed duplicated region for block: B:26:0x0046 A[Catch: all -> 0x004e, TryCatch #0 {all -> 0x004e, blocks: (B:12:0x0018, B:14:0x0024, B:24:0x003c, B:26:0x0046, B:29:0x0050, B:20:0x002e, B:22:0x0034, B:23:0x0039, B:30:0x0068), top: B:45:0x0018 }] */
    @Override // defpackage.AbstractComponentCallbacksC3393
    /* JADX INFO: renamed from: ᵟᵴᵥ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final LayoutInflater mo1444(Bundle bundle) {
        Context contextMo2403;
        LayoutInflater layoutInflaterMo1444 = super.mo1444(bundle);
        boolean z = this.f1798;
        if (z && !this.f1801) {
            if (z && !this.f1809) {
                try {
                    this.f1801 = true;
                    Dialog dialogMo1441 = mo1441(bundle);
                    this.f1797 = dialogMo1441;
                    if (this.f1798) {
                        int i = this.f1795;
                        if (i == 1 || i == 2) {
                            dialogMo1441.requestWindowFeature(1);
                            contextMo2403 = mo2403();
                            if (AbstractC0793.m2860(contextMo2403)) {
                                this.f1797.setOwnerActivity((Activity) contextMo2403);
                            }
                            this.f1797.setCancelable(this.f1805);
                            this.f1797.setOnCancelListener(this.f1804);
                            this.f1797.setOnDismissListener(this.f1803);
                            this.f1809 = true;
                        } else if (i == 3) {
                            Window window = dialogMo1441.getWindow();
                            if (window != null) {
                                window.addFlags(24);
                            }
                            dialogMo1441.requestWindowFeature(1);
                            contextMo2403 = mo2403();
                            if (AbstractC0793.m2860(contextMo2403)) {
                            }
                            this.f1797.setCancelable(this.f1805);
                            this.f1797.setOnCancelListener(this.f1804);
                            this.f1797.setOnDismissListener(this.f1803);
                            this.f1809 = true;
                        } else {
                            contextMo2403 = mo2403();
                            if (AbstractC0793.m2860(contextMo2403)) {
                            }
                            this.f1797.setCancelable(this.f1805);
                            this.f1797.setOnCancelListener(this.f1804);
                            this.f1797.setOnDismissListener(this.f1803);
                            this.f1809 = true;
                        }
                    } else {
                        this.f1797 = null;
                    }
                    this.f1801 = false;
                } catch (Throwable th) {
                    this.f1801 = false;
                    throw th;
                }
            }
            if (AbstractC0651.m2324(2)) {
                toString();
            }
            Dialog dialog = this.f1797;
            if (dialog != null) {
                return layoutInflaterMo1444.cloneInContext(dialog.getContext());
            }
        } else if (AbstractC0651.m2324(2)) {
            toString();
        }
        return layoutInflaterMo1444;
    }

    @Override // defpackage.AbstractComponentCallbacksC3393
    /* JADX INFO: renamed from: ᵣʚʿ, reason: contains not printable characters */
    public final void mo1445() {
        this.f13066 = true;
        Dialog dialog = this.f1797;
        if (dialog != null) {
            dialog.hide();
        }
    }

    @Override // defpackage.AbstractComponentCallbacksC3393
    /* JADX INFO: renamed from: ᵧᵠᵾ, reason: contains not printable characters */
    public final void mo1446(Bundle bundle) {
        Bundle bundle2;
        this.f13066 = true;
        if (this.f1797 == null || bundle == null || (bundle2 = bundle.getBundle("android:savedDialogState")) == null) {
            return;
        }
        this.f1797.onRestoreInstanceState(bundle2);
    }

    @Override // defpackage.AbstractComponentCallbacksC3393
    /* JADX INFO: renamed from: ᵧᵢᵴᵸ, reason: contains not printable characters */
    public final void mo1447(Context context) {
        super.mo1447(context);
        this.f13073.m7565(this.f1799);
        if (this.f1806) {
            return;
        }
        this.f1808 = false;
    }

    @Override // defpackage.AbstractComponentCallbacksC3393
    /* JADX INFO: renamed from: ᵮᵟᵡ, reason: contains not printable characters */
    public final void mo1448() {
        this.f13066 = true;
    }

    /* JADX INFO: renamed from: ᵴˀᵰʒ, reason: contains not printable characters */
    public final void m1449() {
        m1440(false);
    }
}
