50 lines
1.8 KiB
Java
50 lines
1.8 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 s.a.j0;
|
||
|
import s.a.k0;
|
||
|
import s.a.z;
|
||
|
/* 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;
|
||
|
z zVar = j0.a;
|
||
|
this.coroutineContext = coroutineContext.plus(s.a.a.m.b.H());
|
||
|
}
|
||
|
|
||
|
@Override // androidx.lifecycle.LiveDataScope
|
||
|
public Object emit(T t, Continuation<? super Unit> continuation) {
|
||
|
Object h02 = a.h0(this.coroutineContext, new LiveDataScopeImpl$emit$2(this, t, null), continuation);
|
||
|
return h02 == c.getCOROUTINE_SUSPENDED() ? h02 : Unit.a;
|
||
|
}
|
||
|
|
||
|
@Override // androidx.lifecycle.LiveDataScope
|
||
|
public Object emitSource(LiveData<T> liveData, Continuation<? super k0> continuation) {
|
||
|
return a.h0(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;
|
||
|
}
|
||
|
}
|