51 lines
1.7 KiB
Java
51 lines
1.7 KiB
Java
package androidx.lifecycle;
|
|
|
|
import androidx.annotation.MainThread;
|
|
import c.i.a.f.e.o.f;
|
|
import d0.w.h.c;
|
|
import d0.z.d.m;
|
|
import kotlin.Unit;
|
|
import kotlin.coroutines.Continuation;
|
|
import kotlinx.coroutines.CoroutineDispatcher;
|
|
import s.a.a.n;
|
|
import s.a.k0;
|
|
import s.a.m0;
|
|
/* compiled from: CoroutineLiveData.kt */
|
|
public final class EmittedSource implements m0 {
|
|
private boolean disposed;
|
|
private final MediatorLiveData<?> mediator;
|
|
private final LiveData<?> source;
|
|
|
|
public EmittedSource(LiveData<?> liveData, MediatorLiveData<?> mediatorLiveData) {
|
|
m.checkNotNullParameter(liveData, "source");
|
|
m.checkNotNullParameter(mediatorLiveData, "mediator");
|
|
this.source = liveData;
|
|
this.mediator = mediatorLiveData;
|
|
}
|
|
|
|
public static final /* synthetic */ void access$removeSource(EmittedSource emittedSource) {
|
|
emittedSource.removeSource();
|
|
}
|
|
|
|
/* JADX DEBUG: Type inference failed for r1v0. Raw type applied. Possible types: androidx.lifecycle.LiveData<?>, androidx.lifecycle.LiveData<S> */
|
|
@MainThread
|
|
private final void removeSource() {
|
|
if (!this.disposed) {
|
|
this.mediator.removeSource(this.source);
|
|
this.disposed = true;
|
|
}
|
|
}
|
|
|
|
@Override // s.a.m0
|
|
public void dispose() {
|
|
CoroutineDispatcher coroutineDispatcher = k0.a;
|
|
f.F0(f.c(n.b.H()), null, null, new EmittedSource$dispose$1(this, null), 3, null);
|
|
}
|
|
|
|
public final Object disposeNow(Continuation<? super Unit> continuation) {
|
|
CoroutineDispatcher coroutineDispatcher = k0.a;
|
|
Object t1 = f.t1(n.b.H(), new EmittedSource$disposeNow$2(this, null), continuation);
|
|
return t1 == c.getCOROUTINE_SUSPENDED() ? t1 : Unit.a;
|
|
}
|
|
}
|