package androidx.fragment.app;

import android.view.ViewGroup;
import androidx.lifecycle.AbstractC0424i;
import java.lang.reflect.Modifier;
import java.util.ArrayList;

/* renamed from: androidx.fragment.app.u */
/* loaded from: classes.dex */
public abstract class AbstractC0377u {

    /* renamed from: a */
    public final C0315i f1502a;

    /* renamed from: b */
    public final ClassLoader f1503b;

    /* renamed from: d */
    public int f1505d;

    /* renamed from: e */
    public int f1506e;

    /* renamed from: f */
    public int f1507f;

    /* renamed from: g */
    public int f1508g;

    /* renamed from: h */
    public int f1509h;

    /* renamed from: i */
    public boolean f1510i;

    /* renamed from: k */
    public String f1512k;

    /* renamed from: l */
    public int f1513l;

    /* renamed from: m */
    public CharSequence f1514m;

    /* renamed from: n */
    public int f1515n;

    /* renamed from: o */
    public CharSequence f1516o;

    /* renamed from: p */
    public ArrayList<String> f1517p;

    /* renamed from: q */
    public ArrayList<String> f1518q;

    /* renamed from: s */
    public ArrayList<Runnable> f1520s;

    /* renamed from: c */
    public ArrayList<C0378a> f1504c = new ArrayList<>();

    /* renamed from: j */
    public boolean f1511j = true;

    /* renamed from: r */
    public boolean f1519r = false;

    /* renamed from: androidx.fragment.app.u$a */
    /* loaded from: classes.dex */
    public static final class C0378a {

        /* renamed from: a */
        public int f1521a;

        /* renamed from: b */
        public Fragment f1522b;

        /* renamed from: c */
        public int f1523c;

        /* renamed from: d */
        public int f1524d;

        /* renamed from: e */
        public int f1525e;

        /* renamed from: f */
        public int f1526f;

        /* renamed from: g */
        public AbstractC0424i.EnumC0427c f1527g;

        /* renamed from: h */
        public AbstractC0424i.EnumC0427c f1528h;

        public C0378a() {
        }

        public C0378a(int i, Fragment fragment) {
            this.f1521a = i;
            this.f1522b = fragment;
            AbstractC0424i.EnumC0427c enumC0427c = AbstractC0424i.EnumC0427c.RESUMED;
            this.f1527g = enumC0427c;
            this.f1528h = enumC0427c;
        }
    }

    public AbstractC0377u(C0315i c0315i, ClassLoader classLoader) {
        this.f1502a = c0315i;
        this.f1503b = classLoader;
    }

    /* renamed from: b */
    public AbstractC0377u m3793b(int i, Fragment fragment, String str) {
        mo3788g(i, fragment, str, 1);
        return this;
    }

    /* renamed from: c */
    public AbstractC0377u m3792c(ViewGroup viewGroup, Fragment fragment, String str) {
        fragment.f1161J = viewGroup;
        return m3793b(viewGroup.getId(), fragment, str);
    }

    /* renamed from: d */
    public void m3791d(C0378a c0378a) {
        this.f1504c.add(c0378a);
        c0378a.f1523c = this.f1505d;
        c0378a.f1524d = this.f1506e;
        c0378a.f1525e = this.f1507f;
        c0378a.f1526f = this.f1508g;
    }

    /* renamed from: e */
    public abstract void mo3790e();

    /* renamed from: f */
    public AbstractC0377u m3789f() {
        if (this.f1510i) {
            throw new IllegalStateException("This transaction is already being added to the back stack");
        }
        this.f1511j = false;
        return this;
    }

    /* renamed from: g */
    public void mo3788g(int i, Fragment fragment, String str, int i2) {
        Class<?> cls = fragment.getClass();
        int modifiers = cls.getModifiers();
        if (cls.isAnonymousClass() || !Modifier.isPublic(modifiers) || (cls.isMemberClass() && !Modifier.isStatic(modifiers))) {
            throw new IllegalStateException("Fragment " + cls.getCanonicalName() + " must be a public static class to be  properly recreated from instance state.");
        }
        if (str != null) {
            String str2 = fragment.f1153B;
            if (str2 != null && !str.equals(str2)) {
                throw new IllegalStateException("Can't change tag of fragment " + fragment + ": was " + fragment.f1153B + " now " + str);
            }
            fragment.f1153B = str;
        }
        if (i != 0) {
            if (i == -1) {
                throw new IllegalArgumentException("Can't add fragment " + fragment + " with tag " + str + " to container view with no id");
            }
            int i3 = fragment.f1203z;
            if (i3 != 0 && i3 != i) {
                throw new IllegalStateException("Can't change container ID of fragment " + fragment + ": was " + fragment.f1203z + " now " + i);
            }
            fragment.f1203z = i;
            fragment.f1152A = i;
        }
        m3791d(new C0378a(i2, fragment));
    }

    /* renamed from: h */
    public AbstractC0377u m3787h(boolean z) {
        this.f1519r = z;
        return this;
    }
}