56 lines
2.2 KiB
Java
56 lines
2.2 KiB
Java
package androidx.lifecycle;
|
|
|
|
import androidx.annotation.RequiresApi;
|
|
import d0.w.f;
|
|
import d0.z.d.m;
|
|
import java.time.Duration;
|
|
import kotlin.coroutines.CoroutineContext;
|
|
import s.a.a2.b;
|
|
import s.a.a2.d;
|
|
/* compiled from: FlowLiveData.kt */
|
|
public final class FlowLiveDataConversions {
|
|
public static final <T> b<T> asFlow(LiveData<T> liveData) {
|
|
m.checkNotNullParameter(liveData, "$this$asFlow");
|
|
return new d(new FlowLiveDataConversions$asFlow$1(liveData, null));
|
|
}
|
|
|
|
public static final <T> LiveData<T> asLiveData(b<? extends T> bVar) {
|
|
return asLiveData$default(bVar, (CoroutineContext) null, 0, 3, (Object) null);
|
|
}
|
|
|
|
public static final <T> LiveData<T> asLiveData(b<? extends T> bVar, CoroutineContext coroutineContext) {
|
|
return asLiveData$default(bVar, coroutineContext, 0, 2, (Object) null);
|
|
}
|
|
|
|
public static final <T> LiveData<T> asLiveData(b<? extends T> bVar, CoroutineContext coroutineContext, long j) {
|
|
m.checkNotNullParameter(bVar, "$this$asLiveData");
|
|
m.checkNotNullParameter(coroutineContext, "context");
|
|
return CoroutineLiveDataKt.liveData(coroutineContext, j, new FlowLiveDataConversions$asLiveData$1(bVar, null));
|
|
}
|
|
|
|
@RequiresApi(26)
|
|
public static final <T> LiveData<T> asLiveData(b<? extends T> bVar, CoroutineContext coroutineContext, Duration duration) {
|
|
m.checkNotNullParameter(bVar, "$this$asLiveData");
|
|
m.checkNotNullParameter(coroutineContext, "context");
|
|
m.checkNotNullParameter(duration, "timeout");
|
|
return asLiveData(bVar, coroutineContext, duration.toMillis());
|
|
}
|
|
|
|
public static /* synthetic */ LiveData asLiveData$default(b bVar, CoroutineContext coroutineContext, long j, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
coroutineContext = f.i;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
j = 5000;
|
|
}
|
|
return asLiveData(bVar, coroutineContext, j);
|
|
}
|
|
|
|
public static /* synthetic */ LiveData asLiveData$default(b bVar, CoroutineContext coroutineContext, Duration duration, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
coroutineContext = f.i;
|
|
}
|
|
return asLiveData(bVar, coroutineContext, duration);
|
|
}
|
|
}
|