2021-08-09 22:50:52 +00:00
|
|
|
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.r.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: BitmapMemoryCacheProducer */
|
|
|
|
public class h implements v0<CloseableReference<c>> {
|
|
|
|
public final w<CacheKey, c> a;
|
|
|
|
public final i b;
|
|
|
|
|
|
|
|
/* renamed from: c reason: collision with root package name */
|
2021-08-31 07:21:49 +00:00
|
|
|
public final v0<CloseableReference<c>> f484c;
|
2021-08-09 22:50:52 +00:00
|
|
|
|
|
|
|
/* compiled from: BitmapMemoryCacheProducer */
|
|
|
|
public class a extends p<CloseableReference<c>, CloseableReference<c>> {
|
|
|
|
|
|
|
|
/* renamed from: c reason: collision with root package name */
|
2021-08-31 07:21:49 +00:00
|
|
|
public final /* synthetic */ CacheKey f485c;
|
2021-08-09 22:50:52 +00:00
|
|
|
public final /* synthetic */ boolean d;
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public a(l lVar, CacheKey cacheKey, boolean z2) {
|
|
|
|
super(lVar);
|
2021-08-31 07:21:49 +00:00
|
|
|
this.f485c = cacheKey;
|
2021-08-09 22:50:52 +00:00
|
|
|
this.d = z2;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX INFO: finally extract failed */
|
|
|
|
@Override // c.f.j.p.b
|
|
|
|
public void i(Object obj, int i) {
|
|
|
|
CloseableReference<c> closeableReference;
|
|
|
|
CloseableReference<c> closeableReference2 = (CloseableReference) obj;
|
|
|
|
try {
|
|
|
|
b.b();
|
|
|
|
boolean e = b.e(i);
|
|
|
|
CloseableReference<c> closeableReference3 = null;
|
|
|
|
if (closeableReference2 == null) {
|
|
|
|
if (e) {
|
|
|
|
this.b.b(null, i);
|
|
|
|
}
|
|
|
|
} else if (closeableReference2.w().d() || b.m(i, 8)) {
|
|
|
|
this.b.b(closeableReference2, i);
|
|
|
|
} else {
|
2021-08-31 07:21:49 +00:00
|
|
|
if (!e && (closeableReference = h.this.a.get(this.f485c)) != null) {
|
2021-08-09 22:50:52 +00:00
|
|
|
try {
|
|
|
|
c.f.j.j.i b = closeableReference2.w().b();
|
|
|
|
c.f.j.j.i b2 = closeableReference.w().b();
|
|
|
|
if (((c.f.j.j.h) b2).d || ((c.f.j.j.h) b2).b >= ((c.f.j.j.h) b).b) {
|
|
|
|
this.b.b(closeableReference, i);
|
|
|
|
closeableReference.close();
|
|
|
|
}
|
|
|
|
} finally {
|
|
|
|
closeableReference.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.d) {
|
2021-08-31 07:21:49 +00:00
|
|
|
closeableReference3 = h.this.a.a(this.f485c, closeableReference2);
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|
|
|
|
if (e) {
|
|
|
|
try {
|
|
|
|
this.b.a(1.0f);
|
|
|
|
} catch (Throwable th) {
|
|
|
|
if (closeableReference3 != null) {
|
|
|
|
closeableReference3.close();
|
|
|
|
}
|
|
|
|
throw th;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
l<O> lVar = this.b;
|
|
|
|
if (closeableReference3 != null) {
|
|
|
|
closeableReference2 = closeableReference3;
|
|
|
|
}
|
|
|
|
lVar.b(closeableReference2, i);
|
|
|
|
if (closeableReference3 != null) {
|
|
|
|
closeableReference3.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
b.b();
|
|
|
|
} catch (Throwable th2) {
|
|
|
|
b.b();
|
|
|
|
throw th2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public h(w<CacheKey, c> wVar, i iVar, v0<CloseableReference<c>> v0Var) {
|
|
|
|
this.a = wVar;
|
|
|
|
this.b = iVar;
|
2021-08-31 07:21:49 +00:00
|
|
|
this.f484c = v0Var;
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX INFO: finally extract failed */
|
|
|
|
@Override // c.f.j.p.v0
|
|
|
|
public void b(l<CloseableReference<c>> lVar, w0 w0Var) {
|
|
|
|
try {
|
|
|
|
b.b();
|
|
|
|
y0 o = w0Var.o();
|
|
|
|
o.e(w0Var, d());
|
|
|
|
CacheKey a2 = ((n) this.b).a(w0Var.e(), w0Var.b());
|
|
|
|
CloseableReference<c> closeableReference = this.a.get(a2);
|
|
|
|
Map<String, String> map = null;
|
|
|
|
if (closeableReference != null) {
|
|
|
|
w0Var.j(closeableReference.w().a());
|
|
|
|
boolean z2 = ((c.f.j.j.h) closeableReference.w().b()).d;
|
|
|
|
if (z2) {
|
|
|
|
o.j(w0Var, d(), o.g(w0Var, d()) ? f.of("cached_value_found", "true") : null);
|
|
|
|
o.c(w0Var, d(), true);
|
|
|
|
w0Var.i("memory_bitmap", c());
|
|
|
|
lVar.a(1.0f);
|
|
|
|
}
|
|
|
|
lVar.b(closeableReference, z2 ? 1 : 0);
|
|
|
|
closeableReference.close();
|
|
|
|
if (z2) {
|
|
|
|
b.b();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (w0Var.q().g() >= ImageRequest.c.BITMAP_MEMORY_CACHE.g()) {
|
|
|
|
o.j(w0Var, d(), o.g(w0Var, d()) ? f.of("cached_value_found", "false") : null);
|
|
|
|
o.c(w0Var, d(), false);
|
|
|
|
w0Var.i("memory_bitmap", c());
|
|
|
|
lVar.b(null, 1);
|
|
|
|
b.b();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
l<CloseableReference<c>> e = e(lVar, a2, w0Var.e().o);
|
|
|
|
String d = d();
|
|
|
|
if (o.g(w0Var, d())) {
|
|
|
|
map = f.of("cached_value_found", "false");
|
|
|
|
}
|
|
|
|
o.j(w0Var, d, map);
|
|
|
|
b.b();
|
2021-08-31 07:21:49 +00:00
|
|
|
this.f484c.b(e, w0Var);
|
2021-08-09 22:50:52 +00:00
|
|
|
b.b();
|
|
|
|
b.b();
|
|
|
|
} catch (Throwable th) {
|
|
|
|
b.b();
|
|
|
|
throw th;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public String c() {
|
|
|
|
return "pipe_bg";
|
|
|
|
}
|
|
|
|
|
|
|
|
public String d() {
|
|
|
|
return "BitmapMemoryCacheProducer";
|
|
|
|
}
|
|
|
|
|
|
|
|
public l<CloseableReference<c>> e(l<CloseableReference<c>> lVar, CacheKey cacheKey, boolean z2) {
|
|
|
|
return new a(lVar, cacheKey, z2);
|
|
|
|
}
|
|
|
|
}
|