package y5;

import E1.C0113u;
import E1.F;
import O1.C0225a;
import android.R;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.util.AttributeSet;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.databinding.DataBinderMapperImpl;
import androidx.lifecycle.C0518x;
import androidx.lifecycle.EnumC0509n;
import androidx.lifecycle.EnumC0510o;
import androidx.lifecycle.Z;
import d3.V0;
import h0.C1025z;
import h0.ComponentCallbacksC1023x;
import h0.P;
import h0.Y;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import n4.u0;
import r0.C1482a;
import t0.C1532a;
import y5.AbstractActivityC1764i;

/* JADX INFO: renamed from: y5.i, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public abstract class AbstractActivityC1764i extends d.m {

    /* JADX INFO: renamed from: P, reason: collision with root package name */
    public static final /* synthetic */ int f18991P = 0;

    /* JADX INFO: renamed from: K, reason: collision with root package name */
    public boolean f18994K;

    /* JADX INFO: renamed from: L, reason: collision with root package name */
    public boolean f18995L;

    /* JADX INFO: renamed from: N, reason: collision with root package name */
    public U.g f18997N;

    /* JADX INFO: renamed from: O, reason: collision with root package name */
    public F f18998O;

    /* JADX INFO: renamed from: I, reason: collision with root package name */
    public final V0 f18992I = new V0(17, new C1025z(this));

    /* JADX INFO: renamed from: J, reason: collision with root package name */
    public final C0518x f18993J = new C0518x(this);

    /* JADX INFO: renamed from: M, reason: collision with root package name */
    public boolean f18996M = true;

    public AbstractActivityC1764i() {
        ((C0225a) this.f11298u.f5011s).t("android:support:lifecycle", new d.d(this, 1));
        final int i = 0;
        J(new L.a(this) { // from class: h0.y

            /* JADX INFO: renamed from: b, reason: collision with root package name */
            public final /* synthetic */ AbstractActivityC1764i f13304b;

            {
                this.f13304b = this;
            }

            @Override // L.a
            public final void a(Object obj) {
                switch (i) {
                    case u0.f15495q /* 0 */:
                        this.f13304b.f18992I.p();
                        break;
                    default:
                        this.f13304b.f18992I.p();
                        break;
                }
            }
        });
        final int i5 = 1;
        this.D.add(new L.a(this) { // from class: h0.y

            /* JADX INFO: renamed from: b, reason: collision with root package name */
            public final /* synthetic */ AbstractActivityC1764i f13304b;

            {
                this.f13304b = this;
            }

            @Override // L.a
            public final void a(Object obj) {
                switch (i5) {
                    case u0.f15495q /* 0 */:
                        this.f13304b.f18992I.p();
                        break;
                    default:
                        this.f13304b.f18992I.p();
                        break;
                }
            }
        });
        K(new d.e(this, 1));
    }

    public static boolean P(P p3) {
        EnumC0510o enumC0510o = EnumC0510o.f8836s;
        boolean zP = false;
        for (ComponentCallbacksC1023x componentCallbacksC1023x : p3.f13069c.t()) {
            if (componentCallbacksC1023x != null) {
                C1025z c1025z = componentCallbacksC1023x.f13266L;
                if ((c1025z == null ? null : c1025z.f13309x) != null) {
                    zP |= P(componentCallbacksC1023x.n());
                }
                Y y8 = componentCallbacksC1023x.f13286g0;
                EnumC0510o enumC0510o2 = EnumC0510o.f8837t;
                if (y8 != null) {
                    y8.c();
                    if (y8.f13140u.f8849t.compareTo(enumC0510o2) >= 0) {
                        componentCallbacksC1023x.f13286g0.f13140u.J(enumC0510o);
                        zP = true;
                    }
                }
                if (componentCallbacksC1023x.f13285f0.f8849t.compareTo(enumC0510o2) >= 0) {
                    componentCallbacksC1023x.f13285f0.J(enumC0510o);
                    zP = true;
                }
            }
        }
        return zP;
    }

    public final U.g M() {
        U.g gVar = this.f18997N;
        if (gVar != null) {
            return gVar;
        }
        P6.g.h("binding");
        throw null;
    }

    public abstract int N();

    public final P O() {
        return ((C1025z) this.f18992I.f11784r).f13308w;
    }

    public final void Q(Bundle bundle) {
        super.onCreate(bundle);
        this.f18993J.H(EnumC0509n.ON_CREATE);
        P p3 = ((C1025z) this.f18992I.f11784r).f13308w;
        p3.H = false;
        p3.f13059I = false;
        p3.f13065O.f13106g = false;
        p3.u(1);
    }

    public final void R(o oVar) {
        String string;
        P6.g.e(oVar, "TVUiText");
        if (oVar instanceof m) {
            string = ((m) oVar).f19017a;
        } else {
            if (!(oVar instanceof n)) {
                throw new A6.b();
            }
            string = getString(((n) oVar).f19018a);
            P6.g.d(string, "getString(...)");
        }
        Toast.makeText(this, string, 0).show();
    }

    public abstract void S();

    /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
    /* JADX WARN: Failed to restore switch over string. Please report as a decompilation issue */
    /* JADX WARN: Removed duplicated region for block: B:28:0x0046  */
    @Override // android.app.Activity
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void dump(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) {
        super.dump(str, fileDescriptor, printWriter, strArr);
        if (strArr != null && strArr.length != 0) {
            String str2 = strArr[0];
            switch (str2.hashCode()) {
                case -645125871:
                    if (str2.equals("--translation") && Build.VERSION.SDK_INT >= 31) {
                        return;
                    }
                    break;
                case 100470631:
                    if (str2.equals("--dump-dumpable")) {
                        if (Build.VERSION.SDK_INT >= 33) {
                            return;
                        }
                    }
                    break;
                case 472614934:
                    if (str2.equals("--list-dumpables")) {
                    }
                    break;
                case 1159329357:
                    if (str2.equals("--contentcapture") && Build.VERSION.SDK_INT >= 29) {
                        return;
                    }
                    break;
                case 1455016274:
                    if (str2.equals("--autofill") && Build.VERSION.SDK_INT >= 26) {
                        return;
                    }
                    break;
            }
        }
        printWriter.print(str);
        printWriter.print("Local FragmentActivity ");
        printWriter.print(Integer.toHexString(System.identityHashCode(this)));
        printWriter.println(" State:");
        String str3 = str + "  ";
        printWriter.print(str3);
        printWriter.print("mCreated=");
        printWriter.print(this.f18994K);
        printWriter.print(" mResumed=");
        printWriter.print(this.f18995L);
        printWriter.print(" mStopped=");
        printWriter.print(this.f18996M);
        if (getApplication() != null) {
            Z zR = r();
            C0113u c0113u = C1532a.f16945c;
            P6.g.e(zR, "store");
            C1482a c1482a = C1482a.f16347b;
            P6.g.e(c1482a, "defaultCreationExtras");
            C2.a aVar = new C2.a(zR, c0113u, c1482a);
            P6.d dVarA = P6.n.a(C1532a.class);
            String strB = dVarA.b();
            if (strB == null) {
                throw new IllegalArgumentException("Local and anonymous classes can not be ViewModels");
            }
            q.j jVar = ((C1532a) aVar.v(dVarA, "androidx.lifecycle.ViewModelProvider.DefaultKey:".concat(strB))).f16946b;
            if (jVar.k() > 0) {
                printWriter.print(str3);
                printWriter.println("Loaders:");
                if (jVar.k() > 0) {
                    if (jVar.l(0) != null) {
                        throw new ClassCastException();
                    }
                    printWriter.print(str3);
                    printWriter.print("  #");
                    printWriter.print(jVar.h(0));
                    printWriter.print(": ");
                    throw null;
                }
            }
        }
        ((C1025z) this.f18992I.f11784r).f13308w.v(str, fileDescriptor, printWriter, strArr);
    }

    @Override // d.m, android.app.Activity
    public final void onActivityResult(int i, int i5, Intent intent) {
        this.f18992I.p();
        super.onActivityResult(i, i5, intent);
    }

    @Override // d.m, B.c, android.app.Activity
    public void onCreate(Bundle bundle) {
        Q(bundle);
        int iN = N();
        DataBinderMapperImpl dataBinderMapperImpl = U.c.f6640a;
        setContentView(iN);
        U.g gVarA = U.c.a((ViewGroup) getWindow().getDecorView().findViewById(R.id.content), 0, iN);
        P6.g.e(gVarA, "<set-?>");
        this.f18997N = gVarA;
        S();
    }

    @Override // android.app.Activity, android.view.LayoutInflater.Factory2
    public final View onCreateView(View view, String str, Context context, AttributeSet attributeSet) {
        View viewOnCreateView = ((C1025z) this.f18992I.f11784r).f13308w.f13072f.onCreateView(view, str, context, attributeSet);
        return viewOnCreateView == null ? super.onCreateView(view, str, context, attributeSet) : viewOnCreateView;
    }

    @Override // android.app.Activity
    public void onDestroy() {
        super.onDestroy();
        ((C1025z) this.f18992I.f11784r).f13308w.l();
        this.f18993J.H(EnumC0509n.ON_DESTROY);
    }

    @Override // d.m, android.app.Activity, android.view.Window.Callback
    public final boolean onMenuItemSelected(int i, MenuItem menuItem) {
        if (super.onMenuItemSelected(i, menuItem)) {
            return true;
        }
        if (i == 6) {
            return ((C1025z) this.f18992I.f11784r).f13308w.j();
        }
        return false;
    }

    @Override // android.app.Activity
    public void onPause() {
        super.onPause();
        this.f18995L = false;
        ((C1025z) this.f18992I.f11784r).f13308w.u(5);
        this.f18993J.H(EnumC0509n.ON_PAUSE);
    }

    @Override // android.app.Activity
    public final void onPostResume() {
        super.onPostResume();
        this.f18993J.H(EnumC0509n.ON_RESUME);
        P p3 = ((C1025z) this.f18992I.f11784r).f13308w;
        p3.H = false;
        p3.f13059I = false;
        p3.f13065O.f13106g = false;
        p3.u(7);
    }

    @Override // d.m, android.app.Activity
    public final void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
        this.f18992I.p();
        super.onRequestPermissionsResult(i, strArr, iArr);
    }

    @Override // android.app.Activity
    public final void onResume() {
        V0 v02 = this.f18992I;
        v02.p();
        super.onResume();
        this.f18995L = true;
        ((C1025z) v02.f11784r).f13308w.z(true);
    }

    @Override // android.app.Activity
    public final void onStart() {
        V0 v02 = this.f18992I;
        v02.p();
        super.onStart();
        this.f18996M = false;
        boolean z8 = this.f18994K;
        C1025z c1025z = (C1025z) v02.f11784r;
        if (!z8) {
            this.f18994K = true;
            P p3 = c1025z.f13308w;
            p3.H = false;
            p3.f13059I = false;
            p3.f13065O.f13106g = false;
            p3.u(4);
        }
        c1025z.f13308w.z(true);
        this.f18993J.H(EnumC0509n.ON_START);
        P p4 = c1025z.f13308w;
        p4.H = false;
        p4.f13059I = false;
        p4.f13065O.f13106g = false;
        p4.u(5);
    }

    @Override // android.app.Activity
    public final void onStateNotSaved() {
        this.f18992I.p();
    }

    @Override // android.app.Activity
    public final void onStop() {
        super.onStop();
        this.f18996M = true;
        while (P(O())) {
        }
        P p3 = ((C1025z) this.f18992I.f11784r).f13308w;
        p3.f13059I = true;
        p3.f13065O.f13106g = true;
        p3.u(4);
        this.f18993J.H(EnumC0509n.ON_STOP);
    }

    @Override // android.app.Activity, android.view.LayoutInflater.Factory
    public final View onCreateView(String str, Context context, AttributeSet attributeSet) {
        View viewOnCreateView = ((C1025z) this.f18992I.f11784r).f13308w.f13072f.onCreateView(null, str, context, attributeSet);
        return viewOnCreateView == null ? super.onCreateView(str, context, attributeSet) : viewOnCreateView;
    }
}
