package u6; import android.util.Log; import java.util.Collections; import java.util.HashSet; import java.util.Iterator; import java.util.Set; import java.util.WeakHashMap; /* loaded from: classes2.dex */ public class i { /* renamed from: a, reason: collision with root package name */ private final Set f14708a = Collections.newSetFromMap(new WeakHashMap()); /* renamed from: b, reason: collision with root package name */ private final Set f14709b = new HashSet(); /* renamed from: c, reason: collision with root package name */ private boolean f14710c; public boolean a(x6.c cVar) { boolean z10 = true; if (cVar == null) { return true; } boolean remove = this.f14708a.remove(cVar); if (!this.f14709b.remove(cVar) && !remove) { z10 = false; } if (z10) { cVar.clear(); } return z10; } public void b() { Iterator it = b7.k.k(this.f14708a).iterator(); while (it.hasNext()) { a((x6.c) it.next()); } this.f14709b.clear(); } public void c() { this.f14710c = true; for (x6.c cVar : b7.k.k(this.f14708a)) { if (cVar.isRunning() || cVar.h()) { cVar.clear(); this.f14709b.add(cVar); } } } public void d() { this.f14710c = true; for (x6.c cVar : b7.k.k(this.f14708a)) { if (cVar.isRunning()) { cVar.pause(); this.f14709b.add(cVar); } } } public void e() { for (x6.c cVar : b7.k.k(this.f14708a)) { if (!cVar.h() && !cVar.d()) { cVar.clear(); if (this.f14710c) { this.f14709b.add(cVar); } else { cVar.g(); } } } } public void f() { this.f14710c = false; for (x6.c cVar : b7.k.k(this.f14708a)) { if (!cVar.h() && !cVar.isRunning()) { cVar.g(); } } this.f14709b.clear(); } public void g(x6.c cVar) { this.f14708a.add(cVar); if (!this.f14710c) { cVar.g(); return; } cVar.clear(); if (Log.isLoggable("RequestTracker", 2)) { Log.v("RequestTracker", "Paused, delaying request"); } this.f14709b.add(cVar); } public String toString() { return super.toString() + "{numRequests=" + this.f14708a.size() + ", isPaused=" + this.f14710c + "}"; } }