discord-jadx/app/src/main/java/androidx/lifecycle/PausingDispatcherKt.java

49 lines
2.9 KiB
Java

package androidx.lifecycle;
import androidx.lifecycle.Lifecycle;
import c.q.a.k.a;
import d0.z.d.m;
import kotlin.coroutines.Continuation;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.CoroutineDispatcher;
import kotlinx.coroutines.CoroutineScope;
import s.a.a.n;
import s.a.j0;
/* compiled from: PausingDispatcher.kt */
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) {
CoroutineDispatcher coroutineDispatcher = j0.a;
return a.i0(n.b.H(), new PausingDispatcherKt$whenStateAtLeast$2(lifecycle, state, function2, null), continuation);
}
}