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

29 lines
1.1 KiB
Java
Raw Normal View History

2021-07-24 02:37:17 +00:00
package androidx.lifecycle;
2021-11-05 21:05:33 +00:00
import c.i.a.f.e.o.f;
2021-11-01 07:19:03 +00:00
import d0.z.d.m;
2021-07-24 02:37:17 +00:00
import kotlin.coroutines.CoroutineContext;
import kotlinx.coroutines.CoroutineDispatcher;
import kotlinx.coroutines.CoroutineScope;
2021-11-01 07:19:03 +00:00
import s.a.a.n;
import s.a.g1;
import s.a.j0;
import s.a.t;
2021-07-24 02:37:17 +00:00
/* 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(JOB_KEY);
2021-07-24 02:37:17 +00:00
if (coroutineScope != null) {
return coroutineScope;
}
2021-11-05 21:05:33 +00:00
t b = f.b(null, 1);
2021-07-24 02:37:17 +00:00
CoroutineDispatcher coroutineDispatcher = j0.a;
Object tagIfAbsent = viewModel.setTagIfAbsent(JOB_KEY, new CloseableCoroutineScope(CoroutineContext.Element.a.plus((g1) b, n.b.H())));
2021-07-24 02:37:17 +00:00
m.checkNotNullExpressionValue(tagIfAbsent, "setTagIfAbsent(\n …Main.immediate)\n )");
return (CoroutineScope) tagIfAbsent;
}
}