package c.f.j.p; import c.f.d.d.g; import c.f.j.e.j; import c.f.j.j.f; import com.facebook.imagepipeline.request.ImageRequest; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; /* compiled from: BaseProducerContext */ public class d implements w0 { public static final Set a; public final ImageRequest b; /* renamed from: c reason: collision with root package name */ public final String f466c; public final String d; public final y0 e; public final Object f; public final ImageRequest.c g; public final Map h; public boolean i; public c.f.j.d.d j; public boolean k; public boolean l; public final List m; public final j n; static { int i = g.i; HashSet hashSet = new HashSet(2); Collections.addAll(hashSet, "id", "uri_source"); a = new g(hashSet); } public d(ImageRequest imageRequest, String str, String str2, y0 y0Var, Object obj, ImageRequest.c cVar, boolean z2, boolean z3, c.f.j.d.d dVar, j jVar) { this.b = imageRequest; this.f466c = str; HashMap hashMap = new HashMap(); this.h = hashMap; hashMap.put("id", str); hashMap.put("uri_source", imageRequest == null ? "null-request" : imageRequest.f2182c); this.d = str2; this.e = y0Var; this.f = obj; this.g = cVar; this.i = z2; this.j = dVar; this.k = z3; this.l = false; this.m = new ArrayList(); this.n = jVar; } public static void r(List list) { if (list != null) { for (x0 x0Var : list) { x0Var.b(); } } } public static void s(List list) { if (list != null) { for (x0 x0Var : list) { x0Var.d(); } } } public static void t(List list) { if (list != null) { for (x0 x0Var : list) { x0Var.c(); } } } @Override // c.f.j.p.w0 public Map a() { return this.h; } @Override // c.f.j.p.w0 public Object b() { return this.f; } @Override // c.f.j.p.w0 public synchronized c.f.j.d.d c() { return this.j; } @Override // c.f.j.p.w0 public void d(String str, Object obj) { if (!a.contains(str)) { this.h.put(str, obj); } } @Override // c.f.j.p.w0 public ImageRequest e() { return this.b; } @Override // c.f.j.p.w0 public void f(x0 x0Var) { boolean z2; synchronized (this) { this.m.add(x0Var); z2 = this.l; } if (z2) { x0Var.a(); } } @Override // c.f.j.p.w0 public j g() { return this.n; } @Override // c.f.j.p.w0 public String getId() { return this.f466c; } @Override // c.f.j.p.w0 public void h(f fVar) { } @Override // c.f.j.p.w0 public void i(String str, String str2) { this.h.put("origin", str); this.h.put("origin_sub", str2); } @Override // c.f.j.p.w0 public void j(Map map) { if (map != null) { for (Map.Entry entry : map.entrySet()) { d(entry.getKey(), entry.getValue()); } } } @Override // c.f.j.p.w0 public synchronized boolean k() { return this.i; } @Override // c.f.j.p.w0 public T l(String str) { return (T) this.h.get(str); } @Override // c.f.j.p.w0 public String m() { return this.d; } @Override // c.f.j.p.w0 public void n(String str) { this.h.put("origin", str); this.h.put("origin_sub", "default"); } @Override // c.f.j.p.w0 public y0 o() { return this.e; } @Override // c.f.j.p.w0 public synchronized boolean p() { return this.k; } @Override // c.f.j.p.w0 public ImageRequest.c q() { return this.g; } public void u() { ArrayList arrayList; synchronized (this) { if (this.l) { arrayList = null; } else { this.l = true; arrayList = new ArrayList(this.m); } } if (arrayList != null) { for (x0 x0Var : arrayList) { x0Var.a(); } } } public synchronized List v(c.f.j.d.d dVar) { if (dVar == this.j) { return null; } this.j = dVar; return new ArrayList(this.m); } }