Initial commit
This commit is contained in:
8
sources/io/reactivex/BackpressureOverflowStrategy.java
Normal file
8
sources/io/reactivex/BackpressureOverflowStrategy.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package io.reactivex;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public enum BackpressureOverflowStrategy {
|
||||
ERROR,
|
||||
DROP_OLDEST,
|
||||
DROP_LATEST
|
||||
}
|
10
sources/io/reactivex/BackpressureStrategy.java
Normal file
10
sources/io/reactivex/BackpressureStrategy.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package io.reactivex;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public enum BackpressureStrategy {
|
||||
MISSING,
|
||||
ERROR,
|
||||
BUFFER,
|
||||
DROP,
|
||||
LATEST
|
||||
}
|
32
sources/io/reactivex/Completable.java
Normal file
32
sources/io/reactivex/Completable.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package io.reactivex;
|
||||
|
||||
import io.reactivex.exceptions.Exceptions;
|
||||
import io.reactivex.internal.functions.ObjectHelper;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public abstract class Completable implements CompletableSource {
|
||||
private static NullPointerException a(Throwable th) {
|
||||
NullPointerException nullPointerException = new NullPointerException("Actually not, but can't pass out an exception otherwise...");
|
||||
nullPointerException.initCause(th);
|
||||
return nullPointerException;
|
||||
}
|
||||
|
||||
protected abstract void b(CompletableObserver completableObserver);
|
||||
|
||||
@Override // io.reactivex.CompletableSource
|
||||
public final void a(CompletableObserver completableObserver) {
|
||||
ObjectHelper.a(completableObserver, "s is null");
|
||||
try {
|
||||
CompletableObserver a = RxJavaPlugins.a(this, completableObserver);
|
||||
ObjectHelper.a(a, "The RxJavaPlugins.onSubscribe hook returned a null CompletableObserver. Please check the handler provided to RxJavaPlugins.setOnCompletableSubscribe for invalid null returns. Further reading: https://github.com/ReactiveX/RxJava/wiki/Plugins");
|
||||
b(a);
|
||||
} catch (NullPointerException e) {
|
||||
throw e;
|
||||
} catch (Throwable th) {
|
||||
Exceptions.b(th);
|
||||
RxJavaPlugins.b(th);
|
||||
throw a(th);
|
||||
}
|
||||
}
|
||||
}
|
12
sources/io/reactivex/CompletableObserver.java
Normal file
12
sources/io/reactivex/CompletableObserver.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package io.reactivex;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface CompletableObserver {
|
||||
void onComplete();
|
||||
|
||||
void onError(Throwable th);
|
||||
|
||||
void onSubscribe(Disposable disposable);
|
||||
}
|
6
sources/io/reactivex/CompletableSource.java
Normal file
6
sources/io/reactivex/CompletableSource.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface CompletableSource {
|
||||
void a(CompletableObserver completableObserver);
|
||||
}
|
10
sources/io/reactivex/Emitter.java
Normal file
10
sources/io/reactivex/Emitter.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package io.reactivex;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface Emitter<T> {
|
||||
void onComplete();
|
||||
|
||||
void onError(Throwable th);
|
||||
|
||||
void onNext(T t);
|
||||
}
|
68
sources/io/reactivex/Flowable.java
Normal file
68
sources/io/reactivex/Flowable.java
Normal file
@@ -0,0 +1,68 @@
|
||||
package io.reactivex;
|
||||
|
||||
import com.ubtrobot.jimu.robotapi.PeripheralType;
|
||||
import io.reactivex.exceptions.Exceptions;
|
||||
import io.reactivex.internal.functions.Functions;
|
||||
import io.reactivex.internal.functions.ObjectHelper;
|
||||
import io.reactivex.internal.operators.flowable.FlowableOnBackpressureBuffer;
|
||||
import io.reactivex.internal.operators.flowable.FlowableOnBackpressureDrop;
|
||||
import io.reactivex.internal.operators.flowable.FlowableOnBackpressureLatest;
|
||||
import io.reactivex.internal.subscribers.StrictSubscriber;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
import org.reactivestreams.Publisher;
|
||||
import org.reactivestreams.Subscriber;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public abstract class Flowable<T> implements Publisher<T> {
|
||||
static final int a = Math.max(1, Integer.getInteger("rx2.buffer-size", PeripheralType.SERVO).intValue());
|
||||
|
||||
public static int d() {
|
||||
return a;
|
||||
}
|
||||
|
||||
public final Flowable<T> a() {
|
||||
return a(d(), false, true);
|
||||
}
|
||||
|
||||
public final Flowable<T> b() {
|
||||
return RxJavaPlugins.a((Flowable) new FlowableOnBackpressureDrop(this));
|
||||
}
|
||||
|
||||
protected abstract void b(Subscriber<? super T> subscriber);
|
||||
|
||||
public final Flowable<T> c() {
|
||||
return RxJavaPlugins.a(new FlowableOnBackpressureLatest(this));
|
||||
}
|
||||
|
||||
public final Flowable<T> a(int i, boolean z, boolean z2) {
|
||||
ObjectHelper.a(i, "bufferSize");
|
||||
return RxJavaPlugins.a(new FlowableOnBackpressureBuffer(this, i, z2, z, Functions.c));
|
||||
}
|
||||
|
||||
@Override // org.reactivestreams.Publisher
|
||||
public final void a(Subscriber<? super T> subscriber) {
|
||||
if (subscriber instanceof FlowableSubscriber) {
|
||||
a((FlowableSubscriber) subscriber);
|
||||
} else {
|
||||
ObjectHelper.a(subscriber, "s is null");
|
||||
a((FlowableSubscriber) new StrictSubscriber(subscriber));
|
||||
}
|
||||
}
|
||||
|
||||
public final void a(FlowableSubscriber<? super T> flowableSubscriber) {
|
||||
ObjectHelper.a(flowableSubscriber, "s is null");
|
||||
try {
|
||||
Subscriber<? super T> a2 = RxJavaPlugins.a(this, flowableSubscriber);
|
||||
ObjectHelper.a(a2, "The RxJavaPlugins.onSubscribe hook returned a null FlowableSubscriber. Please check the handler provided to RxJavaPlugins.setOnFlowableSubscribe for invalid null returns. Further reading: https://github.com/ReactiveX/RxJava/wiki/Plugins");
|
||||
b(a2);
|
||||
} catch (NullPointerException e) {
|
||||
throw e;
|
||||
} catch (Throwable th) {
|
||||
Exceptions.b(th);
|
||||
RxJavaPlugins.b(th);
|
||||
NullPointerException nullPointerException = new NullPointerException("Actually not, but can't throw other exceptions due to RS");
|
||||
nullPointerException.initCause(th);
|
||||
throw nullPointerException;
|
||||
}
|
||||
}
|
||||
}
|
7
sources/io/reactivex/FlowableSubscriber.java
Normal file
7
sources/io/reactivex/FlowableSubscriber.java
Normal file
@@ -0,0 +1,7 @@
|
||||
package io.reactivex;
|
||||
|
||||
import org.reactivestreams.Subscriber;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface FlowableSubscriber<T> extends Subscriber<T> {
|
||||
}
|
34
sources/io/reactivex/Maybe.java
Normal file
34
sources/io/reactivex/Maybe.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package io.reactivex;
|
||||
|
||||
import io.reactivex.exceptions.Exceptions;
|
||||
import io.reactivex.internal.functions.ObjectHelper;
|
||||
import io.reactivex.internal.observers.BlockingMultiObserver;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public abstract class Maybe<T> implements MaybeSource<T> {
|
||||
@Override // io.reactivex.MaybeSource
|
||||
public final void a(MaybeObserver<? super T> maybeObserver) {
|
||||
ObjectHelper.a(maybeObserver, "observer is null");
|
||||
MaybeObserver<? super T> a = RxJavaPlugins.a(this, maybeObserver);
|
||||
ObjectHelper.a(a, "The RxJavaPlugins.onSubscribe hook returned a null MaybeObserver. Please check the handler provided to RxJavaPlugins.setOnMaybeSubscribe for invalid null returns. Further reading: https://github.com/ReactiveX/RxJava/wiki/Plugins");
|
||||
try {
|
||||
b(a);
|
||||
} catch (NullPointerException e) {
|
||||
throw e;
|
||||
} catch (Throwable th) {
|
||||
Exceptions.b(th);
|
||||
NullPointerException nullPointerException = new NullPointerException("subscribeActual failed");
|
||||
nullPointerException.initCause(th);
|
||||
throw nullPointerException;
|
||||
}
|
||||
}
|
||||
|
||||
public final T b() {
|
||||
BlockingMultiObserver blockingMultiObserver = new BlockingMultiObserver();
|
||||
a(blockingMultiObserver);
|
||||
return (T) blockingMultiObserver.a();
|
||||
}
|
||||
|
||||
protected abstract void b(MaybeObserver<? super T> maybeObserver);
|
||||
}
|
14
sources/io/reactivex/MaybeObserver.java
Normal file
14
sources/io/reactivex/MaybeObserver.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package io.reactivex;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface MaybeObserver<T> {
|
||||
void onComplete();
|
||||
|
||||
void onError(Throwable th);
|
||||
|
||||
void onSubscribe(Disposable disposable);
|
||||
|
||||
void onSuccess(T t);
|
||||
}
|
6
sources/io/reactivex/MaybeSource.java
Normal file
6
sources/io/reactivex/MaybeSource.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface MaybeSource<T> {
|
||||
void a(MaybeObserver<? super T> maybeObserver);
|
||||
}
|
83
sources/io/reactivex/Notification.java
Normal file
83
sources/io/reactivex/Notification.java
Normal file
@@ -0,0 +1,83 @@
|
||||
package io.reactivex;
|
||||
|
||||
import io.reactivex.internal.functions.ObjectHelper;
|
||||
import io.reactivex.internal.util.NotificationLite;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class Notification<T> {
|
||||
static final Notification<Object> b = new Notification<>(null);
|
||||
final Object a;
|
||||
|
||||
private Notification(Object obj) {
|
||||
this.a = obj;
|
||||
}
|
||||
|
||||
public static <T> Notification<T> f() {
|
||||
return (Notification<T>) b;
|
||||
}
|
||||
|
||||
public Throwable a() {
|
||||
Object obj = this.a;
|
||||
if (NotificationLite.isError(obj)) {
|
||||
return NotificationLite.getError(obj);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public T b() {
|
||||
Object obj = this.a;
|
||||
if (obj == null || NotificationLite.isError(obj)) {
|
||||
return null;
|
||||
}
|
||||
return (T) this.a;
|
||||
}
|
||||
|
||||
public boolean c() {
|
||||
return this.a == null;
|
||||
}
|
||||
|
||||
public boolean d() {
|
||||
return NotificationLite.isError(this.a);
|
||||
}
|
||||
|
||||
public boolean e() {
|
||||
Object obj = this.a;
|
||||
return (obj == null || NotificationLite.isError(obj)) ? false : true;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof Notification) {
|
||||
return ObjectHelper.a(this.a, ((Notification) obj).a);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
Object obj = this.a;
|
||||
if (obj != null) {
|
||||
return obj.hashCode();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
Object obj = this.a;
|
||||
if (obj == null) {
|
||||
return "OnCompleteNotification";
|
||||
}
|
||||
if (NotificationLite.isError(obj)) {
|
||||
return "OnErrorNotification[" + NotificationLite.getError(obj) + "]";
|
||||
}
|
||||
return "OnNextNotification[" + this.a + "]";
|
||||
}
|
||||
|
||||
public static <T> Notification<T> a(T t) {
|
||||
ObjectHelper.a((Object) t, "value is null");
|
||||
return new Notification<>(t);
|
||||
}
|
||||
|
||||
public static <T> Notification<T> a(Throwable th) {
|
||||
ObjectHelper.a(th, "error is null");
|
||||
return new Notification<>(NotificationLite.error(th));
|
||||
}
|
||||
}
|
2813
sources/io/reactivex/Observable.java
Normal file
2813
sources/io/reactivex/Observable.java
Normal file
File diff suppressed because it is too large
Load Diff
6
sources/io/reactivex/ObservableConverter.java
Normal file
6
sources/io/reactivex/ObservableConverter.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface ObservableConverter<T, R> {
|
||||
R apply(Observable<T> observable);
|
||||
}
|
5
sources/io/reactivex/ObservableEmitter.java
Normal file
5
sources/io/reactivex/ObservableEmitter.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package io.reactivex;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface ObservableEmitter<T> extends Emitter<T> {
|
||||
}
|
6
sources/io/reactivex/ObservableOnSubscribe.java
Normal file
6
sources/io/reactivex/ObservableOnSubscribe.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface ObservableOnSubscribe<T> {
|
||||
void subscribe(ObservableEmitter<T> observableEmitter) throws Exception;
|
||||
}
|
6
sources/io/reactivex/ObservableOperator.java
Normal file
6
sources/io/reactivex/ObservableOperator.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface ObservableOperator<Downstream, Upstream> {
|
||||
Observer<? super Upstream> a(Observer<? super Downstream> observer) throws Exception;
|
||||
}
|
6
sources/io/reactivex/ObservableSource.java
Normal file
6
sources/io/reactivex/ObservableSource.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface ObservableSource<T> {
|
||||
void subscribe(Observer<? super T> observer);
|
||||
}
|
6
sources/io/reactivex/ObservableTransformer.java
Normal file
6
sources/io/reactivex/ObservableTransformer.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface ObservableTransformer<Upstream, Downstream> {
|
||||
ObservableSource<Downstream> apply(Observable<Upstream> observable);
|
||||
}
|
14
sources/io/reactivex/Observer.java
Normal file
14
sources/io/reactivex/Observer.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package io.reactivex;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface Observer<T> {
|
||||
void onComplete();
|
||||
|
||||
void onError(Throwable th);
|
||||
|
||||
void onNext(T t);
|
||||
|
||||
void onSubscribe(Disposable disposable);
|
||||
}
|
181
sources/io/reactivex/Scheduler.java
Normal file
181
sources/io/reactivex/Scheduler.java
Normal file
@@ -0,0 +1,181 @@
|
||||
package io.reactivex;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.exceptions.Exceptions;
|
||||
import io.reactivex.internal.disposables.EmptyDisposable;
|
||||
import io.reactivex.internal.disposables.SequentialDisposable;
|
||||
import io.reactivex.internal.schedulers.NewThreadWorker;
|
||||
import io.reactivex.internal.util.ExceptionHelper;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
import io.reactivex.schedulers.SchedulerRunnableIntrospection;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public abstract class Scheduler {
|
||||
static final long a = TimeUnit.MINUTES.toNanos(Long.getLong("rx2.scheduler.drift-tolerance", 15).longValue());
|
||||
|
||||
static final class DisposeTask implements Disposable, Runnable, SchedulerRunnableIntrospection {
|
||||
final Runnable a;
|
||||
final Worker b;
|
||||
Thread c;
|
||||
|
||||
DisposeTask(Runnable runnable, Worker worker) {
|
||||
this.a = runnable;
|
||||
this.b = worker;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
if (this.c == Thread.currentThread()) {
|
||||
Worker worker = this.b;
|
||||
if (worker instanceof NewThreadWorker) {
|
||||
((NewThreadWorker) worker).a();
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.b.dispose();
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
this.c = Thread.currentThread();
|
||||
try {
|
||||
this.a.run();
|
||||
} finally {
|
||||
dispose();
|
||||
this.c = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static final class PeriodicDirectTask implements Disposable, Runnable, SchedulerRunnableIntrospection {
|
||||
final Runnable a;
|
||||
final Worker b;
|
||||
volatile boolean c;
|
||||
|
||||
PeriodicDirectTask(Runnable runnable, Worker worker) {
|
||||
this.a = runnable;
|
||||
this.b = worker;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
this.c = true;
|
||||
this.b.dispose();
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (this.c) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.a.run();
|
||||
} catch (Throwable th) {
|
||||
Exceptions.b(th);
|
||||
this.b.dispose();
|
||||
throw ExceptionHelper.a(th);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class Worker implements Disposable {
|
||||
|
||||
final class PeriodicTask implements Runnable, SchedulerRunnableIntrospection {
|
||||
final Runnable a;
|
||||
final SequentialDisposable b;
|
||||
final long c;
|
||||
long d;
|
||||
long e;
|
||||
long f;
|
||||
|
||||
PeriodicTask(long j, Runnable runnable, long j2, SequentialDisposable sequentialDisposable, long j3) {
|
||||
this.a = runnable;
|
||||
this.b = sequentialDisposable;
|
||||
this.c = j3;
|
||||
this.e = j2;
|
||||
this.f = j;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
long j;
|
||||
this.a.run();
|
||||
if (this.b.isDisposed()) {
|
||||
return;
|
||||
}
|
||||
long a = Worker.this.a(TimeUnit.NANOSECONDS);
|
||||
long j2 = Scheduler.a;
|
||||
long j3 = a + j2;
|
||||
long j4 = this.e;
|
||||
if (j3 >= j4) {
|
||||
long j5 = this.c;
|
||||
if (a < j4 + j5 + j2) {
|
||||
long j6 = this.f;
|
||||
long j7 = this.d + 1;
|
||||
this.d = j7;
|
||||
j = j6 + (j7 * j5);
|
||||
this.e = a;
|
||||
this.b.replace(Worker.this.a(this, j - a, TimeUnit.NANOSECONDS));
|
||||
}
|
||||
}
|
||||
long j8 = this.c;
|
||||
long j9 = a + j8;
|
||||
long j10 = this.d + 1;
|
||||
this.d = j10;
|
||||
this.f = j9 - (j8 * j10);
|
||||
j = j9;
|
||||
this.e = a;
|
||||
this.b.replace(Worker.this.a(this, j - a, TimeUnit.NANOSECONDS));
|
||||
}
|
||||
}
|
||||
|
||||
public Disposable a(Runnable runnable) {
|
||||
return a(runnable, 0L, TimeUnit.NANOSECONDS);
|
||||
}
|
||||
|
||||
public abstract Disposable a(Runnable runnable, long j, TimeUnit timeUnit);
|
||||
|
||||
public Disposable a(Runnable runnable, long j, long j2, TimeUnit timeUnit) {
|
||||
SequentialDisposable sequentialDisposable = new SequentialDisposable();
|
||||
SequentialDisposable sequentialDisposable2 = new SequentialDisposable(sequentialDisposable);
|
||||
Runnable a = RxJavaPlugins.a(runnable);
|
||||
long nanos = timeUnit.toNanos(j2);
|
||||
long a2 = a(TimeUnit.NANOSECONDS);
|
||||
Disposable a3 = a(new PeriodicTask(a2 + timeUnit.toNanos(j), a, a2, sequentialDisposable2, nanos), j, timeUnit);
|
||||
if (a3 == EmptyDisposable.INSTANCE) {
|
||||
return a3;
|
||||
}
|
||||
sequentialDisposable.replace(a3);
|
||||
return sequentialDisposable2;
|
||||
}
|
||||
|
||||
public long a(TimeUnit timeUnit) {
|
||||
return timeUnit.convert(System.currentTimeMillis(), TimeUnit.MILLISECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
public long a(TimeUnit timeUnit) {
|
||||
return timeUnit.convert(System.currentTimeMillis(), TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
public abstract Worker a();
|
||||
|
||||
public Disposable a(Runnable runnable) {
|
||||
return a(runnable, 0L, TimeUnit.NANOSECONDS);
|
||||
}
|
||||
|
||||
public Disposable a(Runnable runnable, long j, TimeUnit timeUnit) {
|
||||
Worker a2 = a();
|
||||
DisposeTask disposeTask = new DisposeTask(RxJavaPlugins.a(runnable), a2);
|
||||
a2.a(disposeTask, j, timeUnit);
|
||||
return disposeTask;
|
||||
}
|
||||
|
||||
public Disposable a(Runnable runnable, long j, long j2, TimeUnit timeUnit) {
|
||||
Worker a2 = a();
|
||||
PeriodicDirectTask periodicDirectTask = new PeriodicDirectTask(RxJavaPlugins.a(runnable), a2);
|
||||
Disposable a3 = a2.a(periodicDirectTask, j, j2, timeUnit);
|
||||
return a3 == EmptyDisposable.INSTANCE ? a3 : periodicDirectTask;
|
||||
}
|
||||
}
|
48
sources/io/reactivex/Single.java
Normal file
48
sources/io/reactivex/Single.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package io.reactivex;
|
||||
|
||||
import io.reactivex.exceptions.Exceptions;
|
||||
import io.reactivex.functions.Function;
|
||||
import io.reactivex.internal.functions.ObjectHelper;
|
||||
import io.reactivex.internal.fuseable.FuseToObservable;
|
||||
import io.reactivex.internal.observers.BlockingMultiObserver;
|
||||
import io.reactivex.internal.operators.single.SingleMap;
|
||||
import io.reactivex.internal.operators.single.SingleToObservable;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public abstract class Single<T> implements SingleSource<T> {
|
||||
public final <R> Single<R> a(Function<? super T, ? extends R> function) {
|
||||
ObjectHelper.a(function, "mapper is null");
|
||||
return RxJavaPlugins.a(new SingleMap(this, function));
|
||||
}
|
||||
|
||||
public final T b() {
|
||||
BlockingMultiObserver blockingMultiObserver = new BlockingMultiObserver();
|
||||
a(blockingMultiObserver);
|
||||
return (T) blockingMultiObserver.a();
|
||||
}
|
||||
|
||||
protected abstract void b(SingleObserver<? super T> singleObserver);
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public final Observable<T> c() {
|
||||
return this instanceof FuseToObservable ? ((FuseToObservable) this).a() : RxJavaPlugins.a(new SingleToObservable(this));
|
||||
}
|
||||
|
||||
@Override // io.reactivex.SingleSource
|
||||
public final void a(SingleObserver<? super T> singleObserver) {
|
||||
ObjectHelper.a(singleObserver, "subscriber is null");
|
||||
SingleObserver<? super T> a = RxJavaPlugins.a(this, singleObserver);
|
||||
ObjectHelper.a(a, "The RxJavaPlugins.onSubscribe hook returned a null SingleObserver. Please check the handler provided to RxJavaPlugins.setOnSingleSubscribe for invalid null returns. Further reading: https://github.com/ReactiveX/RxJava/wiki/Plugins");
|
||||
try {
|
||||
b(a);
|
||||
} catch (NullPointerException e) {
|
||||
throw e;
|
||||
} catch (Throwable th) {
|
||||
Exceptions.b(th);
|
||||
NullPointerException nullPointerException = new NullPointerException("subscribeActual failed");
|
||||
nullPointerException.initCause(th);
|
||||
throw nullPointerException;
|
||||
}
|
||||
}
|
||||
}
|
12
sources/io/reactivex/SingleObserver.java
Normal file
12
sources/io/reactivex/SingleObserver.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package io.reactivex;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface SingleObserver<T> {
|
||||
void onError(Throwable th);
|
||||
|
||||
void onSubscribe(Disposable disposable);
|
||||
|
||||
void onSuccess(T t);
|
||||
}
|
6
sources/io/reactivex/SingleSource.java
Normal file
6
sources/io/reactivex/SingleSource.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface SingleSource<T> {
|
||||
void a(SingleObserver<? super T> singleObserver);
|
||||
}
|
33
sources/io/reactivex/android/MainThreadDisposable.java
Normal file
33
sources/io/reactivex/android/MainThreadDisposable.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package io.reactivex.android;
|
||||
|
||||
import android.os.Looper;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public abstract class MainThreadDisposable implements Disposable {
|
||||
private final AtomicBoolean a = new AtomicBoolean();
|
||||
|
||||
public final boolean a() {
|
||||
return this.a.get();
|
||||
}
|
||||
|
||||
protected abstract void b();
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public final void dispose() {
|
||||
if (this.a.compareAndSet(false, true)) {
|
||||
if (Looper.myLooper() == Looper.getMainLooper()) {
|
||||
b();
|
||||
} else {
|
||||
AndroidSchedulers.a().a(new Runnable() { // from class: io.reactivex.android.MainThreadDisposable.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
MainThreadDisposable.this.b();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
58
sources/io/reactivex/android/plugins/RxAndroidPlugins.java
Normal file
58
sources/io/reactivex/android/plugins/RxAndroidPlugins.java
Normal file
@@ -0,0 +1,58 @@
|
||||
package io.reactivex.android.plugins;
|
||||
|
||||
import io.reactivex.Scheduler;
|
||||
import io.reactivex.exceptions.Exceptions;
|
||||
import io.reactivex.functions.Function;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class RxAndroidPlugins {
|
||||
private static volatile Function<Callable<Scheduler>, Scheduler> a;
|
||||
private static volatile Function<Scheduler, Scheduler> b;
|
||||
|
||||
public static Scheduler a(Scheduler scheduler) {
|
||||
if (scheduler == null) {
|
||||
throw new NullPointerException("scheduler == null");
|
||||
}
|
||||
Function<Scheduler, Scheduler> function = b;
|
||||
return function == null ? scheduler : (Scheduler) a((Function<Scheduler, R>) function, scheduler);
|
||||
}
|
||||
|
||||
public static Scheduler b(Callable<Scheduler> callable) {
|
||||
if (callable == null) {
|
||||
throw new NullPointerException("scheduler == null");
|
||||
}
|
||||
Function<Callable<Scheduler>, Scheduler> function = a;
|
||||
return function == null ? a(callable) : a(function, callable);
|
||||
}
|
||||
|
||||
static Scheduler a(Callable<Scheduler> callable) {
|
||||
try {
|
||||
Scheduler call = callable.call();
|
||||
if (call != null) {
|
||||
return call;
|
||||
}
|
||||
throw new NullPointerException("Scheduler Callable returned null");
|
||||
} catch (Throwable th) {
|
||||
Exceptions.a(th);
|
||||
throw null;
|
||||
}
|
||||
}
|
||||
|
||||
static Scheduler a(Function<Callable<Scheduler>, Scheduler> function, Callable<Scheduler> callable) {
|
||||
Scheduler scheduler = (Scheduler) a((Function<Callable<Scheduler>, R>) function, callable);
|
||||
if (scheduler != null) {
|
||||
return scheduler;
|
||||
}
|
||||
throw new NullPointerException("Scheduler Callable returned null");
|
||||
}
|
||||
|
||||
static <T, R> R a(Function<T, R> function, T t) {
|
||||
try {
|
||||
return function.apply(t);
|
||||
} catch (Throwable th) {
|
||||
Exceptions.a(th);
|
||||
throw null;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
package io.reactivex.android.schedulers;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import io.reactivex.Scheduler;
|
||||
import io.reactivex.android.plugins.RxAndroidPlugins;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class AndroidSchedulers {
|
||||
private static final Scheduler a = RxAndroidPlugins.b(new Callable<Scheduler>() { // from class: io.reactivex.android.schedulers.AndroidSchedulers.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // java.util.concurrent.Callable
|
||||
public Scheduler call() throws Exception {
|
||||
return MainHolder.a;
|
||||
}
|
||||
});
|
||||
|
||||
private static final class MainHolder {
|
||||
static final Scheduler a = new HandlerScheduler(new Handler(Looper.getMainLooper()), false);
|
||||
}
|
||||
|
||||
public static Scheduler a() {
|
||||
return RxAndroidPlugins.a(a);
|
||||
}
|
||||
}
|
106
sources/io/reactivex/android/schedulers/HandlerScheduler.java
Normal file
106
sources/io/reactivex/android/schedulers/HandlerScheduler.java
Normal file
@@ -0,0 +1,106 @@
|
||||
package io.reactivex.android.schedulers;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import io.reactivex.Scheduler;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.disposables.Disposables;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
final class HandlerScheduler extends Scheduler {
|
||||
private final Handler b;
|
||||
private final boolean c;
|
||||
|
||||
private static final class HandlerWorker extends Scheduler.Worker {
|
||||
private final Handler a;
|
||||
private final boolean b;
|
||||
private volatile boolean c;
|
||||
|
||||
HandlerWorker(Handler handler, boolean z) {
|
||||
this.a = handler;
|
||||
this.b = z;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Scheduler.Worker
|
||||
@SuppressLint({"NewApi"})
|
||||
public Disposable a(Runnable runnable, long j, TimeUnit timeUnit) {
|
||||
if (runnable == null) {
|
||||
throw new NullPointerException("run == null");
|
||||
}
|
||||
if (timeUnit == null) {
|
||||
throw new NullPointerException("unit == null");
|
||||
}
|
||||
if (this.c) {
|
||||
return Disposables.a();
|
||||
}
|
||||
ScheduledRunnable scheduledRunnable = new ScheduledRunnable(this.a, RxJavaPlugins.a(runnable));
|
||||
Message obtain = Message.obtain(this.a, scheduledRunnable);
|
||||
obtain.obj = this;
|
||||
if (this.b) {
|
||||
obtain.setAsynchronous(true);
|
||||
}
|
||||
this.a.sendMessageDelayed(obtain, timeUnit.toMillis(j));
|
||||
if (!this.c) {
|
||||
return scheduledRunnable;
|
||||
}
|
||||
this.a.removeCallbacks(scheduledRunnable);
|
||||
return Disposables.a();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
this.c = true;
|
||||
this.a.removeCallbacksAndMessages(this);
|
||||
}
|
||||
}
|
||||
|
||||
private static final class ScheduledRunnable implements Runnable, Disposable {
|
||||
private final Handler a;
|
||||
private final Runnable b;
|
||||
|
||||
ScheduledRunnable(Handler handler, Runnable runnable) {
|
||||
this.a = handler;
|
||||
this.b = runnable;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
this.a.removeCallbacks(this);
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
try {
|
||||
this.b.run();
|
||||
} catch (Throwable th) {
|
||||
RxJavaPlugins.b(th);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HandlerScheduler(Handler handler, boolean z) {
|
||||
this.b = handler;
|
||||
this.c = z;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Scheduler
|
||||
public Disposable a(Runnable runnable, long j, TimeUnit timeUnit) {
|
||||
if (runnable == null) {
|
||||
throw new NullPointerException("run == null");
|
||||
}
|
||||
if (timeUnit == null) {
|
||||
throw new NullPointerException("unit == null");
|
||||
}
|
||||
ScheduledRunnable scheduledRunnable = new ScheduledRunnable(this.b, RxJavaPlugins.a(runnable));
|
||||
this.b.postDelayed(scheduledRunnable, timeUnit.toMillis(j));
|
||||
return scheduledRunnable;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Scheduler
|
||||
public Scheduler.Worker a() {
|
||||
return new HandlerWorker(this.b, this.c);
|
||||
}
|
||||
}
|
11
sources/io/reactivex/annotations/BackpressureKind.java
Normal file
11
sources/io/reactivex/annotations/BackpressureKind.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package io.reactivex.annotations;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public enum BackpressureKind {
|
||||
PASS_THROUGH,
|
||||
FULL,
|
||||
SPECIAL,
|
||||
UNBOUNDED_IN,
|
||||
ERROR,
|
||||
NONE
|
||||
}
|
135
sources/io/reactivex/disposables/CompositeDisposable.java
Normal file
135
sources/io/reactivex/disposables/CompositeDisposable.java
Normal file
@@ -0,0 +1,135 @@
|
||||
package io.reactivex.disposables;
|
||||
|
||||
import io.reactivex.exceptions.CompositeException;
|
||||
import io.reactivex.exceptions.Exceptions;
|
||||
import io.reactivex.internal.disposables.DisposableContainer;
|
||||
import io.reactivex.internal.functions.ObjectHelper;
|
||||
import io.reactivex.internal.util.ExceptionHelper;
|
||||
import io.reactivex.internal.util.OpenHashSet;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class CompositeDisposable implements Disposable, DisposableContainer {
|
||||
OpenHashSet<Disposable> a;
|
||||
volatile boolean b;
|
||||
|
||||
@Override // io.reactivex.internal.disposables.DisposableContainer
|
||||
public boolean a(Disposable disposable) {
|
||||
if (!c(disposable)) {
|
||||
return false;
|
||||
}
|
||||
disposable.dispose();
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean b() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.disposables.DisposableContainer
|
||||
public boolean c(Disposable disposable) {
|
||||
ObjectHelper.a(disposable, "Disposable item is null");
|
||||
if (this.b) {
|
||||
return false;
|
||||
}
|
||||
synchronized (this) {
|
||||
if (this.b) {
|
||||
return false;
|
||||
}
|
||||
OpenHashSet<Disposable> openHashSet = this.a;
|
||||
if (openHashSet != null && openHashSet.b(disposable)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
if (this.b) {
|
||||
return;
|
||||
}
|
||||
synchronized (this) {
|
||||
if (this.b) {
|
||||
return;
|
||||
}
|
||||
this.b = true;
|
||||
OpenHashSet<Disposable> openHashSet = this.a;
|
||||
this.a = null;
|
||||
a(openHashSet);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.disposables.DisposableContainer
|
||||
public boolean b(Disposable disposable) {
|
||||
ObjectHelper.a(disposable, "d is null");
|
||||
if (!this.b) {
|
||||
synchronized (this) {
|
||||
if (!this.b) {
|
||||
OpenHashSet<Disposable> openHashSet = this.a;
|
||||
if (openHashSet == null) {
|
||||
openHashSet = new OpenHashSet<>();
|
||||
this.a = openHashSet;
|
||||
}
|
||||
openHashSet.a((OpenHashSet<Disposable>) disposable);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
disposable.dispose();
|
||||
return false;
|
||||
}
|
||||
|
||||
public void a() {
|
||||
if (this.b) {
|
||||
return;
|
||||
}
|
||||
synchronized (this) {
|
||||
if (this.b) {
|
||||
return;
|
||||
}
|
||||
OpenHashSet<Disposable> openHashSet = this.a;
|
||||
this.a = null;
|
||||
a(openHashSet);
|
||||
}
|
||||
}
|
||||
|
||||
public int c() {
|
||||
if (this.b) {
|
||||
return 0;
|
||||
}
|
||||
synchronized (this) {
|
||||
if (this.b) {
|
||||
return 0;
|
||||
}
|
||||
OpenHashSet<Disposable> openHashSet = this.a;
|
||||
return openHashSet != null ? openHashSet.c() : 0;
|
||||
}
|
||||
}
|
||||
|
||||
void a(OpenHashSet<Disposable> openHashSet) {
|
||||
if (openHashSet == null) {
|
||||
return;
|
||||
}
|
||||
ArrayList arrayList = null;
|
||||
for (Object obj : openHashSet.a()) {
|
||||
if (obj instanceof Disposable) {
|
||||
try {
|
||||
((Disposable) obj).dispose();
|
||||
} catch (Throwable th) {
|
||||
Exceptions.b(th);
|
||||
if (arrayList == null) {
|
||||
arrayList = new ArrayList();
|
||||
}
|
||||
arrayList.add(th);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (arrayList != null) {
|
||||
if (arrayList.size() == 1) {
|
||||
throw ExceptionHelper.a((Throwable) arrayList.get(0));
|
||||
}
|
||||
throw new CompositeException(arrayList);
|
||||
}
|
||||
}
|
||||
}
|
6
sources/io/reactivex/disposables/Disposable.java
Normal file
6
sources/io/reactivex/disposables/Disposable.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex.disposables;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface Disposable {
|
||||
void dispose();
|
||||
}
|
21
sources/io/reactivex/disposables/Disposables.java
Normal file
21
sources/io/reactivex/disposables/Disposables.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package io.reactivex.disposables;
|
||||
|
||||
import io.reactivex.internal.disposables.EmptyDisposable;
|
||||
import io.reactivex.internal.functions.Functions;
|
||||
import io.reactivex.internal.functions.ObjectHelper;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class Disposables {
|
||||
public static Disposable a(Runnable runnable) {
|
||||
ObjectHelper.a(runnable, "run is null");
|
||||
return new RunnableDisposable(runnable);
|
||||
}
|
||||
|
||||
public static Disposable b() {
|
||||
return a(Functions.b);
|
||||
}
|
||||
|
||||
public static Disposable a() {
|
||||
return EmptyDisposable.INSTANCE;
|
||||
}
|
||||
}
|
28
sources/io/reactivex/disposables/ReferenceDisposable.java
Normal file
28
sources/io/reactivex/disposables/ReferenceDisposable.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package io.reactivex.disposables;
|
||||
|
||||
import io.reactivex.internal.functions.ObjectHelper;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
abstract class ReferenceDisposable<T> extends AtomicReference<T> implements Disposable {
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
ReferenceDisposable(T t) {
|
||||
super(t);
|
||||
ObjectHelper.a((Object) t, "value is null");
|
||||
}
|
||||
|
||||
protected abstract void a(T t);
|
||||
|
||||
public final boolean a() {
|
||||
return get() == null;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public final void dispose() {
|
||||
T andSet;
|
||||
if (get() == null || (andSet = getAndSet(null)) == null) {
|
||||
return;
|
||||
}
|
||||
a(andSet);
|
||||
}
|
||||
}
|
19
sources/io/reactivex/disposables/RunnableDisposable.java
Normal file
19
sources/io/reactivex/disposables/RunnableDisposable.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package io.reactivex.disposables;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
final class RunnableDisposable extends ReferenceDisposable<Runnable> {
|
||||
RunnableDisposable(Runnable runnable) {
|
||||
super(runnable);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.atomic.AtomicReference
|
||||
public String toString() {
|
||||
return "RunnableDisposable(disposed=" + a() + ", " + get() + ")";
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // io.reactivex.disposables.ReferenceDisposable
|
||||
public void a(Runnable runnable) {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
216
sources/io/reactivex/exceptions/CompositeException.java
Normal file
216
sources/io/reactivex/exceptions/CompositeException.java
Normal file
@@ -0,0 +1,216 @@
|
||||
package io.reactivex.exceptions;
|
||||
|
||||
import com.ubtrobot.jimu.robotapi.PeripheralType;
|
||||
import java.io.PrintStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class CompositeException extends RuntimeException {
|
||||
private static final long serialVersionUID = 3026362227162912146L;
|
||||
private Throwable cause;
|
||||
private final List<Throwable> exceptions;
|
||||
private final String message;
|
||||
|
||||
static final class CompositeExceptionCausalChain extends RuntimeException {
|
||||
CompositeExceptionCausalChain() {
|
||||
}
|
||||
|
||||
@Override // java.lang.Throwable
|
||||
public String getMessage() {
|
||||
return "Chain of Causes for CompositeException In Order Received =>";
|
||||
}
|
||||
}
|
||||
|
||||
static abstract class PrintStreamOrWriter {
|
||||
PrintStreamOrWriter() {
|
||||
}
|
||||
|
||||
abstract void a(Object obj);
|
||||
}
|
||||
|
||||
static final class WrappedPrintStream extends PrintStreamOrWriter {
|
||||
private final PrintStream a;
|
||||
|
||||
WrappedPrintStream(PrintStream printStream) {
|
||||
this.a = printStream;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.exceptions.CompositeException.PrintStreamOrWriter
|
||||
void a(Object obj) {
|
||||
this.a.println(obj);
|
||||
}
|
||||
}
|
||||
|
||||
static final class WrappedPrintWriter extends PrintStreamOrWriter {
|
||||
private final PrintWriter a;
|
||||
|
||||
WrappedPrintWriter(PrintWriter printWriter) {
|
||||
this.a = printWriter;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.exceptions.CompositeException.PrintStreamOrWriter
|
||||
void a(Object obj) {
|
||||
this.a.println(obj);
|
||||
}
|
||||
}
|
||||
|
||||
public CompositeException(Throwable... thArr) {
|
||||
this(thArr == null ? Collections.singletonList(new NullPointerException("exceptions was null")) : Arrays.asList(thArr));
|
||||
}
|
||||
|
||||
private void appendStackTrace(StringBuilder sb, Throwable th, String str) {
|
||||
sb.append(str);
|
||||
sb.append(th);
|
||||
sb.append('\n');
|
||||
for (StackTraceElement stackTraceElement : th.getStackTrace()) {
|
||||
sb.append("\t\tat ");
|
||||
sb.append(stackTraceElement);
|
||||
sb.append('\n');
|
||||
}
|
||||
if (th.getCause() != null) {
|
||||
sb.append("\tCaused by: ");
|
||||
appendStackTrace(sb, th.getCause(), "");
|
||||
}
|
||||
}
|
||||
|
||||
private List<Throwable> getListOfCauses(Throwable th) {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
Throwable cause = th.getCause();
|
||||
if (cause != null && cause != th) {
|
||||
while (true) {
|
||||
arrayList.add(cause);
|
||||
Throwable cause2 = cause.getCause();
|
||||
if (cause2 == null || cause2 == cause) {
|
||||
break;
|
||||
}
|
||||
cause = cause2;
|
||||
}
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
@Override // java.lang.Throwable
|
||||
public synchronized Throwable getCause() {
|
||||
if (this.cause == null) {
|
||||
CompositeExceptionCausalChain compositeExceptionCausalChain = new CompositeExceptionCausalChain();
|
||||
HashSet hashSet = new HashSet();
|
||||
Iterator<Throwable> it = this.exceptions.iterator();
|
||||
Throwable th = compositeExceptionCausalChain;
|
||||
while (it.hasNext()) {
|
||||
Throwable next = it.next();
|
||||
if (!hashSet.contains(next)) {
|
||||
hashSet.add(next);
|
||||
for (Throwable th2 : getListOfCauses(next)) {
|
||||
if (hashSet.contains(th2)) {
|
||||
next = new RuntimeException("Duplicate found in causal chain so cropping to prevent loop ...");
|
||||
} else {
|
||||
hashSet.add(th2);
|
||||
}
|
||||
}
|
||||
try {
|
||||
th.initCause(next);
|
||||
} catch (Throwable unused) {
|
||||
}
|
||||
th = getRootCause(th);
|
||||
}
|
||||
}
|
||||
this.cause = compositeExceptionCausalChain;
|
||||
}
|
||||
return this.cause;
|
||||
}
|
||||
|
||||
public List<Throwable> getExceptions() {
|
||||
return this.exceptions;
|
||||
}
|
||||
|
||||
@Override // java.lang.Throwable
|
||||
public String getMessage() {
|
||||
return this.message;
|
||||
}
|
||||
|
||||
Throwable getRootCause(Throwable th) {
|
||||
Throwable cause = th.getCause();
|
||||
if (cause == null || this.cause == cause) {
|
||||
return th;
|
||||
}
|
||||
while (true) {
|
||||
Throwable cause2 = cause.getCause();
|
||||
if (cause2 == null || cause2 == cause) {
|
||||
break;
|
||||
}
|
||||
cause = cause2;
|
||||
}
|
||||
return cause;
|
||||
}
|
||||
|
||||
@Override // java.lang.Throwable
|
||||
public void printStackTrace() {
|
||||
printStackTrace(System.err);
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return this.exceptions.size();
|
||||
}
|
||||
|
||||
@Override // java.lang.Throwable
|
||||
public void printStackTrace(PrintStream printStream) {
|
||||
printStackTrace(new WrappedPrintStream(printStream));
|
||||
}
|
||||
|
||||
@Override // java.lang.Throwable
|
||||
public void printStackTrace(PrintWriter printWriter) {
|
||||
printStackTrace(new WrappedPrintWriter(printWriter));
|
||||
}
|
||||
|
||||
public CompositeException(Iterable<? extends Throwable> iterable) {
|
||||
LinkedHashSet linkedHashSet = new LinkedHashSet();
|
||||
ArrayList arrayList = new ArrayList();
|
||||
if (iterable != null) {
|
||||
for (Throwable th : iterable) {
|
||||
if (th instanceof CompositeException) {
|
||||
linkedHashSet.addAll(((CompositeException) th).getExceptions());
|
||||
} else if (th != null) {
|
||||
linkedHashSet.add(th);
|
||||
} else {
|
||||
linkedHashSet.add(new NullPointerException("Throwable was null!"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
linkedHashSet.add(new NullPointerException("errors was null"));
|
||||
}
|
||||
if (!linkedHashSet.isEmpty()) {
|
||||
arrayList.addAll(linkedHashSet);
|
||||
this.exceptions = Collections.unmodifiableList(arrayList);
|
||||
this.message = this.exceptions.size() + " exceptions occurred. ";
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException("errors is empty");
|
||||
}
|
||||
|
||||
private void printStackTrace(PrintStreamOrWriter printStreamOrWriter) {
|
||||
StringBuilder sb = new StringBuilder(PeripheralType.SERVO);
|
||||
sb.append(this);
|
||||
sb.append('\n');
|
||||
for (StackTraceElement stackTraceElement : getStackTrace()) {
|
||||
sb.append("\tat ");
|
||||
sb.append(stackTraceElement);
|
||||
sb.append('\n');
|
||||
}
|
||||
int i = 1;
|
||||
for (Throwable th : this.exceptions) {
|
||||
sb.append(" ComposedException ");
|
||||
sb.append(i);
|
||||
sb.append(" :\n");
|
||||
appendStackTrace(sb, th, "\t");
|
||||
i++;
|
||||
}
|
||||
printStreamOrWriter.a(sb.toString());
|
||||
}
|
||||
}
|
22
sources/io/reactivex/exceptions/Exceptions.java
Normal file
22
sources/io/reactivex/exceptions/Exceptions.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package io.reactivex.exceptions;
|
||||
|
||||
import io.reactivex.internal.util.ExceptionHelper;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class Exceptions {
|
||||
public static RuntimeException a(Throwable th) {
|
||||
throw ExceptionHelper.a(th);
|
||||
}
|
||||
|
||||
public static void b(Throwable th) {
|
||||
if (th instanceof VirtualMachineError) {
|
||||
throw ((VirtualMachineError) th);
|
||||
}
|
||||
if (th instanceof ThreadDeath) {
|
||||
throw ((ThreadDeath) th);
|
||||
}
|
||||
if (th instanceof LinkageError) {
|
||||
throw ((LinkageError) th);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
package io.reactivex.exceptions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class MissingBackpressureException extends RuntimeException {
|
||||
private static final long serialVersionUID = 8517344746016032542L;
|
||||
|
||||
public MissingBackpressureException() {
|
||||
}
|
||||
|
||||
public MissingBackpressureException(String str) {
|
||||
super(str);
|
||||
}
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
package io.reactivex.exceptions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class OnErrorNotImplementedException extends RuntimeException {
|
||||
private static final long serialVersionUID = -6298857009889503852L;
|
||||
|
||||
public OnErrorNotImplementedException(String str, Throwable th) {
|
||||
super(str, th == null ? new NullPointerException() : th);
|
||||
}
|
||||
|
||||
/* JADX WARN: Illegal instructions before constructor call */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public OnErrorNotImplementedException(java.lang.Throwable r3) {
|
||||
/*
|
||||
r2 = this;
|
||||
java.lang.StringBuilder r0 = new java.lang.StringBuilder
|
||||
r0.<init>()
|
||||
java.lang.String r1 = "The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | "
|
||||
r0.append(r1)
|
||||
if (r3 == 0) goto L11
|
||||
java.lang.String r1 = r3.getMessage()
|
||||
goto L13
|
||||
L11:
|
||||
java.lang.String r1 = ""
|
||||
L13:
|
||||
r0.append(r1)
|
||||
java.lang.String r0 = r0.toString()
|
||||
r2.<init>(r0, r3)
|
||||
return
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: io.reactivex.exceptions.OnErrorNotImplementedException.<init>(java.lang.Throwable):void");
|
||||
}
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
package io.reactivex.exceptions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class ProtocolViolationException extends IllegalStateException {
|
||||
private static final long serialVersionUID = 1644750035281290266L;
|
||||
|
||||
public ProtocolViolationException(String str) {
|
||||
super(str);
|
||||
}
|
||||
}
|
10
sources/io/reactivex/exceptions/UndeliverableException.java
Normal file
10
sources/io/reactivex/exceptions/UndeliverableException.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package io.reactivex.exceptions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class UndeliverableException extends IllegalStateException {
|
||||
private static final long serialVersionUID = 1644750035281290266L;
|
||||
|
||||
public UndeliverableException(Throwable th) {
|
||||
super("The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | " + th.getMessage(), th);
|
||||
}
|
||||
}
|
9
sources/io/reactivex/flowables/GroupedFlowable.java
Normal file
9
sources/io/reactivex/flowables/GroupedFlowable.java
Normal file
@@ -0,0 +1,9 @@
|
||||
package io.reactivex.flowables;
|
||||
|
||||
import io.reactivex.Flowable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public abstract class GroupedFlowable<K, T> extends Flowable<T> {
|
||||
protected GroupedFlowable(K k) {
|
||||
}
|
||||
}
|
6
sources/io/reactivex/functions/Action.java
Normal file
6
sources/io/reactivex/functions/Action.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex.functions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface Action {
|
||||
void run() throws Exception;
|
||||
}
|
6
sources/io/reactivex/functions/BiConsumer.java
Normal file
6
sources/io/reactivex/functions/BiConsumer.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex.functions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface BiConsumer<T1, T2> {
|
||||
void a(T1 t1, T2 t2) throws Exception;
|
||||
}
|
6
sources/io/reactivex/functions/BiFunction.java
Normal file
6
sources/io/reactivex/functions/BiFunction.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex.functions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface BiFunction<T1, T2, R> {
|
||||
R apply(T1 t1, T2 t2) throws Exception;
|
||||
}
|
6
sources/io/reactivex/functions/BiPredicate.java
Normal file
6
sources/io/reactivex/functions/BiPredicate.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex.functions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface BiPredicate<T1, T2> {
|
||||
boolean a(T1 t1, T2 t2) throws Exception;
|
||||
}
|
6
sources/io/reactivex/functions/BooleanSupplier.java
Normal file
6
sources/io/reactivex/functions/BooleanSupplier.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex.functions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface BooleanSupplier {
|
||||
boolean a() throws Exception;
|
||||
}
|
6
sources/io/reactivex/functions/Cancellable.java
Normal file
6
sources/io/reactivex/functions/Cancellable.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex.functions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface Cancellable {
|
||||
void cancel() throws Exception;
|
||||
}
|
6
sources/io/reactivex/functions/Consumer.java
Normal file
6
sources/io/reactivex/functions/Consumer.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex.functions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface Consumer<T> {
|
||||
void accept(T t) throws Exception;
|
||||
}
|
6
sources/io/reactivex/functions/Function.java
Normal file
6
sources/io/reactivex/functions/Function.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex.functions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface Function<T, R> {
|
||||
R apply(T t) throws Exception;
|
||||
}
|
6
sources/io/reactivex/functions/Function3.java
Normal file
6
sources/io/reactivex/functions/Function3.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex.functions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface Function3<T1, T2, T3, R> {
|
||||
R apply(T1 t1, T2 t2, T3 t3) throws Exception;
|
||||
}
|
6
sources/io/reactivex/functions/Function4.java
Normal file
6
sources/io/reactivex/functions/Function4.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex.functions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface Function4<T1, T2, T3, T4, R> {
|
||||
R a(T1 t1, T2 t2, T3 t3, T4 t4) throws Exception;
|
||||
}
|
6
sources/io/reactivex/functions/Function5.java
Normal file
6
sources/io/reactivex/functions/Function5.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex.functions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface Function5<T1, T2, T3, T4, T5, R> {
|
||||
R a(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) throws Exception;
|
||||
}
|
6
sources/io/reactivex/functions/Function6.java
Normal file
6
sources/io/reactivex/functions/Function6.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex.functions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface Function6<T1, T2, T3, T4, T5, T6, R> {
|
||||
R a(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6) throws Exception;
|
||||
}
|
6
sources/io/reactivex/functions/Function7.java
Normal file
6
sources/io/reactivex/functions/Function7.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex.functions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface Function7<T1, T2, T3, T4, T5, T6, T7, R> {
|
||||
R a(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7) throws Exception;
|
||||
}
|
6
sources/io/reactivex/functions/Function8.java
Normal file
6
sources/io/reactivex/functions/Function8.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex.functions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface Function8<T1, T2, T3, T4, T5, T6, T7, T8, R> {
|
||||
R a(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8) throws Exception;
|
||||
}
|
6
sources/io/reactivex/functions/Function9.java
Normal file
6
sources/io/reactivex/functions/Function9.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex.functions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface Function9<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> {
|
||||
R a(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9) throws Exception;
|
||||
}
|
5
sources/io/reactivex/functions/LongConsumer.java
Normal file
5
sources/io/reactivex/functions/LongConsumer.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package io.reactivex.functions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface LongConsumer {
|
||||
}
|
6
sources/io/reactivex/functions/Predicate.java
Normal file
6
sources/io/reactivex/functions/Predicate.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package io.reactivex.functions;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface Predicate<T> {
|
||||
boolean a(T t) throws Exception;
|
||||
}
|
@@ -0,0 +1,60 @@
|
||||
package io.reactivex.internal.disposables;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import java.util.concurrent.atomic.AtomicReferenceArray;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class ArrayCompositeDisposable extends AtomicReferenceArray<Disposable> implements Disposable {
|
||||
private static final long serialVersionUID = 2746389416410565408L;
|
||||
|
||||
public ArrayCompositeDisposable(int i) {
|
||||
super(i);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
Disposable andSet;
|
||||
if (get(0) != DisposableHelper.DISPOSED) {
|
||||
int length = length();
|
||||
for (int i = 0; i < length; i++) {
|
||||
Disposable disposable = get(i);
|
||||
DisposableHelper disposableHelper = DisposableHelper.DISPOSED;
|
||||
if (disposable != disposableHelper && (andSet = getAndSet(i, disposableHelper)) != DisposableHelper.DISPOSED && andSet != null) {
|
||||
andSet.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isDisposed() {
|
||||
return get(0) == DisposableHelper.DISPOSED;
|
||||
}
|
||||
|
||||
public Disposable replaceResource(int i, Disposable disposable) {
|
||||
Disposable disposable2;
|
||||
do {
|
||||
disposable2 = get(i);
|
||||
if (disposable2 == DisposableHelper.DISPOSED) {
|
||||
disposable.dispose();
|
||||
return null;
|
||||
}
|
||||
} while (!compareAndSet(i, disposable2, disposable));
|
||||
return disposable2;
|
||||
}
|
||||
|
||||
public boolean setResource(int i, Disposable disposable) {
|
||||
Disposable disposable2;
|
||||
do {
|
||||
disposable2 = get(i);
|
||||
if (disposable2 == DisposableHelper.DISPOSED) {
|
||||
disposable.dispose();
|
||||
return false;
|
||||
}
|
||||
} while (!compareAndSet(i, disposable2, disposable));
|
||||
if (disposable2 == null) {
|
||||
return true;
|
||||
}
|
||||
disposable2.dispose();
|
||||
return true;
|
||||
}
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
package io.reactivex.internal.disposables;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.exceptions.Exceptions;
|
||||
import io.reactivex.functions.Cancellable;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class CancellableDisposable extends AtomicReference<Cancellable> implements Disposable {
|
||||
private static final long serialVersionUID = 5718521705281392066L;
|
||||
|
||||
public CancellableDisposable(Cancellable cancellable) {
|
||||
super(cancellable);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
Cancellable andSet;
|
||||
if (get() == null || (andSet = getAndSet(null)) == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
andSet.cancel();
|
||||
} catch (Exception e) {
|
||||
Exceptions.b(e);
|
||||
RxJavaPlugins.b(e);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isDisposed() {
|
||||
return get() == null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
package io.reactivex.internal.disposables;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface DisposableContainer {
|
||||
boolean a(Disposable disposable);
|
||||
|
||||
boolean b(Disposable disposable);
|
||||
|
||||
boolean c(Disposable disposable);
|
||||
}
|
113
sources/io/reactivex/internal/disposables/DisposableHelper.java
Normal file
113
sources/io/reactivex/internal/disposables/DisposableHelper.java
Normal file
@@ -0,0 +1,113 @@
|
||||
package io.reactivex.internal.disposables;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.exceptions.ProtocolViolationException;
|
||||
import io.reactivex.internal.functions.ObjectHelper;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public enum DisposableHelper implements Disposable {
|
||||
DISPOSED;
|
||||
|
||||
public static boolean dispose(AtomicReference<Disposable> atomicReference) {
|
||||
Disposable andSet;
|
||||
Disposable disposable = atomicReference.get();
|
||||
DisposableHelper disposableHelper = DISPOSED;
|
||||
if (disposable == disposableHelper || (andSet = atomicReference.getAndSet(disposableHelper)) == disposableHelper) {
|
||||
return false;
|
||||
}
|
||||
if (andSet == null) {
|
||||
return true;
|
||||
}
|
||||
andSet.dispose();
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isDisposed(Disposable disposable) {
|
||||
return disposable == DISPOSED;
|
||||
}
|
||||
|
||||
public static boolean replace(AtomicReference<Disposable> atomicReference, Disposable disposable) {
|
||||
Disposable disposable2;
|
||||
do {
|
||||
disposable2 = atomicReference.get();
|
||||
if (disposable2 == DISPOSED) {
|
||||
if (disposable == null) {
|
||||
return false;
|
||||
}
|
||||
disposable.dispose();
|
||||
return false;
|
||||
}
|
||||
} while (!atomicReference.compareAndSet(disposable2, disposable));
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void reportDisposableSet() {
|
||||
RxJavaPlugins.b(new ProtocolViolationException("Disposable already set!"));
|
||||
}
|
||||
|
||||
public static boolean set(AtomicReference<Disposable> atomicReference, Disposable disposable) {
|
||||
Disposable disposable2;
|
||||
do {
|
||||
disposable2 = atomicReference.get();
|
||||
if (disposable2 == DISPOSED) {
|
||||
if (disposable == null) {
|
||||
return false;
|
||||
}
|
||||
disposable.dispose();
|
||||
return false;
|
||||
}
|
||||
} while (!atomicReference.compareAndSet(disposable2, disposable));
|
||||
if (disposable2 == null) {
|
||||
return true;
|
||||
}
|
||||
disposable2.dispose();
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean setOnce(AtomicReference<Disposable> atomicReference, Disposable disposable) {
|
||||
ObjectHelper.a(disposable, "d is null");
|
||||
if (atomicReference.compareAndSet(null, disposable)) {
|
||||
return true;
|
||||
}
|
||||
disposable.dispose();
|
||||
if (atomicReference.get() == DISPOSED) {
|
||||
return false;
|
||||
}
|
||||
reportDisposableSet();
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean trySet(AtomicReference<Disposable> atomicReference, Disposable disposable) {
|
||||
if (atomicReference.compareAndSet(null, disposable)) {
|
||||
return true;
|
||||
}
|
||||
if (atomicReference.get() != DISPOSED) {
|
||||
return false;
|
||||
}
|
||||
disposable.dispose();
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean validate(Disposable disposable, Disposable disposable2) {
|
||||
if (disposable2 == null) {
|
||||
RxJavaPlugins.b(new NullPointerException("next is null"));
|
||||
return false;
|
||||
}
|
||||
if (disposable == null) {
|
||||
return true;
|
||||
}
|
||||
disposable2.dispose();
|
||||
reportDisposableSet();
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
public boolean isDisposed() {
|
||||
return true;
|
||||
}
|
||||
}
|
@@ -0,0 +1,84 @@
|
||||
package io.reactivex.internal.disposables;
|
||||
|
||||
import io.reactivex.CompletableObserver;
|
||||
import io.reactivex.MaybeObserver;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.SingleObserver;
|
||||
import io.reactivex.internal.fuseable.QueueDisposable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public enum EmptyDisposable implements QueueDisposable<Object> {
|
||||
INSTANCE,
|
||||
NEVER;
|
||||
|
||||
public static void complete(Observer<?> observer) {
|
||||
observer.onSubscribe(INSTANCE);
|
||||
observer.onComplete();
|
||||
}
|
||||
|
||||
public static void error(Throwable th, Observer<?> observer) {
|
||||
observer.onSubscribe(INSTANCE);
|
||||
observer.onError(th);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.fuseable.SimpleQueue
|
||||
public void clear() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
public boolean isDisposed() {
|
||||
return this == INSTANCE;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.fuseable.SimpleQueue
|
||||
public boolean isEmpty() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.fuseable.SimpleQueue
|
||||
public boolean offer(Object obj) {
|
||||
throw new UnsupportedOperationException("Should not be called!");
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.fuseable.SimpleQueue
|
||||
public Object poll() throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.fuseable.QueueFuseable
|
||||
public int requestFusion(int i) {
|
||||
return i & 2;
|
||||
}
|
||||
|
||||
public boolean offer(Object obj, Object obj2) {
|
||||
throw new UnsupportedOperationException("Should not be called!");
|
||||
}
|
||||
|
||||
public static void complete(MaybeObserver<?> maybeObserver) {
|
||||
maybeObserver.onSubscribe(INSTANCE);
|
||||
maybeObserver.onComplete();
|
||||
}
|
||||
|
||||
public static void error(Throwable th, CompletableObserver completableObserver) {
|
||||
completableObserver.onSubscribe(INSTANCE);
|
||||
completableObserver.onError(th);
|
||||
}
|
||||
|
||||
public static void complete(CompletableObserver completableObserver) {
|
||||
completableObserver.onSubscribe(INSTANCE);
|
||||
completableObserver.onComplete();
|
||||
}
|
||||
|
||||
public static void error(Throwable th, SingleObserver<?> singleObserver) {
|
||||
singleObserver.onSubscribe(INSTANCE);
|
||||
singleObserver.onError(th);
|
||||
}
|
||||
|
||||
public static void error(Throwable th, MaybeObserver<?> maybeObserver) {
|
||||
maybeObserver.onSubscribe(INSTANCE);
|
||||
maybeObserver.onError(th);
|
||||
}
|
||||
}
|
@@ -0,0 +1,105 @@
|
||||
package io.reactivex.internal.disposables;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.exceptions.CompositeException;
|
||||
import io.reactivex.exceptions.Exceptions;
|
||||
import io.reactivex.internal.functions.ObjectHelper;
|
||||
import io.reactivex.internal.util.ExceptionHelper;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class ListCompositeDisposable implements Disposable, DisposableContainer {
|
||||
List<Disposable> a;
|
||||
volatile boolean b;
|
||||
|
||||
@Override // io.reactivex.internal.disposables.DisposableContainer
|
||||
public boolean a(Disposable disposable) {
|
||||
if (!c(disposable)) {
|
||||
return false;
|
||||
}
|
||||
disposable.dispose();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.disposables.DisposableContainer
|
||||
public boolean b(Disposable disposable) {
|
||||
ObjectHelper.a(disposable, "d is null");
|
||||
if (!this.b) {
|
||||
synchronized (this) {
|
||||
if (!this.b) {
|
||||
List list = this.a;
|
||||
if (list == null) {
|
||||
list = new LinkedList();
|
||||
this.a = list;
|
||||
}
|
||||
list.add(disposable);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
disposable.dispose();
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.disposables.DisposableContainer
|
||||
public boolean c(Disposable disposable) {
|
||||
ObjectHelper.a(disposable, "Disposable item is null");
|
||||
if (this.b) {
|
||||
return false;
|
||||
}
|
||||
synchronized (this) {
|
||||
if (this.b) {
|
||||
return false;
|
||||
}
|
||||
List<Disposable> list = this.a;
|
||||
if (list != null && list.remove(disposable)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
if (this.b) {
|
||||
return;
|
||||
}
|
||||
synchronized (this) {
|
||||
if (this.b) {
|
||||
return;
|
||||
}
|
||||
this.b = true;
|
||||
List<Disposable> list = this.a;
|
||||
this.a = null;
|
||||
a(list);
|
||||
}
|
||||
}
|
||||
|
||||
void a(List<Disposable> list) {
|
||||
if (list == null) {
|
||||
return;
|
||||
}
|
||||
ArrayList arrayList = null;
|
||||
Iterator<Disposable> it = list.iterator();
|
||||
while (it.hasNext()) {
|
||||
try {
|
||||
it.next().dispose();
|
||||
} catch (Throwable th) {
|
||||
Exceptions.b(th);
|
||||
if (arrayList == null) {
|
||||
arrayList = new ArrayList();
|
||||
}
|
||||
arrayList.add(th);
|
||||
}
|
||||
}
|
||||
if (arrayList != null) {
|
||||
if (arrayList.size() == 1) {
|
||||
throw ExceptionHelper.a((Throwable) arrayList.get(0));
|
||||
}
|
||||
throw new CompositeException(arrayList);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
package io.reactivex.internal.disposables;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface ResettableConnectable {
|
||||
void a(Disposable disposable);
|
||||
}
|
@@ -0,0 +1,33 @@
|
||||
package io.reactivex.internal.disposables;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class SequentialDisposable extends AtomicReference<Disposable> implements Disposable {
|
||||
private static final long serialVersionUID = -754898800686245608L;
|
||||
|
||||
public SequentialDisposable() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
DisposableHelper.dispose(this);
|
||||
}
|
||||
|
||||
public boolean isDisposed() {
|
||||
return DisposableHelper.isDisposed(get());
|
||||
}
|
||||
|
||||
public boolean replace(Disposable disposable) {
|
||||
return DisposableHelper.replace(this, disposable);
|
||||
}
|
||||
|
||||
public boolean update(Disposable disposable) {
|
||||
return DisposableHelper.set(this, disposable);
|
||||
}
|
||||
|
||||
public SequentialDisposable(Disposable disposable) {
|
||||
lazySet(disposable);
|
||||
}
|
||||
}
|
728
sources/io/reactivex/internal/functions/Functions.java
Normal file
728
sources/io/reactivex/internal/functions/Functions.java
Normal file
@@ -0,0 +1,728 @@
|
||||
package io.reactivex.internal.functions;
|
||||
|
||||
import io.reactivex.Notification;
|
||||
import io.reactivex.Scheduler;
|
||||
import io.reactivex.exceptions.OnErrorNotImplementedException;
|
||||
import io.reactivex.functions.Action;
|
||||
import io.reactivex.functions.BiConsumer;
|
||||
import io.reactivex.functions.BiFunction;
|
||||
import io.reactivex.functions.BooleanSupplier;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.functions.Function;
|
||||
import io.reactivex.functions.Function3;
|
||||
import io.reactivex.functions.Function4;
|
||||
import io.reactivex.functions.Function5;
|
||||
import io.reactivex.functions.Function6;
|
||||
import io.reactivex.functions.Function7;
|
||||
import io.reactivex.functions.Function8;
|
||||
import io.reactivex.functions.Function9;
|
||||
import io.reactivex.functions.LongConsumer;
|
||||
import io.reactivex.functions.Predicate;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
import io.reactivex.schedulers.Timed;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import org.reactivestreams.Subscription;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class Functions {
|
||||
static final Function<Object, Object> a = new Identity();
|
||||
public static final Runnable b = new EmptyRunnable();
|
||||
public static final Action c = new EmptyAction();
|
||||
static final Consumer<Object> d = new EmptyConsumer();
|
||||
public static final Consumer<Throwable> e;
|
||||
static final Predicate<Object> f;
|
||||
static final Predicate<Object> g;
|
||||
static final Callable<Object> h;
|
||||
static final Comparator<Object> i;
|
||||
|
||||
static final class ActionConsumer<T> implements Consumer<T> {
|
||||
final Action a;
|
||||
|
||||
ActionConsumer(Action action) {
|
||||
this.a = action;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Consumer
|
||||
public void accept(T t) throws Exception {
|
||||
this.a.run();
|
||||
}
|
||||
}
|
||||
|
||||
static final class Array2Func<T1, T2, R> implements Function<Object[], R> {
|
||||
final BiFunction<? super T1, ? super T2, ? extends R> a;
|
||||
|
||||
Array2Func(BiFunction<? super T1, ? super T2, ? extends R> biFunction) {
|
||||
this.a = biFunction;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Function
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public R apply(Object[] objArr) throws Exception {
|
||||
if (objArr.length == 2) {
|
||||
return this.a.apply(objArr[0], objArr[1]);
|
||||
}
|
||||
throw new IllegalArgumentException("Array of size 2 expected but got " + objArr.length);
|
||||
}
|
||||
}
|
||||
|
||||
static final class Array3Func<T1, T2, T3, R> implements Function<Object[], R> {
|
||||
final Function3<T1, T2, T3, R> a;
|
||||
|
||||
Array3Func(Function3<T1, T2, T3, R> function3) {
|
||||
this.a = function3;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // io.reactivex.functions.Function
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public R apply(Object[] objArr) throws Exception {
|
||||
if (objArr.length == 3) {
|
||||
return (R) this.a.apply(objArr[0], objArr[1], objArr[2]);
|
||||
}
|
||||
throw new IllegalArgumentException("Array of size 3 expected but got " + objArr.length);
|
||||
}
|
||||
}
|
||||
|
||||
static final class Array4Func<T1, T2, T3, T4, R> implements Function<Object[], R> {
|
||||
final Function4<T1, T2, T3, T4, R> a;
|
||||
|
||||
Array4Func(Function4<T1, T2, T3, T4, R> function4) {
|
||||
this.a = function4;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // io.reactivex.functions.Function
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public R apply(Object[] objArr) throws Exception {
|
||||
if (objArr.length == 4) {
|
||||
return (R) this.a.a(objArr[0], objArr[1], objArr[2], objArr[3]);
|
||||
}
|
||||
throw new IllegalArgumentException("Array of size 4 expected but got " + objArr.length);
|
||||
}
|
||||
}
|
||||
|
||||
static final class Array5Func<T1, T2, T3, T4, T5, R> implements Function<Object[], R> {
|
||||
private final Function5<T1, T2, T3, T4, T5, R> a;
|
||||
|
||||
Array5Func(Function5<T1, T2, T3, T4, T5, R> function5) {
|
||||
this.a = function5;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // io.reactivex.functions.Function
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public R apply(Object[] objArr) throws Exception {
|
||||
if (objArr.length == 5) {
|
||||
return (R) this.a.a(objArr[0], objArr[1], objArr[2], objArr[3], objArr[4]);
|
||||
}
|
||||
throw new IllegalArgumentException("Array of size 5 expected but got " + objArr.length);
|
||||
}
|
||||
}
|
||||
|
||||
static final class Array6Func<T1, T2, T3, T4, T5, T6, R> implements Function<Object[], R> {
|
||||
final Function6<T1, T2, T3, T4, T5, T6, R> a;
|
||||
|
||||
Array6Func(Function6<T1, T2, T3, T4, T5, T6, R> function6) {
|
||||
this.a = function6;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // io.reactivex.functions.Function
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public R apply(Object[] objArr) throws Exception {
|
||||
if (objArr.length == 6) {
|
||||
return (R) this.a.a(objArr[0], objArr[1], objArr[2], objArr[3], objArr[4], objArr[5]);
|
||||
}
|
||||
throw new IllegalArgumentException("Array of size 6 expected but got " + objArr.length);
|
||||
}
|
||||
}
|
||||
|
||||
static final class Array7Func<T1, T2, T3, T4, T5, T6, T7, R> implements Function<Object[], R> {
|
||||
final Function7<T1, T2, T3, T4, T5, T6, T7, R> a;
|
||||
|
||||
Array7Func(Function7<T1, T2, T3, T4, T5, T6, T7, R> function7) {
|
||||
this.a = function7;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // io.reactivex.functions.Function
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public R apply(Object[] objArr) throws Exception {
|
||||
if (objArr.length == 7) {
|
||||
return (R) this.a.a(objArr[0], objArr[1], objArr[2], objArr[3], objArr[4], objArr[5], objArr[6]);
|
||||
}
|
||||
throw new IllegalArgumentException("Array of size 7 expected but got " + objArr.length);
|
||||
}
|
||||
}
|
||||
|
||||
static final class Array8Func<T1, T2, T3, T4, T5, T6, T7, T8, R> implements Function<Object[], R> {
|
||||
final Function8<T1, T2, T3, T4, T5, T6, T7, T8, R> a;
|
||||
|
||||
Array8Func(Function8<T1, T2, T3, T4, T5, T6, T7, T8, R> function8) {
|
||||
this.a = function8;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // io.reactivex.functions.Function
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public R apply(Object[] objArr) throws Exception {
|
||||
if (objArr.length == 8) {
|
||||
return (R) this.a.a(objArr[0], objArr[1], objArr[2], objArr[3], objArr[4], objArr[5], objArr[6], objArr[7]);
|
||||
}
|
||||
throw new IllegalArgumentException("Array of size 8 expected but got " + objArr.length);
|
||||
}
|
||||
}
|
||||
|
||||
static final class Array9Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> implements Function<Object[], R> {
|
||||
final Function9<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> a;
|
||||
|
||||
Array9Func(Function9<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> function9) {
|
||||
this.a = function9;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // io.reactivex.functions.Function
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public R apply(Object[] objArr) throws Exception {
|
||||
if (objArr.length == 9) {
|
||||
return (R) this.a.a(objArr[0], objArr[1], objArr[2], objArr[3], objArr[4], objArr[5], objArr[6], objArr[7], objArr[8]);
|
||||
}
|
||||
throw new IllegalArgumentException("Array of size 9 expected but got " + objArr.length);
|
||||
}
|
||||
}
|
||||
|
||||
static final class ArrayListCapacityCallable<T> implements Callable<List<T>> {
|
||||
final int a;
|
||||
|
||||
ArrayListCapacityCallable(int i) {
|
||||
this.a = i;
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Callable
|
||||
public List<T> call() throws Exception {
|
||||
return new ArrayList(this.a);
|
||||
}
|
||||
}
|
||||
|
||||
static final class BooleanSupplierPredicateReverse<T> implements Predicate<T> {
|
||||
final BooleanSupplier a;
|
||||
|
||||
BooleanSupplierPredicateReverse(BooleanSupplier booleanSupplier) {
|
||||
this.a = booleanSupplier;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Predicate
|
||||
public boolean a(T t) throws Exception {
|
||||
return !this.a.a();
|
||||
}
|
||||
}
|
||||
|
||||
static final class CastToClass<T, U> implements Function<T, U> {
|
||||
final Class<U> a;
|
||||
|
||||
CastToClass(Class<U> cls) {
|
||||
this.a = cls;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Function
|
||||
public U apply(T t) throws Exception {
|
||||
return this.a.cast(t);
|
||||
}
|
||||
}
|
||||
|
||||
static final class ClassFilter<T, U> implements Predicate<T> {
|
||||
final Class<U> a;
|
||||
|
||||
ClassFilter(Class<U> cls) {
|
||||
this.a = cls;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Predicate
|
||||
public boolean a(T t) throws Exception {
|
||||
return this.a.isInstance(t);
|
||||
}
|
||||
}
|
||||
|
||||
static final class EmptyAction implements Action {
|
||||
EmptyAction() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Action
|
||||
public void run() {
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "EmptyAction";
|
||||
}
|
||||
}
|
||||
|
||||
static final class EmptyConsumer implements Consumer<Object> {
|
||||
EmptyConsumer() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Consumer
|
||||
public void accept(Object obj) {
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "EmptyConsumer";
|
||||
}
|
||||
}
|
||||
|
||||
static final class EmptyLongConsumer implements LongConsumer {
|
||||
EmptyLongConsumer() {
|
||||
}
|
||||
}
|
||||
|
||||
static final class EmptyRunnable implements Runnable {
|
||||
EmptyRunnable() {
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "EmptyRunnable";
|
||||
}
|
||||
}
|
||||
|
||||
static final class EqualsPredicate<T> implements Predicate<T> {
|
||||
final T a;
|
||||
|
||||
EqualsPredicate(T t) {
|
||||
this.a = t;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Predicate
|
||||
public boolean a(T t) throws Exception {
|
||||
return ObjectHelper.a(t, this.a);
|
||||
}
|
||||
}
|
||||
|
||||
static final class ErrorConsumer implements Consumer<Throwable> {
|
||||
ErrorConsumer() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Consumer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void accept(Throwable th) {
|
||||
RxJavaPlugins.b(th);
|
||||
}
|
||||
}
|
||||
|
||||
static final class FalsePredicate implements Predicate<Object> {
|
||||
FalsePredicate() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Predicate
|
||||
public boolean a(Object obj) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
enum HashSetCallable implements Callable<Set<Object>> {
|
||||
INSTANCE;
|
||||
|
||||
@Override // java.util.concurrent.Callable
|
||||
public Set<Object> call() throws Exception {
|
||||
return new HashSet();
|
||||
}
|
||||
}
|
||||
|
||||
static final class Identity implements Function<Object, Object> {
|
||||
Identity() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Function
|
||||
public Object apply(Object obj) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "IdentityFunction";
|
||||
}
|
||||
}
|
||||
|
||||
static final class JustValue<T, U> implements Callable<U>, Function<T, U> {
|
||||
final U a;
|
||||
|
||||
JustValue(U u) {
|
||||
this.a = u;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Function
|
||||
public U apply(T t) throws Exception {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Callable
|
||||
public U call() throws Exception {
|
||||
return this.a;
|
||||
}
|
||||
}
|
||||
|
||||
static final class ListSorter<T> implements Function<List<T>, List<T>> {
|
||||
final Comparator<? super T> a;
|
||||
|
||||
ListSorter(Comparator<? super T> comparator) {
|
||||
this.a = comparator;
|
||||
}
|
||||
|
||||
public List<T> a(List<T> list) {
|
||||
Collections.sort(list, this.a);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Function
|
||||
public /* bridge */ /* synthetic */ Object apply(Object obj) throws Exception {
|
||||
List<T> list = (List) obj;
|
||||
a(list);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
static final class MaxRequestSubscription implements Consumer<Subscription> {
|
||||
MaxRequestSubscription() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Consumer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void accept(Subscription subscription) throws Exception {
|
||||
subscription.request(Long.MAX_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
enum NaturalComparator implements Comparator<Object> {
|
||||
INSTANCE;
|
||||
|
||||
@Override // java.util.Comparator
|
||||
public int compare(Object obj, Object obj2) {
|
||||
return ((Comparable) obj).compareTo(obj2);
|
||||
}
|
||||
}
|
||||
|
||||
static final class NaturalObjectComparator implements Comparator<Object> {
|
||||
NaturalObjectComparator() {
|
||||
}
|
||||
|
||||
@Override // java.util.Comparator
|
||||
public int compare(Object obj, Object obj2) {
|
||||
return ((Comparable) obj).compareTo(obj2);
|
||||
}
|
||||
}
|
||||
|
||||
static final class NotificationOnComplete<T> implements Action {
|
||||
final Consumer<? super Notification<T>> a;
|
||||
|
||||
NotificationOnComplete(Consumer<? super Notification<T>> consumer) {
|
||||
this.a = consumer;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Action
|
||||
public void run() throws Exception {
|
||||
this.a.accept(Notification.f());
|
||||
}
|
||||
}
|
||||
|
||||
static final class NotificationOnError<T> implements Consumer<Throwable> {
|
||||
final Consumer<? super Notification<T>> a;
|
||||
|
||||
NotificationOnError(Consumer<? super Notification<T>> consumer) {
|
||||
this.a = consumer;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Consumer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void accept(Throwable th) throws Exception {
|
||||
this.a.accept(Notification.a(th));
|
||||
}
|
||||
}
|
||||
|
||||
static final class NotificationOnNext<T> implements Consumer<T> {
|
||||
final Consumer<? super Notification<T>> a;
|
||||
|
||||
NotificationOnNext(Consumer<? super Notification<T>> consumer) {
|
||||
this.a = consumer;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Consumer
|
||||
public void accept(T t) throws Exception {
|
||||
this.a.accept(Notification.a(t));
|
||||
}
|
||||
}
|
||||
|
||||
static final class NullCallable implements Callable<Object> {
|
||||
NullCallable() {
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Callable
|
||||
public Object call() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static final class OnErrorMissingConsumer implements Consumer<Throwable> {
|
||||
OnErrorMissingConsumer() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Consumer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void accept(Throwable th) {
|
||||
RxJavaPlugins.b(new OnErrorNotImplementedException(th));
|
||||
}
|
||||
}
|
||||
|
||||
static final class TimestampFunction<T> implements Function<T, Timed<T>> {
|
||||
final TimeUnit a;
|
||||
final Scheduler b;
|
||||
|
||||
TimestampFunction(TimeUnit timeUnit, Scheduler scheduler) {
|
||||
this.a = timeUnit;
|
||||
this.b = scheduler;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // io.reactivex.functions.Function
|
||||
public /* bridge */ /* synthetic */ Object apply(Object obj) throws Exception {
|
||||
return apply((TimestampFunction<T>) obj);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Function
|
||||
public Timed<T> apply(T t) throws Exception {
|
||||
return new Timed<>(t, this.b.a(this.a), this.a);
|
||||
}
|
||||
}
|
||||
|
||||
static final class ToMapKeySelector<K, T> implements BiConsumer<Map<K, T>, T> {
|
||||
private final Function<? super T, ? extends K> a;
|
||||
|
||||
ToMapKeySelector(Function<? super T, ? extends K> function) {
|
||||
this.a = function;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // io.reactivex.functions.BiConsumer
|
||||
public /* bridge */ /* synthetic */ void a(Object obj, Object obj2) throws Exception {
|
||||
a((Map<K, Map<K, T>>) obj, (Map<K, T>) obj2);
|
||||
}
|
||||
|
||||
public void a(Map<K, T> map, T t) throws Exception {
|
||||
map.put(this.a.apply(t), t);
|
||||
}
|
||||
}
|
||||
|
||||
static final class ToMapKeyValueSelector<K, V, T> implements BiConsumer<Map<K, V>, T> {
|
||||
private final Function<? super T, ? extends V> a;
|
||||
private final Function<? super T, ? extends K> b;
|
||||
|
||||
ToMapKeyValueSelector(Function<? super T, ? extends V> function, Function<? super T, ? extends K> function2) {
|
||||
this.a = function;
|
||||
this.b = function2;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // io.reactivex.functions.BiConsumer
|
||||
public /* bridge */ /* synthetic */ void a(Object obj, Object obj2) throws Exception {
|
||||
a((Map) obj, (Map<K, V>) obj2);
|
||||
}
|
||||
|
||||
public void a(Map<K, V> map, T t) throws Exception {
|
||||
map.put(this.b.apply(t), this.a.apply(t));
|
||||
}
|
||||
}
|
||||
|
||||
static final class ToMultimapKeyValueSelector<K, V, T> implements BiConsumer<Map<K, Collection<V>>, T> {
|
||||
private final Function<? super K, ? extends Collection<? super V>> a;
|
||||
private final Function<? super T, ? extends V> b;
|
||||
private final Function<? super T, ? extends K> c;
|
||||
|
||||
ToMultimapKeyValueSelector(Function<? super K, ? extends Collection<? super V>> function, Function<? super T, ? extends V> function2, Function<? super T, ? extends K> function3) {
|
||||
this.a = function;
|
||||
this.b = function2;
|
||||
this.c = function3;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // io.reactivex.functions.BiConsumer
|
||||
public /* bridge */ /* synthetic */ void a(Object obj, Object obj2) throws Exception {
|
||||
a((Map) obj, (Map<K, Collection<V>>) obj2);
|
||||
}
|
||||
|
||||
public void a(Map<K, Collection<V>> map, T t) throws Exception {
|
||||
K apply = this.c.apply(t);
|
||||
Collection<? super V> collection = (Collection) map.get(apply);
|
||||
if (collection == null) {
|
||||
collection = this.a.apply(apply);
|
||||
map.put(apply, collection);
|
||||
}
|
||||
collection.add(this.b.apply(t));
|
||||
}
|
||||
}
|
||||
|
||||
static final class TruePredicate implements Predicate<Object> {
|
||||
TruePredicate() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Predicate
|
||||
public boolean a(Object obj) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
new ErrorConsumer();
|
||||
e = new OnErrorMissingConsumer();
|
||||
new EmptyLongConsumer();
|
||||
f = new TruePredicate();
|
||||
g = new FalsePredicate();
|
||||
h = new NullCallable();
|
||||
i = new NaturalObjectComparator();
|
||||
new MaxRequestSubscription();
|
||||
}
|
||||
|
||||
public static <T1, T2, R> Function<Object[], R> a(BiFunction<? super T1, ? super T2, ? extends R> biFunction) {
|
||||
ObjectHelper.a(biFunction, "f is null");
|
||||
return new Array2Func(biFunction);
|
||||
}
|
||||
|
||||
public static <T> Predicate<T> b() {
|
||||
return (Predicate<T>) f;
|
||||
}
|
||||
|
||||
public static <T, U> Function<T, U> c(U u) {
|
||||
return new JustValue(u);
|
||||
}
|
||||
|
||||
public static <T> Consumer<T> d() {
|
||||
return (Consumer<T>) d;
|
||||
}
|
||||
|
||||
public static <T> Function<T, T> e() {
|
||||
return (Function<T, T>) a;
|
||||
}
|
||||
|
||||
public static <T> Comparator<T> f() {
|
||||
return NaturalComparator.INSTANCE;
|
||||
}
|
||||
|
||||
public static <T> Comparator<T> g() {
|
||||
return (Comparator<T>) i;
|
||||
}
|
||||
|
||||
public static <T> Callable<T> h() {
|
||||
return (Callable<T>) h;
|
||||
}
|
||||
|
||||
public static <T> Callable<T> b(T t) {
|
||||
return new JustValue(t);
|
||||
}
|
||||
|
||||
public static <T> Callable<Set<T>> c() {
|
||||
return HashSetCallable.INSTANCE;
|
||||
}
|
||||
|
||||
public static <T1, T2, T3, R> Function<Object[], R> a(Function3<T1, T2, T3, R> function3) {
|
||||
ObjectHelper.a(function3, "f is null");
|
||||
return new Array3Func(function3);
|
||||
}
|
||||
|
||||
public static <T> Consumer<Throwable> b(Consumer<? super Notification<T>> consumer) {
|
||||
return new NotificationOnError(consumer);
|
||||
}
|
||||
|
||||
public static <T> Consumer<T> c(Consumer<? super Notification<T>> consumer) {
|
||||
return new NotificationOnNext(consumer);
|
||||
}
|
||||
|
||||
public static <T, U> Predicate<T> b(Class<U> cls) {
|
||||
return new ClassFilter(cls);
|
||||
}
|
||||
|
||||
public static <T1, T2, T3, T4, R> Function<Object[], R> a(Function4<T1, T2, T3, T4, R> function4) {
|
||||
ObjectHelper.a(function4, "f is null");
|
||||
return new Array4Func(function4);
|
||||
}
|
||||
|
||||
public static <T1, T2, T3, T4, T5, R> Function<Object[], R> a(Function5<T1, T2, T3, T4, T5, R> function5) {
|
||||
ObjectHelper.a(function5, "f is null");
|
||||
return new Array5Func(function5);
|
||||
}
|
||||
|
||||
public static <T1, T2, T3, T4, T5, T6, R> Function<Object[], R> a(Function6<T1, T2, T3, T4, T5, T6, R> function6) {
|
||||
ObjectHelper.a(function6, "f is null");
|
||||
return new Array6Func(function6);
|
||||
}
|
||||
|
||||
public static <T1, T2, T3, T4, T5, T6, T7, R> Function<Object[], R> a(Function7<T1, T2, T3, T4, T5, T6, T7, R> function7) {
|
||||
ObjectHelper.a(function7, "f is null");
|
||||
return new Array7Func(function7);
|
||||
}
|
||||
|
||||
public static <T1, T2, T3, T4, T5, T6, T7, T8, R> Function<Object[], R> a(Function8<T1, T2, T3, T4, T5, T6, T7, T8, R> function8) {
|
||||
ObjectHelper.a(function8, "f is null");
|
||||
return new Array8Func(function8);
|
||||
}
|
||||
|
||||
public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, R> Function<Object[], R> a(Function9<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> function9) {
|
||||
ObjectHelper.a(function9, "f is null");
|
||||
return new Array9Func(function9);
|
||||
}
|
||||
|
||||
public static <T> Predicate<T> a() {
|
||||
return (Predicate<T>) g;
|
||||
}
|
||||
|
||||
public static <T, U> Function<T, U> a(Class<U> cls) {
|
||||
return new CastToClass(cls);
|
||||
}
|
||||
|
||||
public static <T> Callable<List<T>> a(int i2) {
|
||||
return new ArrayListCapacityCallable(i2);
|
||||
}
|
||||
|
||||
public static <T> Predicate<T> a(T t) {
|
||||
return new EqualsPredicate(t);
|
||||
}
|
||||
|
||||
public static <T> Action a(Consumer<? super Notification<T>> consumer) {
|
||||
return new NotificationOnComplete(consumer);
|
||||
}
|
||||
|
||||
public static <T> Consumer<T> a(Action action) {
|
||||
return new ActionConsumer(action);
|
||||
}
|
||||
|
||||
public static <T> Predicate<T> a(BooleanSupplier booleanSupplier) {
|
||||
return new BooleanSupplierPredicateReverse(booleanSupplier);
|
||||
}
|
||||
|
||||
public static <T> Function<T, Timed<T>> a(TimeUnit timeUnit, Scheduler scheduler) {
|
||||
return new TimestampFunction(timeUnit, scheduler);
|
||||
}
|
||||
|
||||
public static <T, K> BiConsumer<Map<K, T>, T> a(Function<? super T, ? extends K> function) {
|
||||
return new ToMapKeySelector(function);
|
||||
}
|
||||
|
||||
public static <T, K, V> BiConsumer<Map<K, V>, T> a(Function<? super T, ? extends K> function, Function<? super T, ? extends V> function2) {
|
||||
return new ToMapKeyValueSelector(function2, function);
|
||||
}
|
||||
|
||||
public static <T, K, V> BiConsumer<Map<K, Collection<V>>, T> a(Function<? super T, ? extends K> function, Function<? super T, ? extends V> function2, Function<? super K, ? extends Collection<? super V>> function3) {
|
||||
return new ToMultimapKeyValueSelector(function3, function2, function);
|
||||
}
|
||||
|
||||
public static <T> Function<List<T>, List<T>> a(Comparator<? super T> comparator) {
|
||||
return new ListSorter(comparator);
|
||||
}
|
||||
}
|
61
sources/io/reactivex/internal/functions/ObjectHelper.java
Normal file
61
sources/io/reactivex/internal/functions/ObjectHelper.java
Normal file
@@ -0,0 +1,61 @@
|
||||
package io.reactivex.internal.functions;
|
||||
|
||||
import io.reactivex.functions.BiPredicate;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class ObjectHelper {
|
||||
static final BiPredicate<Object, Object> a = new BiObjectPredicate();
|
||||
|
||||
static final class BiObjectPredicate implements BiPredicate<Object, Object> {
|
||||
BiObjectPredicate() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.BiPredicate
|
||||
public boolean a(Object obj, Object obj2) {
|
||||
return ObjectHelper.a(obj, obj2);
|
||||
}
|
||||
}
|
||||
|
||||
public static int a(int i, int i2) {
|
||||
if (i < i2) {
|
||||
return -1;
|
||||
}
|
||||
return i > i2 ? 1 : 0;
|
||||
}
|
||||
|
||||
public static int a(long j, long j2) {
|
||||
if (j < j2) {
|
||||
return -1;
|
||||
}
|
||||
return j > j2 ? 1 : 0;
|
||||
}
|
||||
|
||||
public static <T> T a(T t, String str) {
|
||||
if (t != null) {
|
||||
return t;
|
||||
}
|
||||
throw new NullPointerException(str);
|
||||
}
|
||||
|
||||
public static boolean a(Object obj, Object obj2) {
|
||||
return obj == obj2 || (obj != null && obj.equals(obj2));
|
||||
}
|
||||
|
||||
public static <T> BiPredicate<T, T> a() {
|
||||
return (BiPredicate<T, T>) a;
|
||||
}
|
||||
|
||||
public static int a(int i, String str) {
|
||||
if (i > 0) {
|
||||
return i;
|
||||
}
|
||||
throw new IllegalArgumentException(str + " > 0 required but it was " + i);
|
||||
}
|
||||
|
||||
public static long a(long j, String str) {
|
||||
if (j > 0) {
|
||||
return j;
|
||||
}
|
||||
throw new IllegalArgumentException(str + " > 0 required but it was " + j);
|
||||
}
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
package io.reactivex.internal.fuseable;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface FuseToObservable<T> {
|
||||
Observable<T> a();
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
package io.reactivex.internal.fuseable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface HasUpstreamMaybeSource<T> {
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
package io.reactivex.internal.fuseable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface HasUpstreamObservableSource<T> {
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
package io.reactivex.internal.fuseable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface HasUpstreamPublisher<T> {
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
package io.reactivex.internal.fuseable;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface QueueDisposable<T> extends QueueFuseable<T>, Disposable {
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
package io.reactivex.internal.fuseable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface QueueFuseable<T> extends SimpleQueue<T> {
|
||||
int requestFusion(int i);
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
package io.reactivex.internal.fuseable;
|
||||
|
||||
import org.reactivestreams.Subscription;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface QueueSubscription<T> extends QueueFuseable<T>, Subscription {
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
package io.reactivex.internal.fuseable;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface ScalarCallable<T> extends Callable<T> {
|
||||
@Override // java.util.concurrent.Callable
|
||||
T call();
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
package io.reactivex.internal.fuseable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface SimplePlainQueue<T> extends SimpleQueue<T> {
|
||||
@Override // io.reactivex.internal.fuseable.SimpleQueue
|
||||
T poll();
|
||||
}
|
12
sources/io/reactivex/internal/fuseable/SimpleQueue.java
Normal file
12
sources/io/reactivex/internal/fuseable/SimpleQueue.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package io.reactivex.internal.fuseable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface SimpleQueue<T> {
|
||||
void clear();
|
||||
|
||||
boolean isEmpty();
|
||||
|
||||
boolean offer(T t);
|
||||
|
||||
T poll() throws Exception;
|
||||
}
|
@@ -0,0 +1,99 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.exceptions.Exceptions;
|
||||
import io.reactivex.internal.disposables.DisposableHelper;
|
||||
import io.reactivex.internal.fuseable.QueueDisposable;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public abstract class BasicFuseableObserver<T, R> implements Observer<T>, QueueDisposable<R> {
|
||||
protected final Observer<? super R> a;
|
||||
protected Disposable b;
|
||||
protected QueueDisposable<T> c;
|
||||
protected boolean d;
|
||||
protected int e;
|
||||
|
||||
public BasicFuseableObserver(Observer<? super R> observer) {
|
||||
this.a = observer;
|
||||
}
|
||||
|
||||
protected void a() {
|
||||
}
|
||||
|
||||
protected final void a(Throwable th) {
|
||||
Exceptions.b(th);
|
||||
this.b.dispose();
|
||||
onError(th);
|
||||
}
|
||||
|
||||
protected boolean b() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.fuseable.SimpleQueue
|
||||
public void clear() {
|
||||
this.c.clear();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
this.b.dispose();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.fuseable.SimpleQueue
|
||||
public boolean isEmpty() {
|
||||
return this.c.isEmpty();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.fuseable.SimpleQueue
|
||||
public final boolean offer(R r) {
|
||||
throw new UnsupportedOperationException("Should not be called!");
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
if (this.d) {
|
||||
return;
|
||||
}
|
||||
this.d = true;
|
||||
this.a.onComplete();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
if (this.d) {
|
||||
RxJavaPlugins.b(th);
|
||||
} else {
|
||||
this.d = true;
|
||||
this.a.onError(th);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public final void onSubscribe(Disposable disposable) {
|
||||
if (DisposableHelper.validate(this.b, disposable)) {
|
||||
this.b = disposable;
|
||||
if (disposable instanceof QueueDisposable) {
|
||||
this.c = (QueueDisposable) disposable;
|
||||
}
|
||||
if (b()) {
|
||||
this.a.onSubscribe(this);
|
||||
a();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected final int a(int i) {
|
||||
QueueDisposable<T> queueDisposable = this.c;
|
||||
if (queueDisposable == null || (i & 4) != 0) {
|
||||
return 0;
|
||||
}
|
||||
int requestFusion = queueDisposable.requestFusion(i);
|
||||
if (requestFusion != 0) {
|
||||
this.e = requestFusion;
|
||||
}
|
||||
return requestFusion;
|
||||
}
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
import io.reactivex.internal.fuseable.QueueDisposable;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public abstract class BasicIntQueueDisposable<T> extends AtomicInteger implements QueueDisposable<T> {
|
||||
private static final long serialVersionUID = -1001730202384742097L;
|
||||
|
||||
@Override // io.reactivex.internal.fuseable.SimpleQueue
|
||||
public final boolean offer(T t) {
|
||||
throw new UnsupportedOperationException("Should not be called");
|
||||
}
|
||||
|
||||
public final boolean offer(T t, T t2) {
|
||||
throw new UnsupportedOperationException("Should not be called");
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
import io.reactivex.internal.fuseable.QueueDisposable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public abstract class BasicQueueDisposable<T> implements QueueDisposable<T> {
|
||||
@Override // io.reactivex.internal.fuseable.SimpleQueue
|
||||
public final boolean offer(T t) {
|
||||
throw new UnsupportedOperationException("Should not be called");
|
||||
}
|
||||
}
|
@@ -0,0 +1,56 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
import io.reactivex.SingleObserver;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.exceptions.CompositeException;
|
||||
import io.reactivex.exceptions.Exceptions;
|
||||
import io.reactivex.functions.BiConsumer;
|
||||
import io.reactivex.internal.disposables.DisposableHelper;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class BiConsumerSingleObserver<T> extends AtomicReference<Disposable> implements SingleObserver<T>, Disposable {
|
||||
private static final long serialVersionUID = 4943102778943297569L;
|
||||
final BiConsumer<? super T, ? super Throwable> onCallback;
|
||||
|
||||
public BiConsumerSingleObserver(BiConsumer<? super T, ? super Throwable> biConsumer) {
|
||||
this.onCallback = biConsumer;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
DisposableHelper.dispose(this);
|
||||
}
|
||||
|
||||
public boolean isDisposed() {
|
||||
return get() == DisposableHelper.DISPOSED;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.SingleObserver
|
||||
public void onError(Throwable th) {
|
||||
try {
|
||||
lazySet(DisposableHelper.DISPOSED);
|
||||
this.onCallback.a(null, th);
|
||||
} catch (Throwable th2) {
|
||||
Exceptions.b(th2);
|
||||
RxJavaPlugins.b(new CompositeException(th, th2));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.SingleObserver
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
DisposableHelper.setOnce(this, disposable);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.SingleObserver
|
||||
public void onSuccess(T t) {
|
||||
try {
|
||||
lazySet(DisposableHelper.DISPOSED);
|
||||
this.onCallback.a(t, null);
|
||||
} catch (Throwable th) {
|
||||
Exceptions.b(th);
|
||||
RxJavaPlugins.b(th);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,58 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.internal.util.BlockingHelper;
|
||||
import io.reactivex.internal.util.ExceptionHelper;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public abstract class BlockingBaseObserver<T> extends CountDownLatch implements Observer<T>, Disposable {
|
||||
T a;
|
||||
Throwable b;
|
||||
Disposable c;
|
||||
volatile boolean d;
|
||||
|
||||
public BlockingBaseObserver() {
|
||||
super(1);
|
||||
}
|
||||
|
||||
public final T a() {
|
||||
if (getCount() != 0) {
|
||||
try {
|
||||
BlockingHelper.a();
|
||||
await();
|
||||
} catch (InterruptedException e) {
|
||||
dispose();
|
||||
throw ExceptionHelper.a(e);
|
||||
}
|
||||
}
|
||||
Throwable th = this.b;
|
||||
if (th == null) {
|
||||
return this.a;
|
||||
}
|
||||
throw ExceptionHelper.a(th);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public final void dispose() {
|
||||
this.d = true;
|
||||
Disposable disposable = this.c;
|
||||
if (disposable != null) {
|
||||
disposable.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public final void onComplete() {
|
||||
countDown();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public final void onSubscribe(Disposable disposable) {
|
||||
this.c = disposable;
|
||||
if (this.d) {
|
||||
disposable.dispose();
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class BlockingFirstObserver<T> extends BlockingBaseObserver<T> {
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
if (this.a == null) {
|
||||
this.b = th;
|
||||
}
|
||||
countDown();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onNext(T t) {
|
||||
if (this.a == null) {
|
||||
this.a = t;
|
||||
this.c.dispose();
|
||||
countDown();
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class BlockingLastObserver<T> extends BlockingBaseObserver<T> {
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
this.a = null;
|
||||
this.b = th;
|
||||
countDown();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onNext(T t) {
|
||||
this.a = t;
|
||||
}
|
||||
}
|
@@ -0,0 +1,71 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
import io.reactivex.CompletableObserver;
|
||||
import io.reactivex.MaybeObserver;
|
||||
import io.reactivex.SingleObserver;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.internal.util.BlockingHelper;
|
||||
import io.reactivex.internal.util.ExceptionHelper;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class BlockingMultiObserver<T> extends CountDownLatch implements SingleObserver<T>, CompletableObserver, MaybeObserver<T> {
|
||||
T a;
|
||||
Throwable b;
|
||||
Disposable c;
|
||||
volatile boolean d;
|
||||
|
||||
public BlockingMultiObserver() {
|
||||
super(1);
|
||||
}
|
||||
|
||||
public T a() {
|
||||
if (getCount() != 0) {
|
||||
try {
|
||||
BlockingHelper.a();
|
||||
await();
|
||||
} catch (InterruptedException e) {
|
||||
b();
|
||||
throw ExceptionHelper.a(e);
|
||||
}
|
||||
}
|
||||
Throwable th = this.b;
|
||||
if (th == null) {
|
||||
return this.a;
|
||||
}
|
||||
throw ExceptionHelper.a(th);
|
||||
}
|
||||
|
||||
void b() {
|
||||
this.d = true;
|
||||
Disposable disposable = this.c;
|
||||
if (disposable != null) {
|
||||
disposable.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.CompletableObserver, io.reactivex.MaybeObserver
|
||||
public void onComplete() {
|
||||
countDown();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.SingleObserver
|
||||
public void onError(Throwable th) {
|
||||
this.b = th;
|
||||
countDown();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.SingleObserver
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
this.c = disposable;
|
||||
if (this.d) {
|
||||
disposable.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.SingleObserver
|
||||
public void onSuccess(T t) {
|
||||
this.a = t;
|
||||
countDown();
|
||||
}
|
||||
}
|
@@ -0,0 +1,50 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.internal.disposables.DisposableHelper;
|
||||
import io.reactivex.internal.util.NotificationLite;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class BlockingObserver<T> extends AtomicReference<Disposable> implements Observer<T>, Disposable {
|
||||
public static final Object TERMINATED = new Object();
|
||||
private static final long serialVersionUID = -4875965440900746268L;
|
||||
final Queue<Object> queue;
|
||||
|
||||
public BlockingObserver(Queue<Object> queue) {
|
||||
this.queue = queue;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
if (DisposableHelper.dispose(this)) {
|
||||
this.queue.offer(TERMINATED);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isDisposed() {
|
||||
return get() == DisposableHelper.DISPOSED;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
this.queue.offer(NotificationLite.complete());
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
this.queue.offer(NotificationLite.error(th));
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onNext(T t) {
|
||||
this.queue.offer(NotificationLite.next(t));
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
DisposableHelper.setOnce(this, disposable);
|
||||
}
|
||||
}
|
@@ -0,0 +1,74 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
import io.reactivex.CompletableObserver;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.exceptions.Exceptions;
|
||||
import io.reactivex.exceptions.OnErrorNotImplementedException;
|
||||
import io.reactivex.functions.Action;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.internal.disposables.DisposableHelper;
|
||||
import io.reactivex.observers.LambdaConsumerIntrospection;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class CallbackCompletableObserver extends AtomicReference<Disposable> implements CompletableObserver, Disposable, Consumer<Throwable>, LambdaConsumerIntrospection {
|
||||
private static final long serialVersionUID = -4361286194466301354L;
|
||||
final Action onComplete;
|
||||
final Consumer<? super Throwable> onError;
|
||||
|
||||
public CallbackCompletableObserver(Action action) {
|
||||
this.onError = this;
|
||||
this.onComplete = action;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
DisposableHelper.dispose(this);
|
||||
}
|
||||
|
||||
public boolean hasCustomOnError() {
|
||||
return this.onError != this;
|
||||
}
|
||||
|
||||
public boolean isDisposed() {
|
||||
return get() == DisposableHelper.DISPOSED;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.CompletableObserver, io.reactivex.MaybeObserver
|
||||
public void onComplete() {
|
||||
try {
|
||||
this.onComplete.run();
|
||||
} catch (Throwable th) {
|
||||
Exceptions.b(th);
|
||||
RxJavaPlugins.b(th);
|
||||
}
|
||||
lazySet(DisposableHelper.DISPOSED);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.CompletableObserver
|
||||
public void onError(Throwable th) {
|
||||
try {
|
||||
this.onError.accept(th);
|
||||
} catch (Throwable th2) {
|
||||
Exceptions.b(th2);
|
||||
RxJavaPlugins.b(th2);
|
||||
}
|
||||
lazySet(DisposableHelper.DISPOSED);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.CompletableObserver
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
DisposableHelper.setOnce(this, disposable);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.functions.Consumer
|
||||
public void accept(Throwable th) {
|
||||
RxJavaPlugins.b(new OnErrorNotImplementedException(th));
|
||||
}
|
||||
|
||||
public CallbackCompletableObserver(Consumer<? super Throwable> consumer, Action action) {
|
||||
this.onError = consumer;
|
||||
this.onComplete = action;
|
||||
}
|
||||
}
|
@@ -0,0 +1,64 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
import io.reactivex.SingleObserver;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.exceptions.CompositeException;
|
||||
import io.reactivex.exceptions.Exceptions;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.internal.disposables.DisposableHelper;
|
||||
import io.reactivex.internal.functions.Functions;
|
||||
import io.reactivex.observers.LambdaConsumerIntrospection;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class ConsumerSingleObserver<T> extends AtomicReference<Disposable> implements SingleObserver<T>, Disposable, LambdaConsumerIntrospection {
|
||||
private static final long serialVersionUID = -7012088219455310787L;
|
||||
final Consumer<? super Throwable> onError;
|
||||
final Consumer<? super T> onSuccess;
|
||||
|
||||
public ConsumerSingleObserver(Consumer<? super T> consumer, Consumer<? super Throwable> consumer2) {
|
||||
this.onSuccess = consumer;
|
||||
this.onError = consumer2;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
DisposableHelper.dispose(this);
|
||||
}
|
||||
|
||||
public boolean hasCustomOnError() {
|
||||
return this.onError != Functions.e;
|
||||
}
|
||||
|
||||
public boolean isDisposed() {
|
||||
return get() == DisposableHelper.DISPOSED;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.SingleObserver
|
||||
public void onError(Throwable th) {
|
||||
lazySet(DisposableHelper.DISPOSED);
|
||||
try {
|
||||
this.onError.accept(th);
|
||||
} catch (Throwable th2) {
|
||||
Exceptions.b(th2);
|
||||
RxJavaPlugins.b(new CompositeException(th, th2));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.SingleObserver
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
DisposableHelper.setOnce(this, disposable);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.SingleObserver
|
||||
public void onSuccess(T t) {
|
||||
lazySet(DisposableHelper.DISPOSED);
|
||||
try {
|
||||
this.onSuccess.accept(t);
|
||||
} catch (Throwable th) {
|
||||
Exceptions.b(th);
|
||||
RxJavaPlugins.b(th);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,101 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class DeferredScalarDisposable<T> extends BasicIntQueueDisposable<T> {
|
||||
static final int DISPOSED = 4;
|
||||
static final int FUSED_CONSUMED = 32;
|
||||
static final int FUSED_EMPTY = 8;
|
||||
static final int FUSED_READY = 16;
|
||||
static final int TERMINATED = 2;
|
||||
private static final long serialVersionUID = -5502432239815349361L;
|
||||
protected final Observer<? super T> downstream;
|
||||
protected T value;
|
||||
|
||||
public DeferredScalarDisposable(Observer<? super T> observer) {
|
||||
this.downstream = observer;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.fuseable.SimpleQueue
|
||||
public final void clear() {
|
||||
lazySet(32);
|
||||
this.value = null;
|
||||
}
|
||||
|
||||
public final void complete(T t) {
|
||||
int i = get();
|
||||
if ((i & 54) != 0) {
|
||||
return;
|
||||
}
|
||||
Observer<? super T> observer = this.downstream;
|
||||
if (i == 8) {
|
||||
this.value = t;
|
||||
lazySet(16);
|
||||
observer.onNext(null);
|
||||
} else {
|
||||
lazySet(2);
|
||||
observer.onNext(t);
|
||||
}
|
||||
if (get() != 4) {
|
||||
observer.onComplete();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
set(4);
|
||||
this.value = null;
|
||||
}
|
||||
|
||||
public final void error(Throwable th) {
|
||||
if ((get() & 54) != 0) {
|
||||
RxJavaPlugins.b(th);
|
||||
} else {
|
||||
lazySet(2);
|
||||
this.downstream.onError(th);
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean isDisposed() {
|
||||
return get() == 4;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.fuseable.SimpleQueue
|
||||
public final boolean isEmpty() {
|
||||
return get() != 16;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.fuseable.SimpleQueue
|
||||
public final T poll() throws Exception {
|
||||
if (get() != 16) {
|
||||
return null;
|
||||
}
|
||||
T t = this.value;
|
||||
this.value = null;
|
||||
lazySet(32);
|
||||
return t;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.fuseable.QueueFuseable
|
||||
public final int requestFusion(int i) {
|
||||
if ((i & 2) == 0) {
|
||||
return 0;
|
||||
}
|
||||
lazySet(8);
|
||||
return 2;
|
||||
}
|
||||
|
||||
public final boolean tryDispose() {
|
||||
return getAndSet(4) != 4;
|
||||
}
|
||||
|
||||
public final void complete() {
|
||||
if ((get() & 54) != 0) {
|
||||
return;
|
||||
}
|
||||
lazySet(2);
|
||||
this.downstream.onComplete();
|
||||
}
|
||||
}
|
@@ -0,0 +1,46 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.internal.disposables.DisposableHelper;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public abstract class DeferredScalarObserver<T, R> extends DeferredScalarDisposable<R> implements Observer<T> {
|
||||
private static final long serialVersionUID = -266195175408988651L;
|
||||
protected Disposable upstream;
|
||||
|
||||
public DeferredScalarObserver(Observer<? super R> observer) {
|
||||
super(observer);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.observers.DeferredScalarDisposable, io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
super.dispose();
|
||||
this.upstream.dispose();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
T t = this.value;
|
||||
if (t == null) {
|
||||
complete();
|
||||
} else {
|
||||
this.value = null;
|
||||
complete(t);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
this.value = null;
|
||||
error(th);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
if (DisposableHelper.validate(this.upstream, disposable)) {
|
||||
this.upstream = disposable;
|
||||
this.downstream.onSubscribe(this);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,72 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.exceptions.Exceptions;
|
||||
import io.reactivex.functions.Action;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.internal.disposables.DisposableHelper;
|
||||
import io.reactivex.internal.disposables.EmptyDisposable;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class DisposableLambdaObserver<T> implements Observer<T>, Disposable {
|
||||
final Observer<? super T> a;
|
||||
final Consumer<? super Disposable> b;
|
||||
final Action c;
|
||||
Disposable d;
|
||||
|
||||
public DisposableLambdaObserver(Observer<? super T> observer, Consumer<? super Disposable> consumer, Action action) {
|
||||
this.a = observer;
|
||||
this.b = consumer;
|
||||
this.c = action;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
try {
|
||||
this.c.run();
|
||||
} catch (Throwable th) {
|
||||
Exceptions.b(th);
|
||||
RxJavaPlugins.b(th);
|
||||
}
|
||||
this.d.dispose();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
if (this.d != DisposableHelper.DISPOSED) {
|
||||
this.a.onComplete();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
if (this.d != DisposableHelper.DISPOSED) {
|
||||
this.a.onError(th);
|
||||
} else {
|
||||
RxJavaPlugins.b(th);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onNext(T t) {
|
||||
this.a.onNext(t);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
try {
|
||||
this.b.accept(disposable);
|
||||
if (DisposableHelper.validate(this.d, disposable)) {
|
||||
this.d = disposable;
|
||||
this.a.onSubscribe(this);
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
Exceptions.b(th);
|
||||
disposable.dispose();
|
||||
this.d = DisposableHelper.DISPOSED;
|
||||
EmptyDisposable.error(th, this.a);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,43 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
import io.reactivex.CompletableObserver;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.exceptions.OnErrorNotImplementedException;
|
||||
import io.reactivex.internal.disposables.DisposableHelper;
|
||||
import io.reactivex.observers.LambdaConsumerIntrospection;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class EmptyCompletableObserver extends AtomicReference<Disposable> implements CompletableObserver, Disposable, LambdaConsumerIntrospection {
|
||||
private static final long serialVersionUID = -7545121636549663526L;
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
DisposableHelper.dispose(this);
|
||||
}
|
||||
|
||||
public boolean hasCustomOnError() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isDisposed() {
|
||||
return get() == DisposableHelper.DISPOSED;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.CompletableObserver, io.reactivex.MaybeObserver
|
||||
public void onComplete() {
|
||||
lazySet(DisposableHelper.DISPOSED);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.CompletableObserver
|
||||
public void onError(Throwable th) {
|
||||
lazySet(DisposableHelper.DISPOSED);
|
||||
RxJavaPlugins.b(new OnErrorNotImplementedException(th));
|
||||
}
|
||||
|
||||
@Override // io.reactivex.CompletableObserver
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
DisposableHelper.setOnce(this, disposable);
|
||||
}
|
||||
}
|
@@ -0,0 +1,88 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.exceptions.CompositeException;
|
||||
import io.reactivex.exceptions.Exceptions;
|
||||
import io.reactivex.functions.Action;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.functions.Predicate;
|
||||
import io.reactivex.internal.disposables.DisposableHelper;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class ForEachWhileObserver<T> extends AtomicReference<Disposable> implements Observer<T>, Disposable {
|
||||
private static final long serialVersionUID = -4403180040475402120L;
|
||||
boolean done;
|
||||
final Action onComplete;
|
||||
final Consumer<? super Throwable> onError;
|
||||
final Predicate<? super T> onNext;
|
||||
|
||||
public ForEachWhileObserver(Predicate<? super T> predicate, Consumer<? super Throwable> consumer, Action action) {
|
||||
this.onNext = predicate;
|
||||
this.onError = consumer;
|
||||
this.onComplete = action;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
DisposableHelper.dispose(this);
|
||||
}
|
||||
|
||||
public boolean isDisposed() {
|
||||
return DisposableHelper.isDisposed(get());
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
if (this.done) {
|
||||
return;
|
||||
}
|
||||
this.done = true;
|
||||
try {
|
||||
this.onComplete.run();
|
||||
} catch (Throwable th) {
|
||||
Exceptions.b(th);
|
||||
RxJavaPlugins.b(th);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
if (this.done) {
|
||||
RxJavaPlugins.b(th);
|
||||
return;
|
||||
}
|
||||
this.done = true;
|
||||
try {
|
||||
this.onError.accept(th);
|
||||
} catch (Throwable th2) {
|
||||
Exceptions.b(th2);
|
||||
RxJavaPlugins.b(new CompositeException(th, th2));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onNext(T t) {
|
||||
if (this.done) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (this.onNext.a(t)) {
|
||||
return;
|
||||
}
|
||||
dispose();
|
||||
onComplete();
|
||||
} catch (Throwable th) {
|
||||
Exceptions.b(th);
|
||||
dispose();
|
||||
onError(th);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
DisposableHelper.setOnce(this, disposable);
|
||||
}
|
||||
}
|
141
sources/io/reactivex/internal/observers/FutureObserver.java
Normal file
141
sources/io/reactivex/internal/observers/FutureObserver.java
Normal file
@@ -0,0 +1,141 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.internal.disposables.DisposableHelper;
|
||||
import io.reactivex.internal.util.BlockingHelper;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class FutureObserver<T> extends CountDownLatch implements Observer<T>, Future<T>, Disposable {
|
||||
T a;
|
||||
Throwable b;
|
||||
final AtomicReference<Disposable> c;
|
||||
|
||||
public FutureObserver() {
|
||||
super(1);
|
||||
this.c = new AtomicReference<>();
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Future
|
||||
public boolean cancel(boolean z) {
|
||||
Disposable disposable;
|
||||
DisposableHelper disposableHelper;
|
||||
do {
|
||||
disposable = this.c.get();
|
||||
if (disposable == this || disposable == (disposableHelper = DisposableHelper.DISPOSED)) {
|
||||
return false;
|
||||
}
|
||||
} while (!this.c.compareAndSet(disposable, disposableHelper));
|
||||
if (disposable != null) {
|
||||
disposable.dispose();
|
||||
}
|
||||
countDown();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Future
|
||||
public T get() throws InterruptedException, ExecutionException {
|
||||
if (getCount() != 0) {
|
||||
BlockingHelper.a();
|
||||
await();
|
||||
}
|
||||
if (isCancelled()) {
|
||||
throw new CancellationException();
|
||||
}
|
||||
Throwable th = this.b;
|
||||
if (th == null) {
|
||||
return this.a;
|
||||
}
|
||||
throw new ExecutionException(th);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Future
|
||||
public boolean isCancelled() {
|
||||
return DisposableHelper.isDisposed(this.c.get());
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Future
|
||||
public boolean isDone() {
|
||||
return getCount() == 0;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
Disposable disposable;
|
||||
if (this.a == null) {
|
||||
onError(new NoSuchElementException("The source is empty"));
|
||||
return;
|
||||
}
|
||||
do {
|
||||
disposable = this.c.get();
|
||||
if (disposable == this || disposable == DisposableHelper.DISPOSED) {
|
||||
return;
|
||||
}
|
||||
} while (!this.c.compareAndSet(disposable, this));
|
||||
countDown();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
Disposable disposable;
|
||||
if (this.b != null) {
|
||||
RxJavaPlugins.b(th);
|
||||
return;
|
||||
}
|
||||
this.b = th;
|
||||
do {
|
||||
disposable = this.c.get();
|
||||
if (disposable == this || disposable == DisposableHelper.DISPOSED) {
|
||||
RxJavaPlugins.b(th);
|
||||
return;
|
||||
}
|
||||
} while (!this.c.compareAndSet(disposable, this));
|
||||
countDown();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onNext(T t) {
|
||||
if (this.a == null) {
|
||||
this.a = t;
|
||||
} else {
|
||||
this.c.get().dispose();
|
||||
onError(new IndexOutOfBoundsException("More than one element received"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
DisposableHelper.setOnce(this.c, disposable);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Future
|
||||
public T get(long j, TimeUnit timeUnit) throws InterruptedException, ExecutionException, TimeoutException {
|
||||
if (getCount() != 0) {
|
||||
BlockingHelper.a();
|
||||
if (!await(j, timeUnit)) {
|
||||
throw new TimeoutException();
|
||||
}
|
||||
}
|
||||
if (!isCancelled()) {
|
||||
Throwable th = this.b;
|
||||
if (th == null) {
|
||||
return this.a;
|
||||
}
|
||||
throw new ExecutionException(th);
|
||||
}
|
||||
throw new CancellationException();
|
||||
}
|
||||
}
|
@@ -0,0 +1,91 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.internal.disposables.DisposableHelper;
|
||||
import io.reactivex.internal.fuseable.QueueDisposable;
|
||||
import io.reactivex.internal.fuseable.SimpleQueue;
|
||||
import io.reactivex.internal.util.QueueDrainHelper;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class InnerQueuedObserver<T> extends AtomicReference<Disposable> implements Observer<T>, Disposable {
|
||||
private static final long serialVersionUID = -5417183359794346637L;
|
||||
volatile boolean done;
|
||||
int fusionMode;
|
||||
final InnerQueuedObserverSupport<T> parent;
|
||||
final int prefetch;
|
||||
SimpleQueue<T> queue;
|
||||
|
||||
public InnerQueuedObserver(InnerQueuedObserverSupport<T> innerQueuedObserverSupport, int i) {
|
||||
this.parent = innerQueuedObserverSupport;
|
||||
this.prefetch = i;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
DisposableHelper.dispose(this);
|
||||
}
|
||||
|
||||
public int fusionMode() {
|
||||
return this.fusionMode;
|
||||
}
|
||||
|
||||
public boolean isDisposed() {
|
||||
return DisposableHelper.isDisposed(get());
|
||||
}
|
||||
|
||||
public boolean isDone() {
|
||||
return this.done;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
this.parent.a(this);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
this.parent.a((InnerQueuedObserver) this, th);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onNext(T t) {
|
||||
if (this.fusionMode == 0) {
|
||||
this.parent.a((InnerQueuedObserver<InnerQueuedObserver<T>>) this, (InnerQueuedObserver<T>) t);
|
||||
} else {
|
||||
this.parent.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
if (DisposableHelper.setOnce(this, disposable)) {
|
||||
if (disposable instanceof QueueDisposable) {
|
||||
QueueDisposable queueDisposable = (QueueDisposable) disposable;
|
||||
int requestFusion = queueDisposable.requestFusion(3);
|
||||
if (requestFusion == 1) {
|
||||
this.fusionMode = requestFusion;
|
||||
this.queue = queueDisposable;
|
||||
this.done = true;
|
||||
this.parent.a(this);
|
||||
return;
|
||||
}
|
||||
if (requestFusion == 2) {
|
||||
this.fusionMode = requestFusion;
|
||||
this.queue = queueDisposable;
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.queue = QueueDrainHelper.a(-this.prefetch);
|
||||
}
|
||||
}
|
||||
|
||||
public SimpleQueue<T> queue() {
|
||||
return this.queue;
|
||||
}
|
||||
|
||||
public void setDone() {
|
||||
this.done = true;
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface InnerQueuedObserverSupport<T> {
|
||||
void a();
|
||||
|
||||
void a(InnerQueuedObserver<T> innerQueuedObserver);
|
||||
|
||||
void a(InnerQueuedObserver<T> innerQueuedObserver, T t);
|
||||
|
||||
void a(InnerQueuedObserver<T> innerQueuedObserver, Throwable th);
|
||||
}
|
98
sources/io/reactivex/internal/observers/LambdaObserver.java
Normal file
98
sources/io/reactivex/internal/observers/LambdaObserver.java
Normal file
@@ -0,0 +1,98 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.exceptions.CompositeException;
|
||||
import io.reactivex.exceptions.Exceptions;
|
||||
import io.reactivex.functions.Action;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.internal.disposables.DisposableHelper;
|
||||
import io.reactivex.internal.functions.Functions;
|
||||
import io.reactivex.observers.LambdaConsumerIntrospection;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class LambdaObserver<T> extends AtomicReference<Disposable> implements Observer<T>, Disposable, LambdaConsumerIntrospection {
|
||||
private static final long serialVersionUID = -7251123623727029452L;
|
||||
final Action onComplete;
|
||||
final Consumer<? super Throwable> onError;
|
||||
final Consumer<? super T> onNext;
|
||||
final Consumer<? super Disposable> onSubscribe;
|
||||
|
||||
public LambdaObserver(Consumer<? super T> consumer, Consumer<? super Throwable> consumer2, Action action, Consumer<? super Disposable> consumer3) {
|
||||
this.onNext = consumer;
|
||||
this.onError = consumer2;
|
||||
this.onComplete = action;
|
||||
this.onSubscribe = consumer3;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.disposables.Disposable
|
||||
public void dispose() {
|
||||
DisposableHelper.dispose(this);
|
||||
}
|
||||
|
||||
public boolean hasCustomOnError() {
|
||||
return this.onError != Functions.e;
|
||||
}
|
||||
|
||||
public boolean isDisposed() {
|
||||
return get() == DisposableHelper.DISPOSED;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
if (isDisposed()) {
|
||||
return;
|
||||
}
|
||||
lazySet(DisposableHelper.DISPOSED);
|
||||
try {
|
||||
this.onComplete.run();
|
||||
} catch (Throwable th) {
|
||||
Exceptions.b(th);
|
||||
RxJavaPlugins.b(th);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
if (isDisposed()) {
|
||||
RxJavaPlugins.b(th);
|
||||
return;
|
||||
}
|
||||
lazySet(DisposableHelper.DISPOSED);
|
||||
try {
|
||||
this.onError.accept(th);
|
||||
} catch (Throwable th2) {
|
||||
Exceptions.b(th2);
|
||||
RxJavaPlugins.b(new CompositeException(th, th2));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onNext(T t) {
|
||||
if (isDisposed()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.onNext.accept(t);
|
||||
} catch (Throwable th) {
|
||||
Exceptions.b(th);
|
||||
get().dispose();
|
||||
onError(th);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
if (DisposableHelper.setOnce(this, disposable)) {
|
||||
try {
|
||||
this.onSubscribe.accept(this);
|
||||
} catch (Throwable th) {
|
||||
Exceptions.b(th);
|
||||
disposable.dispose();
|
||||
onError(th);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,89 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.internal.fuseable.SimplePlainQueue;
|
||||
import io.reactivex.internal.util.ObservableQueueDrain;
|
||||
import io.reactivex.internal.util.QueueDrainHelper;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public abstract class QueueDrainObserver<T, U, V> extends QueueDrainSubscriberPad2 implements Observer<T>, ObservableQueueDrain<U, V> {
|
||||
protected final Observer<? super V> b;
|
||||
protected final SimplePlainQueue<U> c;
|
||||
protected volatile boolean d;
|
||||
protected volatile boolean e;
|
||||
protected Throwable f;
|
||||
|
||||
public QueueDrainObserver(Observer<? super V> observer, SimplePlainQueue<U> simplePlainQueue) {
|
||||
this.b = observer;
|
||||
this.c = simplePlainQueue;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.util.ObservableQueueDrain
|
||||
public void a(Observer<? super V> observer, U u) {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.util.ObservableQueueDrain
|
||||
public final boolean a() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.util.ObservableQueueDrain
|
||||
public final boolean b() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.util.ObservableQueueDrain
|
||||
public final Throwable c() {
|
||||
return this.f;
|
||||
}
|
||||
|
||||
public final boolean d() {
|
||||
return this.a.getAndIncrement() == 0;
|
||||
}
|
||||
|
||||
public final boolean e() {
|
||||
return this.a.get() == 0 && this.a.compareAndSet(0, 1);
|
||||
}
|
||||
|
||||
protected final void a(U u, boolean z, Disposable disposable) {
|
||||
Observer<? super V> observer = this.b;
|
||||
SimplePlainQueue<U> simplePlainQueue = this.c;
|
||||
if (this.a.get() == 0 && this.a.compareAndSet(0, 1)) {
|
||||
a(observer, u);
|
||||
if (a(-1) == 0) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
simplePlainQueue.offer(u);
|
||||
if (!d()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
QueueDrainHelper.a(simplePlainQueue, observer, z, disposable, this);
|
||||
}
|
||||
|
||||
protected final void b(U u, boolean z, Disposable disposable) {
|
||||
Observer<? super V> observer = this.b;
|
||||
SimplePlainQueue<U> simplePlainQueue = this.c;
|
||||
if (this.a.get() != 0 || !this.a.compareAndSet(0, 1)) {
|
||||
simplePlainQueue.offer(u);
|
||||
if (!d()) {
|
||||
return;
|
||||
}
|
||||
} else if (simplePlainQueue.isEmpty()) {
|
||||
a(observer, u);
|
||||
if (a(-1) == 0) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
simplePlainQueue.offer(u);
|
||||
}
|
||||
QueueDrainHelper.a(simplePlainQueue, observer, z, disposable, this);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.internal.util.ObservableQueueDrain
|
||||
public final int a(int i) {
|
||||
return this.a.addAndGet(i);
|
||||
}
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
package io.reactivex.internal.observers;
|
||||
|
||||
/* compiled from: QueueDrainObserver.java */
|
||||
/* loaded from: classes2.dex */
|
||||
class QueueDrainSubscriberPad0 {
|
||||
QueueDrainSubscriberPad0() {
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user