package androidx.fragment.app;

import android.animation.Animator;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Application;
import android.content.ComponentCallbacks;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.os.Looper;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.util.Log;
import android.util.SparseArray;
import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import androidx.lifecycle.f;
import androidx.lifecycle.x;
import androidx.savedstate.SavedStateRegistry;
import com.seewo.adbcommons.model.base.ICmdMsg;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;

/* JADX INFO: loaded from: classes.dex */
public class Fragment implements ComponentCallbacks, View.OnCreateContextMenuListener, androidx.lifecycle.l, androidx.lifecycle.z, androidx.savedstate.c {
    static final Object c0 = new Object();
    int A;
    int B;
    String C;
    boolean D;
    boolean E;
    boolean F;
    boolean G;
    boolean H;
    private boolean J;
    ViewGroup K;
    View L;
    boolean M;
    d O;
    boolean P;
    boolean Q;
    float R;
    LayoutInflater S;
    boolean T;
    androidx.lifecycle.m V;
    z W;
    private x.b Y;
    androidx.savedstate.b Z;
    private int a0;
    private final ArrayList<f> b0;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    Bundle f673f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    SparseArray<Parcelable> f674g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    Bundle f675h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    Boolean f676i;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    Bundle f678k;
    Fragment l;
    int n;
    boolean p;
    boolean q;
    boolean r;
    boolean s;
    boolean t;
    boolean u;
    int v;
    m w;
    j<?> x;
    Fragment z;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    int f672b = -1;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    String f677j = UUID.randomUUID().toString();
    String m = null;
    private Boolean o = null;
    m y = new n();
    boolean I = true;
    boolean N = true;
    f.c U = f.c.RESUMED;
    androidx.lifecycle.q<androidx.lifecycle.l> X = new androidx.lifecycle.q<>();

    class a implements Runnable {
        a() {
        }

        @Override // java.lang.Runnable
        public void run() {
            Fragment.this.b(false);
        }
    }

    class b implements Runnable {

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        final /* synthetic */ c0 f681b;

        b(Fragment fragment, c0 c0Var) {
            this.f681b = c0Var;
        }

        @Override // java.lang.Runnable
        public void run() {
            this.f681b.g();
        }
    }

    class c extends androidx.fragment.app.f {
        c() {
        }

        @Override // androidx.fragment.app.f
        public View f(int i2) {
            View view = Fragment.this.L;
            if (view != null) {
                return view.findViewById(i2);
            }
            throw new IllegalStateException("Fragment " + Fragment.this + " does not have a view");
        }

        @Override // androidx.fragment.app.f
        public boolean g() {
            return Fragment.this.L != null;
        }
    }

    static class d {
        View a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        Animator f682b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        int f683c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        int f684d;

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        ArrayList<String> f685e;

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        ArrayList<String> f686f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        Object f687g = null;

        /* JADX INFO: renamed from: h, reason: collision with root package name */
        Object f688h;

        /* JADX INFO: renamed from: i, reason: collision with root package name */
        Object f689i;

        /* JADX INFO: renamed from: j, reason: collision with root package name */
        Object f690j;

        /* JADX INFO: renamed from: k, reason: collision with root package name */
        Object f691k;
        Object l;
        Boolean m;
        Boolean n;
        androidx.core.app.f o;
        androidx.core.app.f p;
        float q;
        View r;
        boolean s;
        g t;
        boolean u;

        d() {
            Object obj = Fragment.c0;
            this.f688h = obj;
            this.f689i = null;
            this.f690j = obj;
            this.f691k = null;
            this.l = obj;
            this.o = null;
            this.p = null;
            this.q = 1.0f;
            this.r = null;
        }
    }

    public static class e extends RuntimeException {
        public e(String str, Exception exc) {
            super(str, exc);
        }
    }

    private static abstract class f {
        private f() {
        }

        abstract void a();
    }

    interface g {
        void a();

        void b();
    }

    public Fragment() {
        new AtomicInteger();
        this.b0 = new ArrayList<>();
        R();
    }

    private void R() {
        this.V = new androidx.lifecycle.m(this);
        this.Z = androidx.savedstate.b.a(this);
    }

