2021-07-24 02:37:17 +00:00
|
|
|
package androidx.lifecycle;
|
|
|
|
|
|
|
|
import androidx.lifecycle.Lifecycle;
|
2021-12-17 21:59:34 +00:00
|
|
|
import b.i.a.f.e.o.f;
|
2021-11-02 06:38:17 +00:00
|
|
|
import d0.z.d.m;
|
2021-07-24 02:37:17 +00:00
|
|
|
import kotlin.coroutines.Continuation;
|
|
|
|
import kotlin.jvm.functions.Function2;
|
|
|
|
import kotlinx.coroutines.CoroutineDispatcher;
|
|
|
|
import kotlinx.coroutines.CoroutineScope;
|
2021-11-02 06:38:17 +00:00
|
|
|
import s.a.a.n;
|
2021-12-02 18:53:44 +00:00
|
|
|
import s.a.k0;
|
2021-07-24 02:37:17 +00:00
|
|
|
/* compiled from: PausingDispatcher.kt */
|
2022-03-07 09:34:54 +00:00
|
|
|
/* loaded from: classes.dex */
|
2021-07-24 02:37:17 +00:00
|
|
|
public final class PausingDispatcherKt {
|
|
|
|
public static final <T> Object whenCreated(Lifecycle lifecycle, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2, Continuation<? super T> continuation) {
|
|
|
|
return whenStateAtLeast(lifecycle, Lifecycle.State.CREATED, function2, continuation);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final <T> Object whenCreated(LifecycleOwner lifecycleOwner, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2, Continuation<? super T> continuation) {
|
|
|
|
Lifecycle lifecycle = lifecycleOwner.getLifecycle();
|
|
|
|
m.checkNotNullExpressionValue(lifecycle, "lifecycle");
|
|
|
|
return whenCreated(lifecycle, function2, continuation);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final <T> Object whenResumed(Lifecycle lifecycle, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2, Continuation<? super T> continuation) {
|
|
|
|
return whenStateAtLeast(lifecycle, Lifecycle.State.RESUMED, function2, continuation);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final <T> Object whenResumed(LifecycleOwner lifecycleOwner, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2, Continuation<? super T> continuation) {
|
|
|
|
Lifecycle lifecycle = lifecycleOwner.getLifecycle();
|
|
|
|
m.checkNotNullExpressionValue(lifecycle, "lifecycle");
|
|
|
|
return whenResumed(lifecycle, function2, continuation);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final <T> Object whenStarted(Lifecycle lifecycle, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2, Continuation<? super T> continuation) {
|
|
|
|
return whenStateAtLeast(lifecycle, Lifecycle.State.STARTED, function2, continuation);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final <T> Object whenStarted(LifecycleOwner lifecycleOwner, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2, Continuation<? super T> continuation) {
|
|
|
|
Lifecycle lifecycle = lifecycleOwner.getLifecycle();
|
|
|
|
m.checkNotNullExpressionValue(lifecycle, "lifecycle");
|
|
|
|
return whenStarted(lifecycle, function2, continuation);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final <T> Object whenStateAtLeast(Lifecycle lifecycle, Lifecycle.State state, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2, Continuation<? super T> continuation) {
|
2021-12-02 18:53:44 +00:00
|
|
|
CoroutineDispatcher coroutineDispatcher = k0.a;
|
2022-03-21 18:52:30 +00:00
|
|
|
return f.C1(n.f3812b.H(), new PausingDispatcherKt$whenStateAtLeast$2(lifecycle, state, function2, null), continuation);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
}
|