package c.f.j.p; import c.f.d.d.f; import c.f.j.c.i; import c.f.j.c.n; import c.f.j.c.w; import c.f.j.j.c; import c.f.j.q.b; import com.facebook.cache.common.CacheKey; import com.facebook.common.references.CloseableReference; import com.facebook.imagepipeline.request.ImageRequest; import java.util.Map; /* compiled from: PostprocessedBitmapMemoryCacheProducer */ public class r0 implements v0> { public final w a; public final i b; /* renamed from: c reason: collision with root package name */ public final v0> f505c; /* compiled from: PostprocessedBitmapMemoryCacheProducer */ public static class a extends p, CloseableReference> { /* renamed from: c reason: collision with root package name */ public final CacheKey f506c; public final boolean d; public final w e; public final boolean f; public a(l> lVar, CacheKey cacheKey, boolean z2, w wVar, boolean z3) { super(lVar); this.f506c = cacheKey; this.d = z2; this.e = wVar; this.f = z3; } @Override // c.f.j.p.b public void i(Object obj, int i) { CloseableReference closeableReference = (CloseableReference) obj; CloseableReference closeableReference2 = null; if (closeableReference == null) { if (b.e(i)) { this.b.b(null, i); } } else if (!b.f(i) || this.d) { if (this.f) { closeableReference2 = this.e.a(this.f506c, closeableReference); } try { this.b.a(1.0f); l lVar = this.b; if (closeableReference2 != null) { closeableReference = closeableReference2; } lVar.b(closeableReference, i); } finally { Class cls = CloseableReference.i; if (closeableReference2 != null) { closeableReference2.close(); } } } } } public r0(w wVar, i iVar, v0> v0Var) { this.a = wVar; this.b = iVar; this.f505c = v0Var; } @Override // c.f.j.p.v0 public void b(l> lVar, w0 w0Var) { y0 o = w0Var.o(); ImageRequest e = w0Var.e(); Object b = w0Var.b(); b bVar = e.q; if (bVar == null || bVar.getPostprocessorCacheKey() == null) { this.f505c.b(lVar, w0Var); return; } o.e(w0Var, "PostprocessedBitmapMemoryCacheProducer"); CacheKey c2 = ((n) this.b).c(e, b); CloseableReference closeableReference = this.a.get(c2); Map map = null; if (closeableReference != null) { if (o.g(w0Var, "PostprocessedBitmapMemoryCacheProducer")) { map = f.of("cached_value_found", "true"); } o.j(w0Var, "PostprocessedBitmapMemoryCacheProducer", map); o.c(w0Var, "PostprocessedBitmapMemoryCacheProducer", true); w0Var.i("memory_bitmap", "postprocessed"); lVar.a(1.0f); lVar.b(closeableReference, 1); closeableReference.close(); return; } a aVar = new a(lVar, c2, bVar instanceof c.f.j.q.c, this.a, w0Var.e().o); if (o.g(w0Var, "PostprocessedBitmapMemoryCacheProducer")) { map = f.of("cached_value_found", "false"); } o.j(w0Var, "PostprocessedBitmapMemoryCacheProducer", map); this.f505c.b(aVar, w0Var); } }