    @Deprecated
    public static Fragment T(Context context, String str, Bundle bundle) {
        try {
            Fragment fragmentNewInstance = i.d(context.getClassLoader(), str).getConstructor(new Class[0]).newInstance(new Object[0]);
            if (bundle != null) {
                bundle.setClassLoader(fragmentNewInstance.getClass().getClassLoader());
                fragmentNewInstance.q1(bundle);
            }
            return fragmentNewInstance;
        } catch (IllegalAccessException e2) {
            throw new e("Unable to instantiate fragment " + str + ": make sure class name exists, is public, and has an empty constructor that is public", e2);
        } catch (InstantiationException e3) {
            throw new e("Unable to instantiate fragment " + str + ": make sure class name exists, is public, and has an empty constructor that is public", e3);
        } catch (NoSuchMethodException e4) {
            throw new e("Unable to instantiate fragment " + str + ": could not find Fragment constructor", e4);
        } catch (InvocationTargetException e5) {
            throw new e("Unable to instantiate fragment " + str + ": calling Fragment constructor caused an exception", e5);
        }
    }

    private d g() {
        if (this.O == null) {
            this.O = new d();
        }
        return this.O;
    }

    private void m1() {
        if (m.D0(3)) {
            Log.d("FragmentManager", "moveto RESTORE_VIEW_STATE: " + this);
        }
        if (this.L != null) {
            n1(this.f673f);
        }
        this.f673f = null;
    }

    private int z() {
        f.c cVar = this.U;
        return (cVar == f.c.INITIALIZED || this.z == null) ? this.U.ordinal() : Math.min(cVar.ordinal(), this.z.z());
    }

    int A() {
        d dVar = this.O;
        if (dVar == null) {
            return 0;
        }
        return dVar.f683c;
    }

    public void A0(boolean z) {
    }

    public void A1() {
        if (this.O == null || !g().s) {
            return;
        }
        if (this.x == null) {
            g().s = false;
        } else if (Looper.myLooper() != this.x.l().getLooper()) {
            this.x.l().postAtFrontOfQueue(new a());
        } else {
            b(true);
        }
    }

    int B() {
        d dVar = this.O;
        if (dVar == null) {
            return 0;
        }
        return dVar.f684d;
    }

    public void B0(Menu menu) {
    }

    public final Fragment C() {
        return this.z;
    }

    public void C0(boolean z) {
    }

    public final m D() {
        m mVar = this.w;
        if (mVar != null) {
            return mVar;
        }
        throw new IllegalStateException("Fragment " + this + " not associated with a fragment manager.");
    }

    @Deprecated
    public void D0(int i2, String[] strArr, int[] iArr) {
    }

    float E() {
        d dVar = this.O;
        if (dVar == null) {
            return 1.0f;
        }
        return dVar.q;
    }

    public void E0() {
        this.J = true;
    }

    public Object F() {
        d dVar = this.O;
        if (dVar == null) {
            return null;
        }
        Object obj = dVar.f690j;
        return obj == c0 ? u() : obj;
    }

    public void F0(Bundle bundle) {
    }

    public final Resources G() {
        return j1().getResources();
    }

    public void G0() {
        this.J = true;
    }

    public Object H() {
        d dVar = this.O;
        if (dVar == null) {
            return null;
        }
        Object obj = dVar.f688h;
        return obj == c0 ? s() : obj;
    }

    public void H0() {
        this.J = true;
    }

    public Object I() {
        d dVar = this.O;
        if (dVar == null) {
            return null;
        }
        return dVar.f691k;
    }

    public void I0(View view, Bundle bundle) {
    }

    public Object J() {
        d dVar = this.O;
        if (dVar == null) {
            return null;
        }
        Object obj = dVar.l;
        return obj == c0 ? I() : obj;
    }

    public void J0(Bundle bundle) {
        this.J = true;
    }

    ArrayList<String> K() {
        ArrayList<String> arrayList;
        d dVar = this.O;
        return (dVar == null || (arrayList = dVar.f685e) == null) ? new ArrayList<>() : arrayList;
    }

