2021-06-27 20:44:35 +00:00
|
|
|
package androidx.lifecycle;
|
|
|
|
|
2021-12-21 23:37:30 +00:00
|
|
|
import b.i.a.f.e.o.f;
|
2021-11-08 18:25:28 +00:00
|
|
|
import d0.w.h.c;
|
|
|
|
import d0.z.d.m;
|
2021-06-27 20:44:35 +00:00
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.coroutines.Continuation;
|
|
|
|
import kotlin.coroutines.CoroutineContext;
|
2021-07-09 21:07:36 +00:00
|
|
|
import kotlinx.coroutines.CoroutineDispatcher;
|
2021-11-08 18:25:28 +00:00
|
|
|
import s.a.a.n;
|
2021-12-17 22:03:14 +00:00
|
|
|
import s.a.k0;
|
|
|
|
import s.a.m0;
|
2021-06-27 20:44:35 +00:00
|
|
|
/* 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;
|
2021-12-17 22:03:14 +00:00
|
|
|
CoroutineDispatcher coroutineDispatcher = k0.a;
|
2022-02-10 03:03:45 +00:00
|
|
|
this.coroutineContext = coroutineContext.plus(n.f3800b.H());
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // androidx.lifecycle.LiveDataScope
|
|
|
|
public Object emit(T t, Continuation<? super Unit> continuation) {
|
2022-01-27 00:50:41 +00:00
|
|
|
Object C1 = f.C1(this.coroutineContext, new LiveDataScopeImpl$emit$2(this, t, null), continuation);
|
|
|
|
return C1 == c.getCOROUTINE_SUSPENDED() ? C1 : Unit.a;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // androidx.lifecycle.LiveDataScope
|
2021-12-17 22:03:14 +00:00
|
|
|
public Object emitSource(LiveData<T> liveData, Continuation<? super m0> continuation) {
|
2022-01-27 00:50:41 +00:00
|
|
|
return f.C1(this.coroutineContext, new LiveDataScopeImpl$emitSource$2(this, liveData, null), continuation);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@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;
|
|
|
|
}
|
|
|
|
}
|