discord-jadx/app/src/main/java/c/f/j/p/r0.java

107 lines
3.8 KiB
Java

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<CloseableReference<c>> {
public final w<CacheKey, c> a;
public final i b;
/* renamed from: c reason: collision with root package name */
public final v0<CloseableReference<c>> f491c;
/* compiled from: PostprocessedBitmapMemoryCacheProducer */
public static class a extends p<CloseableReference<c>, CloseableReference<c>> {
/* renamed from: c reason: collision with root package name */
public final CacheKey f492c;
public final boolean d;
public final w<CacheKey, c> e;
public final boolean f;
public a(l<CloseableReference<c>> lVar, CacheKey cacheKey, boolean z2, w<CacheKey, c> wVar, boolean z3) {
super(lVar);
this.f492c = cacheKey;
this.d = z2;
this.e = wVar;
this.f = z3;
}
@Override // c.f.j.p.b
public void i(Object obj, int i) {
CloseableReference<c> closeableReference = (CloseableReference) obj;
CloseableReference<c> 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.f492c, closeableReference);
}
try {
this.b.a(1.0f);
l<O> lVar = this.b;
if (closeableReference2 != null) {
closeableReference = closeableReference2;
}
lVar.b(closeableReference, i);
} finally {
Class<CloseableReference> cls = CloseableReference.i;
if (closeableReference2 != null) {
closeableReference2.close();
}
}
}
}
}
public r0(w<CacheKey, c> wVar, i iVar, v0<CloseableReference<c>> v0Var) {
this.a = wVar;
this.b = iVar;
this.f491c = v0Var;
}
@Override // c.f.j.p.v0
public void b(l<CloseableReference<c>> 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.f491c.b(lVar, w0Var);
return;
}
o.e(w0Var, "PostprocessedBitmapMemoryCacheProducer");
CacheKey c2 = ((n) this.b).c(e, b);
CloseableReference<c> closeableReference = this.a.get(c2);
Map<String, String> 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.f491c.b(aVar, w0Var);
}
}