    void K0(Bundle bundle) {
        this.y.P0();
        this.f672b = 3;
        this.J = false;
        d0(bundle);
        if (this.J) {
            m1();
            this.y.y();
        } else {
            throw new e0("Fragment " + this + " did not call through to super.onActivityCreated()");
        }
    }

    ArrayList<String> L() {
        ArrayList<String> arrayList;
        d dVar = this.O;
        return (dVar == null || (arrayList = dVar.f686f) == null) ? new ArrayList<>() : arrayList;
    }

    void L0() {
        Iterator<f> it = this.b0.iterator();
        while (it.hasNext()) {
            it.next().a();
        }
        this.b0.clear();
        this.y.j(this.x, e(), this);
        this.f672b = 0;
        this.J = false;
        g0(this.x.k());
        if (this.J) {
            this.w.I(this);
            this.y.z();
        } else {
            throw new e0("Fragment " + this + " did not call through to super.onAttach()");
        }
    }

    public final String M(int i2) {
        return G().getString(i2);
    }

    void M0(Configuration configuration) {
        onConfigurationChanged(configuration);
        this.y.A(configuration);
    }

    public final String N(int i2, Object... objArr) {
        return G().getString(i2, objArr);
    }

    boolean N0(MenuItem menuItem) {
        if (this.D) {
            return false;
        }
        if (i0(menuItem)) {
            return true;
        }
        return this.y.B(menuItem);
    }

    @Deprecated
    public final Fragment O() {
        String str;
        Fragment fragment = this.l;
        if (fragment != null) {
            return fragment;
        }
        m mVar = this.w;
        if (mVar == null || (str = this.m) == null) {
            return null;
        }
        return mVar.f0(str);
    }

    void O0(Bundle bundle) {
        this.y.P0();
        this.f672b = 1;
        this.J = false;
        if (Build.VERSION.SDK_INT >= 19) {
            this.V.a(new androidx.lifecycle.j() { // from class: androidx.fragment.app.Fragment.5
                @Override // androidx.lifecycle.j
                public void d(androidx.lifecycle.l lVar, f.b bVar) {
                    View view;
                    if (bVar != f.b.ON_STOP || (view = Fragment.this.L) == null) {
                        return;
                    }
                    view.cancelPendingInputEvents();
                }
            });
        }
        this.Z.c(bundle);
        j0(bundle);
        this.T = true;
        if (this.J) {
            this.V.h(f.b.ON_CREATE);
            return;
        }
        throw new e0("Fragment " + this + " did not call through to super.onCreate()");
    }

    public View P() {
        return this.L;
    }

    boolean P0(Menu menu, MenuInflater menuInflater) {
        boolean z = false;
        if (this.D) {
            return false;
        }
        if (this.H && this.I) {
            z = true;
            m0(menu, menuInflater);
        }
        return z | this.y.D(menu, menuInflater);
    }

    public androidx.lifecycle.l Q() {
        z zVar = this.W;
        if (zVar != null) {
            return zVar;
        }
        throw new IllegalStateException("Can't access the Fragment View's LifecycleOwner when getView() is null i.e., before onCreateView() or after onDestroyView()");
    }

    void Q0(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        this.y.P0();
        this.u = true;
        this.W = new z();
        View viewN0 = n0(layoutInflater, viewGroup, bundle);
        this.L = viewN0;
        if (viewN0 == null) {
            if (this.W.f()) {
                throw new IllegalStateException("Called getViewLifecycleOwner() but onCreateView() returned null");
            }
            this.W = null;
        } else {
            this.W.e();
            androidx.lifecycle.a0.a(this.L, this.W);
            androidx.lifecycle.b0.a(this.L, this);
            androidx.savedstate.d.a(this.L, this.W);
            this.X.m(this.W);
        }
    }

    void R0() {
        this.y.E();
        this.V.h(f.b.ON_DESTROY);
        this.f672b = 0;
        this.J = false;
        this.T = false;
        o0();
        if (this.J) {
            return;
        }
        throw new e0("Fragment " + this + " did not call through to super.onDestroy()");
    }

