170 lines
5.2 KiB
Smali
170 lines
5.2 KiB
Smali
.class final Landroidx/work/impl/ToContinuation;
|
|
.super Ljava/lang/Object;
|
|
.source "SourceFile"
|
|
|
|
# interfaces
|
|
.implements Ljava/lang/Runnable;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">",
|
|
"Ljava/lang/Object;",
|
|
"Ljava/lang/Runnable;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field private final continuation:Lkotlinx/coroutines/CancellableContinuation;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lkotlinx/coroutines/CancellableContinuation;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private final futureToObserve:Lcom/google/common/util/concurrent/ListenableFuture;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lcom/google/common/util/concurrent/ListenableFuture;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lcom/google/common/util/concurrent/ListenableFuture;Lkotlinx/coroutines/CancellableContinuation;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lcom/google/common/util/concurrent/ListenableFuture;",
|
|
"Lkotlinx/coroutines/CancellableContinuation;",
|
|
")V"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "futureToObserve"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "continuation"
|
|
|
|
invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
.line 567
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Landroidx/work/impl/ToContinuation;->futureToObserve:Lcom/google/common/util/concurrent/ListenableFuture;
|
|
|
|
iput-object p2, p0, Landroidx/work/impl/ToContinuation;->continuation:Lkotlinx/coroutines/CancellableContinuation;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final getContinuation()Lkotlinx/coroutines/CancellableContinuation;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lkotlinx/coroutines/CancellableContinuation;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/ToContinuation;->continuation:Lkotlinx/coroutines/CancellableContinuation;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final getFutureToObserve()Lcom/google/common/util/concurrent/ListenableFuture;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lcom/google/common/util/concurrent/ListenableFuture;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/ToContinuation;->futureToObserve:Lcom/google/common/util/concurrent/ListenableFuture;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public run()V
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/ToContinuation;->futureToObserve:Lcom/google/common/util/concurrent/ListenableFuture;
|
|
|
|
.line 572
|
|
invoke-interface {v0}, Ljava/util/concurrent/Future;->isCancelled()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/ToContinuation;->continuation:Lkotlinx/coroutines/CancellableContinuation;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
.line 573
|
|
invoke-static {v0, v2, v1, v2}, Lkotlinx/coroutines/CancellableContinuation$DefaultImpls;->cancel$default(Lkotlinx/coroutines/CancellableContinuation;Ljava/lang/Throwable;ILjava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
:try_start_0
|
|
iget-object v0, p0, Landroidx/work/impl/ToContinuation;->continuation:Lkotlinx/coroutines/CancellableContinuation;
|
|
|
|
.line 576
|
|
sget-object v1, Lkotlin/Result;->Companion:Lkotlin/Result$Companion;
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/ToContinuation;->futureToObserve:Lcom/google/common/util/concurrent/ListenableFuture;
|
|
|
|
invoke-static {v1}, Landroidx/work/impl/WorkerWrapperKt;->access$getUninterruptibly(Ljava/util/concurrent/Future;)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1}, Lkotlin/Result;->constructor-impl(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v0, v1}, Lkotlin/coroutines/Continuation;->resumeWith(Ljava/lang/Object;)V
|
|
:try_end_0
|
|
.catch Ljava/util/concurrent/ExecutionException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception v0
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/ToContinuation;->continuation:Lkotlinx/coroutines/CancellableContinuation;
|
|
|
|
.line 581
|
|
sget-object v2, Lkotlin/Result;->Companion:Lkotlin/Result$Companion;
|
|
|
|
invoke-static {v0}, Landroidx/work/impl/WorkerWrapperKt;->access$nonNullCause(Ljava/util/concurrent/ExecutionException;)Ljava/lang/Throwable;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lkotlin/ResultKt;->createFailure(Ljava/lang/Throwable;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lkotlin/Result;->constructor-impl(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v1, v0}, Lkotlin/coroutines/Continuation;->resumeWith(Ljava/lang/Object;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|