what-the-bank/sources/retrofit2/adapter/rxjava3/CallExecuteObservable.java

85 lines
2.4 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package retrofit2.adapter.rxjava3;
import io.reactivex.rxjava3.exceptions.CompositeException;
import o.AbstractC13163fSk;
import o.C13147fSI;
import o.C13418fZu;
import o.InterfaceC13174fSv;
import o.fSJ;
import retrofit2.Call;
import retrofit2.Response;
/* loaded from: classes.dex */
final class CallExecuteObservable<T> extends AbstractC13163fSk<Response<T>> {
private final Call<T> originalCall;
/* JADX INFO: Access modifiers changed from: package-private */
public CallExecuteObservable(Call<T> call) {
this.originalCall = call;
}
@Override // o.AbstractC13163fSk
public final void subscribeActual(InterfaceC13174fSv<? super Response<T>> interfaceC13174fSv) {
boolean z;
Call<T> clone = this.originalCall.clone();
CallDisposable callDisposable = new CallDisposable(clone);
interfaceC13174fSv.onSubscribe(callDisposable);
if (callDisposable.isDisposed()) {
return;
}
try {
Response<T> execute = clone.execute();
if (!callDisposable.isDisposed()) {
interfaceC13174fSv.onNext(execute);
}
if (callDisposable.isDisposed()) {
return;
}
try {
interfaceC13174fSv.onComplete();
} catch (Throwable th) {
th = th;
z = true;
C13147fSI.c(th);
if (z) {
C13418fZu.c(th);
return;
}
if (callDisposable.isDisposed()) {
return;
}
try {
interfaceC13174fSv.onError(th);
} catch (Throwable th2) {
C13147fSI.c(th2);
C13418fZu.c(new CompositeException(th, th2));
}
}
} catch (Throwable th3) {
th = th3;
z = false;
}
}
/* loaded from: classes6.dex */
static final class CallDisposable implements fSJ {
private final Call<?> call;
private volatile boolean disposed;
CallDisposable(Call<?> call) {
this.call = call;
}
@Override // o.fSJ
public final void dispose() {
this.disposed = true;
this.call.cancel();
}
@Override // o.fSJ
public final boolean isDisposed() {
return this.disposed;
}
}
}