package o;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class ET {
    public final Runnable a;
    public final C2807wR b;
    public final CT c;

    public ET(Runnable runnable) {
        this.a = runnable;
        C2807wR c2807wR = new C2807wR(new G1(11, this));
        this.b = c2807wR;
        CT ct = new CT();
        this.c = ct;
        c2807wR.a(ct);
    }

    public final void a(ZB zb, InterfaceC0898cL interfaceC0898cL) {
        WK lifecycle = interfaceC0898cL.getLifecycle();
        if (lifecycle.b() == VK.l) {
            return;
        }
        AT at = new AT(zb, new BT(zb, interfaceC0898cL));
        zb.a.add(at);
        at.b(false);
        C2807wR c2807wR = this.b;
        c2807wR.getClass();
        if (c2807wR.c.add(at)) {
            C3092zR c3092zR = c2807wR.b;
            c3092zR.getClass();
            if (at.c != null) {
                throw new IllegalArgumentException(("Handler '" + at + "' is already registered with a dispatcher").toString());
            }
            c3092zR.e.addFirst(at);
            at.c = c2807wR;
            c3092zR.b();
        }
        DT dt = new DT(at, zb, this, lifecycle);
        lifecycle.a(dt);
        zb.c.add(dt);
    }
}
