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

112 lines
3.3 KiB
Java

package c.f.j.p;
import c.f.d.g.g;
import c.f.j.j.e;
import com.facebook.common.references.CloseableReference;
import com.facebook.imagepipeline.request.ImageRequest;
import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.Executor;
/* compiled from: LocalFetchProducer */
public abstract class g0 implements v0<e> {
public final Executor a;
public final g b;
/* compiled from: LocalFetchProducer */
public class a extends d1<e> {
public final /* synthetic */ ImageRequest n;
public final /* synthetic */ y0 o;
public final /* synthetic */ w0 p;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public a(l lVar, y0 y0Var, w0 w0Var, String str, ImageRequest imageRequest, y0 y0Var2, w0 w0Var2) {
super(lVar, y0Var, w0Var, str);
this.n = imageRequest;
this.o = y0Var2;
this.p = w0Var2;
}
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // c.f.j.p.d1
public void b(e eVar) {
e eVar2 = eVar;
if (eVar2 != null) {
eVar2.close();
}
}
/* Return type fixed from 'java.lang.Object' to match base method */
@Override // c.f.j.p.d1
public e d() throws Exception {
e d = g0.this.d(this.n);
if (d == null) {
this.o.c(this.p, g0.this.e(), false);
this.p.n("local");
return null;
}
d.p();
this.o.c(this.p, g0.this.e(), true);
this.p.n("local");
return d;
}
}
/* compiled from: LocalFetchProducer */
public class b extends e {
public final /* synthetic */ d1 a;
public b(g0 g0Var, d1 d1Var) {
this.a = d1Var;
}
@Override // c.f.j.p.x0
public void a() {
this.a.a();
}
}
public g0(Executor executor, g gVar) {
this.a = executor;
this.b = gVar;
}
@Override // c.f.j.p.v0
public void b(l<e> lVar, w0 w0Var) {
y0 o = w0Var.o();
ImageRequest e = w0Var.e();
w0Var.i("local", "fetch");
a aVar = new a(lVar, o, w0Var, e(), e, o, w0Var);
w0Var.f(new b(this, aVar));
this.a.execute(aVar);
}
public e c(InputStream inputStream, int i) throws IOException {
CloseableReference closeableReference;
CloseableReference closeableReference2 = null;
if (i <= 0) {
try {
closeableReference = CloseableReference.C(this.b.c(inputStream));
} catch (Throwable th) {
c.f.d.d.a.b(inputStream);
Class<CloseableReference> cls = CloseableReference.i;
if (0 != 0) {
closeableReference2.close();
}
throw th;
}
} else {
closeableReference = CloseableReference.C(this.b.d(inputStream, i));
}
e eVar = new e(closeableReference);
c.f.d.d.a.b(inputStream);
if (closeableReference != null) {
closeableReference.close();
}
return eVar;
}
public abstract e d(ImageRequest imageRequest) throws IOException;
public abstract String e();
}