2021-11-08 18:25:28 +00:00
|
|
|
package i0.d0.a;
|
2021-08-04 22:02:59 +00:00
|
|
|
|
2021-11-08 18:25:28 +00:00
|
|
|
import i0.c0;
|
|
|
|
import i0.e;
|
|
|
|
import i0.y;
|
|
|
|
import j0.d;
|
|
|
|
import j0.h;
|
2021-08-04 22:02:59 +00:00
|
|
|
import java.lang.annotation.Annotation;
|
|
|
|
import java.lang.reflect.ParameterizedType;
|
|
|
|
import java.lang.reflect.Type;
|
|
|
|
import retrofit2.Response;
|
|
|
|
import rx.Observable;
|
|
|
|
import rx.Scheduler;
|
2022-03-02 20:59:20 +00:00
|
|
|
/* compiled from: RxJavaCallAdapterFactory.java */
|
|
|
|
/* loaded from: classes3.dex */
|
2021-08-04 22:02:59 +00:00
|
|
|
public final class g extends e.a {
|
|
|
|
public g(Scheduler scheduler, boolean z2) {
|
|
|
|
}
|
|
|
|
|
2021-11-08 18:25:28 +00:00
|
|
|
@Override // i0.e.a
|
2021-08-04 22:02:59 +00:00
|
|
|
public e<?, ?> a(Type type, Annotation[] annotationArr, y yVar) {
|
|
|
|
boolean z2;
|
|
|
|
Type type2;
|
|
|
|
Class<?> f = c0.f(type);
|
2022-03-02 20:59:20 +00:00
|
|
|
boolean z3 = true;
|
|
|
|
boolean z4 = f == h.class;
|
|
|
|
boolean z5 = f == d.class;
|
|
|
|
if (f != Observable.class && !z4 && !z5) {
|
2021-08-04 22:02:59 +00:00
|
|
|
return null;
|
|
|
|
}
|
2022-03-02 20:59:20 +00:00
|
|
|
if (z5) {
|
2021-08-04 22:02:59 +00:00
|
|
|
return new f(Void.class, null, false, false, true, false, true);
|
|
|
|
}
|
|
|
|
if (!(type instanceof ParameterizedType)) {
|
2022-03-02 20:59:20 +00:00
|
|
|
String str = z4 ? "Single" : "Observable";
|
2021-08-04 22:02:59 +00:00
|
|
|
throw new IllegalStateException(str + " return type must be parameterized as " + str + "<Foo> or " + str + "<? extends Foo>");
|
|
|
|
}
|
|
|
|
Type e = c0.e(0, (ParameterizedType) type);
|
|
|
|
Class<?> f2 = c0.f(e);
|
|
|
|
if (f2 == Response.class) {
|
|
|
|
if (e instanceof ParameterizedType) {
|
2022-03-02 20:59:20 +00:00
|
|
|
type2 = c0.e(0, (ParameterizedType) e);
|
|
|
|
z3 = false;
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
|
|
|
throw new IllegalStateException("Response must be parameterized as Response<Foo> or Response<? extends Foo>");
|
|
|
|
}
|
|
|
|
} else if (f2 != d.class) {
|
|
|
|
type2 = e;
|
|
|
|
z3 = false;
|
|
|
|
z2 = true;
|
2022-03-02 20:59:20 +00:00
|
|
|
return new f(type2, null, false, z3, z2, z4, false);
|
2021-08-04 22:02:59 +00:00
|
|
|
} else if (e instanceof ParameterizedType) {
|
2022-03-02 20:59:20 +00:00
|
|
|
type2 = c0.e(0, (ParameterizedType) e);
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
|
|
|
throw new IllegalStateException("Result must be parameterized as Result<Foo> or Result<? extends Foo>");
|
|
|
|
}
|
|
|
|
z2 = false;
|
2022-03-02 20:59:20 +00:00
|
|
|
return new f(type2, null, false, z3, z2, z4, false);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
}
|