    void S() {
        R();
        this.f677j = UUID.randomUUID().toString();
        this.p = false;
        this.q = false;
        this.r = false;
        this.s = false;
        this.t = false;
        this.v = 0;
        this.w = null;
        this.y = new n();
        this.x = null;
        this.A = 0;
        this.B = 0;
        this.C = null;
        this.D = false;
        this.E = false;
    }

    void S0() {
        this.y.F();
        if (this.L != null && this.W.a().b().isAtLeast(f.c.CREATED)) {
            this.W.b(f.b.ON_DESTROY);
        }
        this.f672b = 1;
        this.J = false;
        q0();
        if (this.J) {
            c.k.a.a.b(this).c();
            this.u = false;
        } else {
            throw new e0("Fragment " + this + " did not call through to super.onDestroyView()");
        }
    }

    void T0() {
        this.f672b = -1;
        this.J = false;
        r0();
        this.S = null;
        if (this.J) {
            if (this.y.C0()) {
                return;
            }
            this.y.E();
            this.y = new n();
            return;
        }
        throw new e0("Fragment " + this + " did not call through to super.onDetach()");
    }

    boolean U() {
        d dVar = this.O;
        if (dVar == null) {
            return false;
        }
        return dVar.u;
    }

    LayoutInflater U0(Bundle bundle) {
        LayoutInflater layoutInflaterS0 = s0(bundle);
        this.S = layoutInflaterS0;
        return layoutInflaterS0;
    }

    final boolean V() {
        return this.v > 0;
    }

    void V0() {
        onLowMemory();
        this.y.G();
    }

    public final boolean W() {
        m mVar;
        return this.I && ((mVar = this.w) == null || mVar.F0(this.z));
    }

    void W0(boolean z) {
        w0(z);
        this.y.H(z);
    }

    boolean X() {
        d dVar = this.O;
        if (dVar == null) {
            return false;
        }
        return dVar.s;
    }

    boolean X0(MenuItem menuItem) {
        if (this.D) {
            return false;
        }
        if (this.H && this.I && x0(menuItem)) {
            return true;
        }
        return this.y.J(menuItem);
    }

    public final boolean Y() {
        return this.q;
    }

    void Y0(Menu menu) {
        if (this.D) {
            return;
        }
        if (this.H && this.I) {
            y0(menu);
        }
        this.y.K(menu);
    }

    final boolean Z() {
        Fragment fragmentC = C();
        return fragmentC != null && (fragmentC.Y() || fragmentC.Z());
    }

    void Z0() {
        this.y.M();
        if (this.L != null) {
            this.W.b(f.b.ON_PAUSE);
        }
        this.V.h(f.b.ON_PAUSE);
        this.f672b = 6;
        this.J = false;
        z0();
        if (this.J) {
            return;
        }
        throw new e0("Fragment " + this + " did not call through to super.onPause()");
    }

    @Override // androidx.lifecycle.l
    public androidx.lifecycle.f a() {
        return this.V;
    }

    public final boolean a0() {
        return this.f672b >= 7;
    }

    void a1(boolean z) {
        A0(z);
        this.y.N(z);
    }

    void b(boolean z) {
        ViewGroup viewGroup;
        m mVar;
        d dVar = this.O;
        g gVar = null;
        if (dVar != null) {
            dVar.s = false;
            g gVar2 = dVar.t;
            dVar.t = null;
            gVar = gVar2;
        }
        if (gVar != null) {
            gVar.a();
            return;
        }
        if (!m.P || this.L == null || (viewGroup = this.K) == null || (mVar = this.w) == null) {
            return;
        }
        c0 c0VarN = c0.n(viewGroup, mVar);
        c0VarN.p();
        if (z) {
            this.x.l().post(new b(this, c0VarN));
        } else {
            c0VarN.g();
        }
    }

    public final boolean b0() {
        m mVar = this.w;
        if (mVar == null) {
            return false;
        }
        return mVar.I0();
    }

    boolean b1(Menu menu) {
        boolean z = false;
        if (this.D) {
            return false;
        }
        if (this.H && this.I) {
            z = true;
            B0(menu);
        }
        return z | this.y.O(menu);
    }

