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.window.OnBackInvokedDispatcher;
import com.google.android.gms.common.R;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.Kj, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public class DialogC0269Kj extends Dialog implements InterfaceC0898cL, FT, InterfaceC1925n40 {
    public C1089eL l;
    public final C1735l40 m;
    public final C1014dc0 n;

    /* renamed from: o, reason: collision with root package name */
    public final C1014dc0 f196o;

    public DialogC0269Kj(Context context, int i) {
        super(context, i);
        this.m = new C1735l40(new C1830m40(this, new C1164f5(16, this)));
        final int i2 = 0;
        this.n = new C1014dc0(new NC(this) { // from class: o.Jj
            public final /* synthetic */ DialogC0269Kj m;

            {
                this.m = this;
            }

            @Override // o.NC
            public final Object a() {
                switch (i2) {
                    case 0:
                        C0666Zr c0666Zr = new C0666Zr();
                        this.m.getOnBackPressedDispatcher().b.a(c0666Zr);
                        return c0666Zr;
                    default:
                        return new ET(new RunnableC2108p1(7, this.m));
                }
            }
        });
        final int i3 = 1;
        this.f196o = new C1014dc0(new NC(this) { // from class: o.Jj
            public final /* synthetic */ DialogC0269Kj m;

            {
                this.m = this;
            }

            @Override // o.NC
            public final Object a() {
                switch (i3) {
                    case 0:
                        C0666Zr c0666Zr = new C0666Zr();
                        this.m.getOnBackPressedDispatcher().b.a(c0666Zr);
                        return c0666Zr;
                    default:
                        return new ET(new RunnableC2108p1(7, this.m));
                }
            }
        });
    }

    public static void a(DialogC0269Kj dialogC0269Kj) {
        super.onBackPressed();
    }

    @Override // android.app.Dialog
    public void addContentView(View view, ViewGroup.LayoutParams layoutParams) {
        b();
        super.addContentView(view, layoutParams);
    }

    public final void b() {
        AbstractC2461sm0.D(getWindow().getDecorView(), this);
        getWindow().getDecorView().setTag(R.id.view_tree_on_back_pressed_dispatcher_owner, this);
        AbstractC2841wm0.C(getWindow().getDecorView(), this);
        getWindow().getDecorView().setTag(R.id.view_tree_navigation_event_dispatcher_owner, this);
    }

    @Override // o.InterfaceC0898cL
    public final WK getLifecycle() {
        C1089eL c1089eL = this.l;
        if (c1089eL != null) {
            return c1089eL;
        }
        C1089eL c1089eL2 = new C1089eL(this);
        this.l = c1089eL2;
        return c1089eL2;
    }

    @Override // o.FT
    public final ET getOnBackPressedDispatcher() {
        return (ET) this.f196o.getValue();
    }

    @Override // o.InterfaceC1925n40
    public final C1640k40 getSavedStateRegistry() {
        return this.m.b;
    }

    @Override // android.app.Dialog
    public final void onBackPressed() {
        ((C0666Zr) this.n.getValue()).a();
    }

    @Override // android.app.Dialog
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        if (Build.VERSION.SDK_INT >= 33) {
            ET onBackPressedDispatcher = getOnBackPressedDispatcher();
            OnBackInvokedDispatcher onBackInvokedDispatcher = getOnBackInvokedDispatcher();
            C2807wR c2807wR = onBackPressedDispatcher.b;
            c2807wR.b(new C2999yT(onBackInvokedDispatcher, 0), 1);
            c2807wR.b(new C2999yT(onBackInvokedDispatcher, 1000000), 0);
        }
        this.m.a(bundle);
        C1089eL c1089eL = this.l;
        if (c1089eL == null) {
            c1089eL = new C1089eL(this);
            this.l = c1089eL;
        }
        c1089eL.f(UK.ON_CREATE);
    }

    @Override // android.app.Dialog
    public final Bundle onSaveInstanceState() {
        Bundle bundleOnSaveInstanceState = super.onSaveInstanceState();
        this.m.b(bundleOnSaveInstanceState);
        return bundleOnSaveInstanceState;
    }

    @Override // android.app.Dialog
    public final void onStart() {
        super.onStart();
        C1089eL c1089eL = this.l;
        if (c1089eL == null) {
            c1089eL = new C1089eL(this);
            this.l = c1089eL;
        }
        c1089eL.f(UK.ON_RESUME);
    }

    @Override // android.app.Dialog
    public void onStop() {
        C1089eL c1089eL = this.l;
        if (c1089eL == null) {
            c1089eL = new C1089eL(this);
            this.l = c1089eL;
        }
        c1089eL.f(UK.ON_DESTROY);
        this.l = null;
        super.onStop();
    }

    @Override // android.app.Dialog
    public void setContentView(int i) {
        b();
        super.setContentView(i);
    }

    @Override // android.app.Dialog
    public void setContentView(View view) {
        b();
        super.setContentView(view);
    }

    @Override // android.app.Dialog
    public void setContentView(View view, ViewGroup.LayoutParams layoutParams) {
        b();
        super.setContentView(view, layoutParams);
    }
}
