apkfuckery/com.discord/smali/androidx/lifecycle/ViewModelKt.smali
2020-07-25 00:57:58 +00:00

69 lines
1.9 KiB
Smali

.class public final Landroidx/lifecycle/ViewModelKt;
.super Ljava/lang/Object;
.source "ViewModel.kt"
# static fields
.field public static final JOB_KEY:Ljava/lang/String; = "androidx.lifecycle.ViewModelCoroutineScope.JOB_KEY"
# direct methods
.method public static final getViewModelScope(Landroidx/lifecycle/ViewModel;)Lkotlinx/coroutines/CoroutineScope;
.locals 4
const/4 v0, 0x0
if-eqz p0, :cond_1
const-string v1, "androidx.lifecycle.ViewModelCoroutineScope.JOB_KEY"
invoke-virtual {p0, v1}, Landroidx/lifecycle/ViewModel;->getTag(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v2
check-cast v2, Lkotlinx/coroutines/CoroutineScope;
if-eqz v2, :cond_0
return-object v2
:cond_0
new-instance v2, Landroidx/lifecycle/CloseableCoroutineScope;
new-instance v3, Lk0/a/l1;
invoke-direct {v3, v0}, Lk0/a/l1;-><init>(Lkotlinx/coroutines/Job;)V
invoke-static {}, Lk0/a/j0;->a()Lk0/a/f1;
move-result-object v0
invoke-virtual {v0}, Lk0/a/f1;->v()Lk0/a/f1;
move-result-object v0
invoke-virtual {v3, v0}, Lk0/a/c1;->plus(Lkotlin/coroutines/CoroutineContext;)Lkotlin/coroutines/CoroutineContext;
move-result-object v0
invoke-direct {v2, v0}, Landroidx/lifecycle/CloseableCoroutineScope;-><init>(Lkotlin/coroutines/CoroutineContext;)V
invoke-virtual {p0, v1, v2}, Landroidx/lifecycle/ViewModel;->setTagIfAbsent(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p0
const-string v0, "setTagIfAbsent(JOB_KEY,\n\u2026patchers.Main.immediate))"
invoke-static {p0, v0}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
check-cast p0, Lkotlinx/coroutines/CoroutineScope;
return-object p0
:cond_1
const-string p0, "$this$viewModelScope"
invoke-static {p0}, Lj0/n/c/h;->c(Ljava/lang/String;)V
throw v0
.end method