    void c0() {
        this.y.P0();
    }

    void c1() {
        boolean zG0 = this.w.G0(this);
        Boolean bool = this.o;
        if (bool == null || bool.booleanValue() != zG0) {
            this.o = Boolean.valueOf(zG0);
            C0(zG0);
            this.y.P();
        }
    }

    @Override // androidx.savedstate.c
    public final SavedStateRegistry d() {
        return this.Z.b();
    }

    @Deprecated
    public void d0(Bundle bundle) {
        this.J = true;
    }

    void d1() {
        this.y.P0();
        this.y.a0(true);
        this.f672b = 7;
        this.J = false;
        E0();
        if (this.J) {
            this.V.h(f.b.ON_RESUME);
            if (this.L != null) {
                this.W.b(f.b.ON_RESUME);
            }
            this.y.Q();
            return;
        }
        throw new e0("Fragment " + this + " did not call through to super.onResume()");
    }

    androidx.fragment.app.f e() {
        return new c();
    }

    @Deprecated
    public void e0(int i2, int i3, Intent intent) {
        if (m.D0(2)) {
            Log.v("FragmentManager", "Fragment " + this + " received the following in onActivityResult(): requestCode: " + i2 + " resultCode: " + i3 + " data: " + intent);
        }
    }

    void e1(Bundle bundle) {
        F0(bundle);
        this.Z.d(bundle);
        Parcelable parcelableC1 = this.y.c1();
        if (parcelableC1 != null) {
            bundle.putParcelable("android:support:fragments", parcelableC1);
        }
    }

    public final boolean equals(Object obj) {
        return super.equals(obj);
    }

    public void f(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) {
        printWriter.print(str);
        printWriter.print("mFragmentId=#");
        printWriter.print(Integer.toHexString(this.A));
        printWriter.print(" mContainerId=#");
        printWriter.print(Integer.toHexString(this.B));
        printWriter.print(" mTag=");
        printWriter.println(this.C);
        printWriter.print(str);
        printWriter.print("mState=");
        printWriter.print(this.f672b);
        printWriter.print(" mWho=");
        printWriter.print(this.f677j);
        printWriter.print(" mBackStackNesting=");
        printWriter.println(this.v);
        printWriter.print(str);
        printWriter.print("mAdded=");
        printWriter.print(this.p);
        printWriter.print(" mRemoving=");
        printWriter.print(this.q);
        printWriter.print(" mFromLayout=");
        printWriter.print(this.r);
        printWriter.print(" mInLayout=");
        printWriter.println(this.s);
        printWriter.print(str);
        printWriter.print("mHidden=");
        printWriter.print(this.D);
        printWriter.print(" mDetached=");
        printWriter.print(this.E);
        printWriter.print(" mMenuVisible=");
        printWriter.print(this.I);
        printWriter.print(" mHasMenu=");
        printWriter.println(this.H);
        printWriter.print(str);
        printWriter.print("mRetainInstance=");
        printWriter.print(this.F);
        printWriter.print(" mUserVisibleHint=");
        printWriter.println(this.N);
        if (this.w != null) {
            printWriter.print(str);
            printWriter.print("mFragmentManager=");
            printWriter.println(this.w);
        }
        if (this.x != null) {
            printWriter.print(str);
            printWriter.print("mHost=");
            printWriter.println(this.x);
        }
        if (this.z != null) {
            printWriter.print(str);
            printWriter.print("mParentFragment=");
            printWriter.println(this.z);
        }
        if (this.f678k != null) {
            printWriter.print(str);
            printWriter.print("mArguments=");
            printWriter.println(this.f678k);
        }
        if (this.f673f != null) {
            printWriter.print(str);
            printWriter.print("mSavedFragmentState=");
            printWriter.println(this.f673f);
        }
        if (this.f674g != null) {
            printWriter.print(str);
            printWriter.print("mSavedViewState=");
            printWriter.println(this.f674g);
        }
        if (this.f675h != null) {
            printWriter.print(str);
            printWriter.print("mSavedViewRegistryState=");
            printWriter.println(this.f675h);
        }
        Fragment fragmentO = O();
        if (fragmentO != null) {
            printWriter.print(str);
            printWriter.print("mTarget=");
            printWriter.print(fragmentO);
            printWriter.print(" mTargetRequestCode=");
            printWriter.println(this.n);
        }
        if (A() != 0) {
            printWriter.print(str);
            printWriter.print("mNextAnim=");
            printWriter.println(A());
        }
        if (this.K != null) {
            printWriter.print(str);
            printWriter.print("mContainer=");
            printWriter.println(this.K);
        }
        if (this.L != null) {
            printWriter.print(str);
            printWriter.print("mView=");
            printWriter.println(this.L);
        }
        if (m() != null) {
            printWriter.print(str);
            printWriter.print("mAnimatingAway=");
            printWriter.println(m());
        }
        if (q() != null) {
            c.k.a.a.b(this).a(str, fileDescriptor, printWriter, strArr);
        }
        printWriter.print(str);
        printWriter.println("Child " + this.y + ":");
        this.y.W(str + "  ", fileDescriptor, printWriter, strArr);
    }

