package androidx.fragment.app;

import X6FRs_4.KNBe_11.RfjZ_21;
import X6FRs_4.XnFJ5_9.KQgRr5e_0.FSaI4_7;
import X6FRs_4.XnFJ5_9.KQgRr5e_0.IMuAHx_6;
import X6FRs_4.XnFJ5_9.KQgRr5e_0.PGPF6hQ_2;
import X6FRs_4.XnFJ5_9.KQgRr5e_0.X6FRs_4;
import android.content.Context;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;
/* loaded from: classes.dex */
public final class FragmentState implements Parcelable {
    public static final Parcelable.Creator<FragmentState> CREATOR = new KQgRr5e_0();
    public final int KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final Bundle f2341KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public Fragment f2342KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final String f2343KQgRr5e_0;

    /* renamed from: Mqv2r_3  reason: collision with root package name */
    public final boolean f3529Mqv2r_3;
    public final int PGPF6hQ_2;

    /* renamed from: PGPF6hQ_2  reason: collision with other field name */
    public final boolean f2344PGPF6hQ_2;
    public final int QxJ9d_1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public Bundle f2345QxJ9d_1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public final String f2346QxJ9d_1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public final boolean f2347QxJ9d_1;

    /* renamed from: X6FRs_4  reason: collision with root package name */
    public final boolean f3530X6FRs_4;

    /* loaded from: classes.dex */
    public static class KQgRr5e_0 implements Parcelable.Creator<FragmentState> {
        @Override // android.os.Parcelable.Creator
        /* renamed from: KQgRr5e_0 */
        public FragmentState createFromParcel(Parcel parcel) {
            return new FragmentState(parcel);
        }

        @Override // android.os.Parcelable.Creator
        /* renamed from: KQgRr5e_0 */
        public FragmentState[] newArray(int i) {
            return new FragmentState[i];
        }
    }

    public FragmentState(Fragment fragment) {
        this.f2343KQgRr5e_0 = fragment.getClass().getName();
        this.KQgRr5e_0 = fragment.mIndex;
        this.f2347QxJ9d_1 = fragment.mFromLayout;
        this.QxJ9d_1 = fragment.mFragmentId;
        this.PGPF6hQ_2 = fragment.mContainerId;
        this.f2346QxJ9d_1 = fragment.mTag;
        this.f2344PGPF6hQ_2 = fragment.mRetainInstance;
        this.f3529Mqv2r_3 = fragment.mDetached;
        this.f2341KQgRr5e_0 = fragment.mArguments;
        this.f3530X6FRs_4 = fragment.mHidden;
    }

    public Fragment KQgRr5e_0(X6FRs_4 x6FRs_4, PGPF6hQ_2 pGPF6hQ_2, Fragment fragment, FSaI4_7 fSaI4_7, RfjZ_21 rfjZ_21) {
        if (this.f2342KQgRr5e_0 == null) {
            Context KQgRr5e_02 = x6FRs_4.KQgRr5e_0();
            Bundle bundle = this.f2341KQgRr5e_0;
            if (bundle != null) {
                bundle.setClassLoader(KQgRr5e_02.getClassLoader());
            }
            if (pGPF6hQ_2 != null) {
                this.f2342KQgRr5e_0 = pGPF6hQ_2.KQgRr5e_0(KQgRr5e_02, this.f2343KQgRr5e_0, this.f2341KQgRr5e_0);
            } else {
                this.f2342KQgRr5e_0 = Fragment.instantiate(KQgRr5e_02, this.f2343KQgRr5e_0, this.f2341KQgRr5e_0);
            }
            Bundle bundle2 = this.f2345QxJ9d_1;
            if (bundle2 != null) {
                bundle2.setClassLoader(KQgRr5e_02.getClassLoader());
                this.f2342KQgRr5e_0.mSavedFragmentState = this.f2345QxJ9d_1;
            }
            this.f2342KQgRr5e_0.setIndex(this.KQgRr5e_0, fragment);
            Fragment fragment2 = this.f2342KQgRr5e_0;
            fragment2.mFromLayout = this.f2347QxJ9d_1;
            fragment2.mRestored = true;
            fragment2.mFragmentId = this.QxJ9d_1;
            fragment2.mContainerId = this.PGPF6hQ_2;
            fragment2.mTag = this.f2346QxJ9d_1;
            fragment2.mRetainInstance = this.f2344PGPF6hQ_2;
            fragment2.mDetached = this.f3529Mqv2r_3;
            fragment2.mHidden = this.f3530X6FRs_4;
            fragment2.mFragmentManager = x6FRs_4.KQgRr5e_0;
            if (IMuAHx_6.f3314FSaI4_7) {
                Log.v("FragmentManager", "Instantiated fragment " + this.f2342KQgRr5e_0);
            }
        }
        Fragment fragment3 = this.f2342KQgRr5e_0;
        fragment3.mChildNonConfig = fSaI4_7;
        fragment3.mViewModelStore = rfjZ_21;
        return fragment3;
    }

    @Override // android.os.Parcelable
    public int describeContents() {
        return 0;
    }

    @Override // android.os.Parcelable
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(this.f2343KQgRr5e_0);
        parcel.writeInt(this.KQgRr5e_0);
        parcel.writeInt(this.f2347QxJ9d_1 ? 1 : 0);
        parcel.writeInt(this.QxJ9d_1);
        parcel.writeInt(this.PGPF6hQ_2);
        parcel.writeString(this.f2346QxJ9d_1);
        parcel.writeInt(this.f2344PGPF6hQ_2 ? 1 : 0);
        parcel.writeInt(this.f3529Mqv2r_3 ? 1 : 0);
        parcel.writeBundle(this.f2341KQgRr5e_0);
        parcel.writeInt(this.f3530X6FRs_4 ? 1 : 0);
        parcel.writeBundle(this.f2345QxJ9d_1);
    }

    public FragmentState(Parcel parcel) {
        this.f2343KQgRr5e_0 = parcel.readString();
        this.KQgRr5e_0 = parcel.readInt();
        this.f2347QxJ9d_1 = parcel.readInt() != 0;
        this.QxJ9d_1 = parcel.readInt();
        this.PGPF6hQ_2 = parcel.readInt();
        this.f2346QxJ9d_1 = parcel.readString();
        this.f2344PGPF6hQ_2 = parcel.readInt() != 0;
        this.f3529Mqv2r_3 = parcel.readInt() != 0;
        this.f2341KQgRr5e_0 = parcel.readBundle();
        this.f3530X6FRs_4 = parcel.readInt() != 0;
        this.f2345QxJ9d_1 = parcel.readBundle();
    }
}
