51 lines
1.9 KiB
Java
51 lines
1.9 KiB
Java
package androidx.lifecycle;
|
|
|
|
import c.q.a.k.a;
|
|
import d0.w.g.c;
|
|
import d0.z.d.m;
|
|
import kotlin.Unit;
|
|
import kotlin.coroutines.Continuation;
|
|
import kotlin.coroutines.CoroutineContext;
|
|
import kotlinx.coroutines.CoroutineDispatcher;
|
|
import s.a.a.n;
|
|
import s.a.j0;
|
|
import s.a.l0;
|
|
/* compiled from: CoroutineLiveData.kt */
|
|
public final class LiveDataScopeImpl<T> implements LiveDataScope<T> {
|
|
private final CoroutineContext coroutineContext;
|
|
private CoroutineLiveData<T> target;
|
|
|
|
public LiveDataScopeImpl(CoroutineLiveData<T> coroutineLiveData, CoroutineContext coroutineContext) {
|
|
m.checkNotNullParameter(coroutineLiveData, "target");
|
|
m.checkNotNullParameter(coroutineContext, "context");
|
|
this.target = coroutineLiveData;
|
|
CoroutineDispatcher coroutineDispatcher = j0.a;
|
|
this.coroutineContext = coroutineContext.plus(n.b.H());
|
|
}
|
|
|
|
@Override // androidx.lifecycle.LiveDataScope
|
|
public Object emit(T t, Continuation<? super Unit> continuation) {
|
|
Object i02 = a.i0(this.coroutineContext, new LiveDataScopeImpl$emit$2(this, t, null), continuation);
|
|
return i02 == c.getCOROUTINE_SUSPENDED() ? i02 : Unit.a;
|
|
}
|
|
|
|
@Override // androidx.lifecycle.LiveDataScope
|
|
public Object emitSource(LiveData<T> liveData, Continuation<? super l0> continuation) {
|
|
return a.i0(this.coroutineContext, new LiveDataScopeImpl$emitSource$2(this, liveData, null), continuation);
|
|
}
|
|
|
|
@Override // androidx.lifecycle.LiveDataScope
|
|
public T getLatestValue() {
|
|
return this.target.getValue();
|
|
}
|
|
|
|
public final CoroutineLiveData<T> getTarget$lifecycle_livedata_ktx_release() {
|
|
return this.target;
|
|
}
|
|
|
|
public final void setTarget$lifecycle_livedata_ktx_release(CoroutineLiveData<T> coroutineLiveData) {
|
|
m.checkNotNullParameter(coroutineLiveData, "<set-?>");
|
|
this.target = coroutineLiveData;
|
|
}
|
|
}
|