29 lines
1.2 KiB
Java
29 lines
1.2 KiB
Java
package androidx.lifecycle;
|
|
|
|
import c.q.a.k.a;
|
|
import d0.z.d.m;
|
|
import kotlin.coroutines.CoroutineContext;
|
|
import kotlinx.coroutines.CoroutineDispatcher;
|
|
import kotlinx.coroutines.CoroutineScope;
|
|
import s.a.a.n;
|
|
import s.a.g1;
|
|
import s.a.j0;
|
|
import s.a.t;
|
|
/* compiled from: ViewModel.kt */
|
|
public final class ViewModelKt {
|
|
private static final String JOB_KEY = "androidx.lifecycle.ViewModelCoroutineScope.JOB_KEY";
|
|
|
|
public static final CoroutineScope getViewModelScope(ViewModel viewModel) {
|
|
m.checkNotNullParameter(viewModel, "$this$viewModelScope");
|
|
CoroutineScope coroutineScope = (CoroutineScope) viewModel.getTag("androidx.lifecycle.ViewModelCoroutineScope.JOB_KEY");
|
|
if (coroutineScope != null) {
|
|
return coroutineScope;
|
|
}
|
|
t b = a.b(null, 1);
|
|
CoroutineDispatcher coroutineDispatcher = j0.a;
|
|
Object tagIfAbsent = viewModel.setTagIfAbsent("androidx.lifecycle.ViewModelCoroutineScope.JOB_KEY", new CloseableCoroutineScope(CoroutineContext.Element.a.plus((g1) b, n.b.H())));
|
|
m.checkNotNullExpressionValue(tagIfAbsent, "setTagIfAbsent(\n …Main.immediate)\n )");
|
|
return (CoroutineScope) tagIfAbsent;
|
|
}
|
|
}
|