    @Deprecated
    public void f0(Activity activity) {
        this.J = true;
    }

    void f1() {
        this.y.P0();
        this.y.a0(true);
        this.f672b = 5;
        this.J = false;
        G0();
        if (this.J) {
            this.V.h(f.b.ON_START);
            if (this.L != null) {
                this.W.b(f.b.ON_START);
            }
            this.y.R();
            return;
        }
        throw new e0("Fragment " + this + " did not call through to super.onStart()");
    }

    public void g0(Context context) {
        this.J = true;
        j<?> jVar = this.x;
        Activity activityI = jVar == null ? null : jVar.i();
        if (activityI != null) {
            this.J = false;
            f0(activityI);
        }
    }

    void g1() {
        this.y.T();
        if (this.L != null) {
            this.W.b(f.b.ON_STOP);
        }
        this.V.h(f.b.ON_STOP);
        this.f672b = 4;
        this.J = false;
        H0();
        if (this.J) {
            return;
        }
        throw new e0("Fragment " + this + " did not call through to super.onStop()");
    }

    Fragment h(String str) {
        return str.equals(this.f677j) ? this : this.y.i0(str);
    }

    @Deprecated
    public void h0(Fragment fragment) {
    }

    void h1() {
        I0(this.L, this.f673f);
        this.y.U();
    }

    public final int hashCode() {
        return super.hashCode();
    }

    public final androidx.fragment.app.d i() {
        j<?> jVar = this.x;
        if (jVar == null) {
            return null;
        }
        return (androidx.fragment.app.d) jVar.i();
    }

    public boolean i0(MenuItem menuItem) {
        return false;
    }

    public final androidx.fragment.app.d i1() {
        androidx.fragment.app.d dVarI = i();
        if (dVarI != null) {
            return dVarI;
        }
        throw new IllegalStateException("Fragment " + this + " not attached to an activity.");
    }

    @Override // androidx.lifecycle.z
    public androidx.lifecycle.y j() {
        if (this.w == null) {
            throw new IllegalStateException("Can't access ViewModels from detached fragment");
        }
        if (z() != f.c.INITIALIZED.ordinal()) {
            return this.w.z0(this);
        }
        throw new IllegalStateException("Calling getViewModelStore() before a Fragment reaches onCreate() when using setMaxLifecycle(INITIALIZED) is not supported");
    }

    public void j0(Bundle bundle) {
        this.J = true;
        l1(bundle);
        if (this.y.H0(1)) {
            return;
        }
        this.y.C();
    }

    public final Context j1() {
        Context contextQ = q();
        if (contextQ != null) {
            return contextQ;
        }
        throw new IllegalStateException("Fragment " + this + " not attached to a context.");
    }

    public boolean k() {
        Boolean bool;
        d dVar = this.O;
        if (dVar == null || (bool = dVar.n) == null) {
            return true;
        }
        return bool.booleanValue();
    }

    public Animation k0(int i2, boolean z, int i3) {
        return null;
    }

