package o; import java.util.Collection; import java.util.Objects; /* renamed from: o.fVj, reason: case insensitive filesystem */ /* loaded from: classes6.dex */ public final class C13266fVj, B> extends fUX { private InterfaceC13169fSq b; private InterfaceC13189fTc e; public C13266fVj(InterfaceC13169fSq interfaceC13169fSq, InterfaceC13169fSq interfaceC13169fSq2, InterfaceC13189fTc interfaceC13189fTc) { super(interfaceC13169fSq); this.b = interfaceC13169fSq2; this.e = interfaceC13189fTc; } @Override // o.AbstractC13163fSk public final void subscribeActual(InterfaceC13174fSv interfaceC13174fSv) { this.c.subscribe(new LWm(new C13406fZi(interfaceC13174fSv), this.e, this.b)); } /* renamed from: o.fVj$LWm */ /* loaded from: classes6.dex */ static final class LWm, B> extends fTV implements fSJ { private fSJ f; private InterfaceC13189fTc g; private InterfaceC13169fSq h; private U i; private fSJ j; @Override // o.fTV, o.InterfaceC13361fYY public final /* synthetic */ void a(InterfaceC13174fSv interfaceC13174fSv, Object obj) { this.a.onNext((Collection) obj); } LWm(InterfaceC13174fSv interfaceC13174fSv, InterfaceC13189fTc interfaceC13189fTc, InterfaceC13169fSq interfaceC13169fSq) { super(interfaceC13174fSv, new C13378fYq()); this.g = interfaceC13189fTc; this.h = interfaceC13169fSq; } @Override // o.InterfaceC13174fSv public final void onSubscribe(fSJ fsj) { if (EnumC13192fTf.d(this.j, fsj)) { this.j = fsj; try { this.i = (U) Objects.requireNonNull(this.g.d(), "The buffer supplied is null"); RVV rvv = new RVV(this); this.f = rvv; this.a.onSubscribe(this); if (this.b) { return; } this.h.subscribe(rvv); } catch (Throwable th) { C13147fSI.c(th); this.b = true; fsj.dispose(); EnumC13195fTi.a(th, this.a); } } } @Override // o.InterfaceC13174fSv public final void onNext(T t) { synchronized (this) { U u = this.i; if (u == null) { return; } u.add(t); } } @Override // o.InterfaceC13174fSv public final void onError(Throwable th) { dispose(); this.a.onError(th); } @Override // o.InterfaceC13174fSv public final void onComplete() { synchronized (this) { U u = this.i; if (u == null) { return; } this.i = null; this.d.b(u); this.e = true; if (this.c.getAndIncrement() == 0) { C13360fYU.e(this.d, this.a, false, this, this); } } } @Override // o.fSJ public final void dispose() { if (this.b) { return; } this.b = true; this.f.dispose(); this.j.dispose(); if (this.c.getAndIncrement() == 0) { this.d.e(); } } @Override // o.fSJ public final boolean isDisposed() { return this.b; } final void c() { try { U u = (U) Objects.requireNonNull(this.g.d(), "The buffer supplied is null"); synchronized (this) { U u2 = this.i; if (u2 == null) { return; } this.i = u; a((LWm) u2, (fSJ) this); } } catch (Throwable th) { C13147fSI.c(th); dispose(); this.a.onError(th); } } } /* renamed from: o.fVj$RVV */ /* loaded from: classes6.dex */ static final class RVV, B> extends AbstractC13403fZf { private LWm b; RVV(LWm lWm) { this.b = lWm; } @Override // o.InterfaceC13174fSv public final void onNext(B b) { this.b.c(); } @Override // o.InterfaceC13174fSv public final void onError(Throwable th) { this.b.onError(th); } @Override // o.InterfaceC13174fSv public final void onComplete() { this.b.onComplete(); } } }