package C0;

import V.C0629x;
import V.EnumC0616j;
import V.i0;
import V4.B0;
import e.C1957k;
import e.C1958l;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ScheduledFuture;
import k4.AbstractC2395h;
import k4.r0;
import k4.w0;
import m4.C2537q0;
import m4.C2548u0;
import m4.RunnableC2531o0;
import m4.RunnableC2542s0;
import m4.Z0;
import n.C2592t;

/* JADX INFO: renamed from: C0.j, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0109j implements androidx.lifecycle.G, Z0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f605a;

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public Object f607c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public Object f608d;

    @Override // androidx.lifecycle.G
    public void a(Object obj) {
        this.f606b = true;
        ((androidx.loader.app.a) this.f608d).onLoadFinished((g2.e) this.f607c, obj);
    }

    public boolean b(long j4) {
        Object obj;
        ArrayList arrayList = (ArrayList) ((T.p) this.f608d).f6345b;
        int size = arrayList.size();
        int i6 = 0;
        while (true) {
            if (i6 >= size) {
                obj = null;
                break;
            }
            obj = arrayList.get(i6);
            if (AbstractC0123y.e(((C) obj).f507a, j4)) {
                break;
            }
            i6++;
        }
        C c6 = (C) obj;
        if (c6 != null) {
            return c6.f514h;
        }
        return false;
    }

    public void c() {
        ((X4.e) this.f607c).j(new CancellationException("onBack cancelled"), true);
        ((B0) this.f608d).cancel(null);
    }

    public EnumC0616j d() {
        C0629x c0629x = (C0629x) this.f608d;
        int i6 = c0629x.f7177b;
        int i7 = c0629x.f7178c;
        return i6 < i7 ? EnumC0616j.f7107b : i6 > i7 ? EnumC0616j.f7106a : EnumC0616j.f7108c;
    }

    public void e() {
        if (this.f606b) {
            i0.b((i0) this.f608d, (T0.N) this.f607c);
        }
    }

    public void f(ScheduledFuture scheduledFuture) {
        synchronized (this.f607c) {
            if (!this.f606b) {
                this.f608d = scheduledFuture;
            }
        }
    }

    public void g(boolean z6) {
        C2537q0 c2537q0 = (C2537q0) this.f607c;
        C2548u0 c2548u0 = (C2548u0) this.f608d;
        c2548u0.getClass();
        c2548u0.f21182k.execute(new RunnableC2531o0(c2548u0, c2537q0, z6));
    }

    public void h(r0 r0Var) {
        C2548u0 c2548u0 = (C2548u0) this.f608d;
        c2548u0.f21180i.g(2, "{0} SHUTDOWN with {1}", ((C2537q0) this.f607c).e(), C2548u0.j(r0Var));
        this.f606b = true;
        c2548u0.f21182k.execute(new m4.E(15, this, r0Var));
    }

    public void i() {
        A4.g.t(this.f606b, "transportShutdown() must be called before transportTerminated().");
        C2548u0 c2548u0 = (C2548u0) this.f608d;
        AbstractC2395h abstractC2395h = c2548u0.f21180i;
        C2537q0 c2537q0 = (C2537q0) this.f607c;
        abstractC2395h.g(2, "{0} Terminated", c2537q0.e());
        RunnableC2531o0 runnableC2531o0 = new RunnableC2531o0(c2548u0, c2537q0, false);
        w0 w0Var = c2548u0.f21182k;
        w0Var.execute(runnableC2531o0);
        Iterator it = c2548u0.f21181j.iterator();
        if (!it.hasNext()) {
            w0Var.execute(new RunnableC2542s0(this, 1));
        } else {
            if (it.next() != null) {
                throw new ClassCastException();
            }
            c2537q0.b();
            throw null;
        }
    }

    public long j(Z0.y yVar, long j4, boolean z6, G0.K k6) {
        long jE = i0.e((i0) this.f608d, yVar, j4, z6, false, k6, false);
        if (!T0.N.a(jE, (T0.N) this.f607c)) {
            this.f606b = false;
        }
        ((i0) this.f608d).s(T0.N.c(jE) ? K.Y.f3767c : K.Y.f3766b);
        return jE;
    }

    public String toString() {
        switch (this.f605a) {
            case 1:
                return "SingleSelectionLayout(isStartHandle=" + this.f606b + ", crossed=" + d() + ", info=\n\t" + ((C0629x) this.f608d) + ')';
            case 2:
            default:
                return super.toString();
            case 3:
                return ((androidx.loader.app.a) this.f608d).toString();
        }
    }

    public C0109j(C2592t c2592t, T.p pVar) {
        this.f605a = 0;
        this.f607c = c2592t;
        this.f608d = pVar;
    }

    public C0109j(V4.C c6, boolean z6, J4.e eVar, C1958l c1958l) {
        this.f605a = 5;
        this.f606b = z6;
        this.f607c = W.a.I(-2, 4, X4.a.f8640a);
        this.f608d = V4.E.y(c6, null, null, new C1957k(c1958l, eVar, this, null), 3);
    }

    public C0109j(g2.e eVar, androidx.loader.app.a aVar) {
        this.f605a = 3;
        this.f606b = false;
        this.f607c = eVar;
        this.f608d = aVar;
    }

    public C0109j(boolean z6, V.A a6, C0629x c0629x) {
        this.f605a = 1;
        this.f606b = z6;
        this.f607c = a6;
        this.f608d = c0629x;
    }

    public C0109j(i0 i0Var) {
        this.f605a = 2;
        this.f608d = i0Var;
        this.f606b = true;
    }

    public C0109j(C2548u0 c2548u0, C2537q0 c2537q0) {
        this.f605a = 6;
        this.f608d = c2548u0;
        this.f606b = false;
        this.f607c = c2537q0;
    }

    public C0109j(Object obj) {
        this.f605a = 7;
        this.f607c = obj;
    }
}