    public final View k1() {
        View viewP = P();
        if (viewP != null) {
            return viewP;
        }
        throw new IllegalStateException("Fragment " + this + " did not return a View from onCreateView() or this was called before onCreateView().");
    }

    public boolean l() {
        Boolean bool;
        d dVar = this.O;
        if (dVar == null || (bool = dVar.m) == null) {
            return true;
        }
        return bool.booleanValue();
    }

    public Animator l0(int i2, boolean z, int i3) {
        return null;
    }

    void l1(Bundle bundle) {
        Parcelable parcelable;
        if (bundle == null || (parcelable = bundle.getParcelable("android:support:fragments")) == null) {
            return;
        }
        this.y.a1(parcelable);
        this.y.C();
    }

    View m() {
        d dVar = this.O;
        if (dVar == null) {
            return null;
        }
        return dVar.a;
    }

    public void m0(Menu menu, MenuInflater menuInflater) {
    }

    Animator n() {
        d dVar = this.O;
        if (dVar == null) {
            return null;
        }
        return dVar.f682b;
    }

    public View n0(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        int i2 = this.a0;
        if (i2 != 0) {
            return layoutInflater.inflate(i2, viewGroup, false);
        }
        return null;
    }

    final void n1(Bundle bundle) {
        SparseArray<Parcelable> sparseArray = this.f674g;
        if (sparseArray != null) {
            this.L.restoreHierarchyState(sparseArray);
            this.f674g = null;
        }
        if (this.L != null) {
            this.W.g(this.f675h);
            this.f675h = null;
        }
        this.J = false;
        J0(bundle);
        if (this.J) {
            if (this.L != null) {
                this.W.b(f.b.ON_CREATE);
            }
        } else {
            throw new e0("Fragment " + this + " did not call through to super.onViewStateRestored()");
        }
    }

    public final Bundle o() {
        return this.f678k;
    }

    public void o0() {
        this.J = true;
    }

    void o1(View view) {
        g().a = view;
    }

    @Override // android.content.ComponentCallbacks
    public void onConfigurationChanged(Configuration configuration) {
        this.J = true;
    }

    @Override // android.view.View.OnCreateContextMenuListener
    public void onCreateContextMenu(ContextMenu contextMenu, View view, ContextMenu.ContextMenuInfo contextMenuInfo) {
        i1().onCreateContextMenu(contextMenu, view, contextMenuInfo);
    }

    @Override // android.content.ComponentCallbacks
    public void onLowMemory() {
        this.J = true;
    }

    public final m p() {
        if (this.x != null) {
            return this.y;
        }
        throw new IllegalStateException("Fragment " + this + " has not been attached yet.");
    }

    public void p0() {
    }

    void p1(Animator animator) {
        g().f682b = animator;
    }

    public Context q() {
        j<?> jVar = this.x;
        if (jVar == null) {
            return null;
        }
        return jVar.k();
    }

    public void q0() {
        this.J = true;
    }

    public void q1(Bundle bundle) {
        if (this.w != null && b0()) {
            throw new IllegalStateException("Fragment already added and state has been saved");
        }
        this.f678k = bundle;
    }

    public x.b r() {
        if (this.w == null) {
            throw new IllegalStateException("Can't access ViewModels from detached fragment");
        }
        if (this.Y == null) {
            Application application = null;
            Context applicationContext = j1().getApplicationContext();
            while (true) {
                if (!(applicationContext instanceof ContextWrapper)) {
                    break;
                }
                if (applicationContext instanceof Application) {
                    application = (Application) applicationContext;
                    break;
                }
                applicationContext = ((ContextWrapper) applicationContext).getBaseContext();
            }
            if (application == null && m.D0(3)) {
                Log.d("FragmentManager", "Could not find Application instance from Context " + j1().getApplicationContext() + ", you will not be able to use AndroidViewModel with the default ViewModelProvider.Factory");
            }
            this.Y = new androidx.lifecycle.u(application, this, o());
        }
        return this.Y;
    }

    public void r0() {
        this.J = true;
    }

    void r1(View view) {
        g().r = view;
    }

    public Object s() {
        d dVar = this.O;
        if (dVar == null) {
            return null;
        }
        return dVar.f687g;
    }

    public LayoutInflater s0(Bundle bundle) {
        return y(bundle);
    }

    void s1(boolean z) {
        g().u = z;
    }

    androidx.core.app.f t() {
        d dVar = this.O;
        if (dVar == null) {
            return null;
        }
        return dVar.o;
    }

    public void t0(boolean z) {
    }

    void t1(int i2) {
        if (this.O == null && i2 == 0) {
            return;
        }
        g().f683c = i2;
    }

    public String toString() {
        StringBuilder sb = new StringBuilder(ICmdMsg.ACTION_START_ACTIVITY);
        sb.append(getClass().getSimpleName());
        sb.append("{");
        sb.append(Integer.toHexString(System.identityHashCode(this)));
        sb.append("}");
        sb.append(" (");
        sb.append(this.f677j);
        sb.append(")");
        if (this.A != 0) {
            sb.append(" id=0x");
            sb.append(Integer.toHexString(this.A));
        }
        if (this.C != null) {
            sb.append(" ");
            sb.append(this.C);
        }
        sb.append('}');
        return sb.toString();
    }

    public Object u() {
        d dVar = this.O;
        if (dVar == null) {
            return null;
        }
        return dVar.f689i;
    }

    @Deprecated
    public void u0(Activity activity, AttributeSet attributeSet, Bundle bundle) {
        this.J = true;
    }

    void u1(int i2) {
        if (this.O == null && i2 == 0) {
            return;
        }
        g();
        this.O.f684d = i2;
    }

    androidx.core.app.f v() {
        d dVar = this.O;
        if (dVar == null) {
            return null;
        }
        return dVar.p;
    }

    public void v0(Context context, AttributeSet attributeSet, Bundle bundle) {
        this.J = true;
        j<?> jVar = this.x;
        Activity activityI = jVar == null ? null : jVar.i();
        if (activityI != null) {
            this.J = false;
            u0(activityI, attributeSet, bundle);
        }
    }

    void v1(g gVar) {
        g();
        g gVar2 = this.O.t;
        if (gVar == gVar2) {
            return;
        }
        if (gVar != null && gVar2 != null) {
            throw new IllegalStateException("Trying to set a replacement startPostponedEnterTransition on " + this);
        }
        d dVar = this.O;
        if (dVar.s) {
            dVar.t = gVar;
        }
        if (gVar != null) {
            gVar.b();
        }
    }

    View w() {
        d dVar = this.O;
        if (dVar == null) {
            return null;
        }
        return dVar.r;
    }

    public void w0(boolean z) {
    }

    void w1(float f2) {
        g().q = f2;
    }

    public final Object x() {
        j<?> jVar = this.x;
        if (jVar == null) {
            return null;
        }
        return jVar.m();
    }

    public boolean x0(MenuItem menuItem) {
        return false;
    }

    void x1(ArrayList<String> arrayList, ArrayList<String> arrayList2) {
        g();
        d dVar = this.O;
        dVar.f685e = arrayList;
        dVar.f686f = arrayList2;
    }

    @Deprecated
    public LayoutInflater y(Bundle bundle) {
        j<?> jVar = this.x;
        if (jVar == null) {
            throw new IllegalStateException("onGetLayoutInflater() cannot be executed until the Fragment is attached to the FragmentManager.");
        }
        LayoutInflater layoutInflaterN = jVar.n();
        c.f.l.f.b(layoutInflaterN, this.y.t0());
        return layoutInflaterN;
    }

    public void y0(Menu menu) {
    }

    @Deprecated
    public void y1(@SuppressLint({"UnknownNullness"}) Intent intent, int i2) {
        z1(intent, i2, null);
    }

    public void z0() {
        this.J = true;
    }

    @Deprecated
    public void z1(@SuppressLint({"UnknownNullness"}) Intent intent, int i2, Bundle bundle) {
        if (this.x != null) {
            D().J0(this, intent, i2, bundle);
            return;
        }
        throw new IllegalStateException("Fragment " + this + " not attached to Activity");
    }
}
