apkfuckery/com.discord/smali/androidx/concurrent/futures/AbstractResolvableFuture.smali
2020-09-10 21:23:57 +00:00

2050 lines
61 KiB
Smali

.class public abstract Landroidx/concurrent/futures/AbstractResolvableFuture;
.super Ljava/lang/Object;
.source "AbstractResolvableFuture.java"
# interfaces
.implements Lf/h/b/a/a/a;
# annotations
.annotation build Landroidx/annotation/RestrictTo;
value = {
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
}
.end annotation
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/concurrent/futures/AbstractResolvableFuture$SynchronizedHelper;,
Landroidx/concurrent/futures/AbstractResolvableFuture$SafeAtomicHelper;,
Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;,
Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;,
Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;,
Landroidx/concurrent/futures/AbstractResolvableFuture$Failure;,
Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;,
Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"<V:",
"Ljava/lang/Object;",
">",
"Ljava/lang/Object;",
"Lf/h/b/a/a/a<",
"TV;>;"
}
.end annotation
# static fields
.field public static final ATOMIC_HELPER:Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;
.field public static final GENERATE_CANCELLATION_CAUSES:Z
.field public static final NULL:Ljava/lang/Object;
.field public static final SPIN_THRESHOLD_NANOS:J = 0x3e8L
.field public static final log:Ljava/util/logging/Logger;
# instance fields
.field public volatile listeners:Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end field
.field public volatile value:Ljava/lang/Object;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end field
.field public volatile waiters:Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end field
# direct methods
.method public static constructor <clinit>()V
.locals 8
const-class v0, Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;
const-string v1, "guava.concurrent.generate_cancellation_cause"
const-string v2, "false"
invoke-static {v1, v2}, Ljava/lang/System;->getProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v1
invoke-static {v1}, Ljava/lang/Boolean;->parseBoolean(Ljava/lang/String;)Z
move-result v1
sput-boolean v1, Landroidx/concurrent/futures/AbstractResolvableFuture;->GENERATE_CANCELLATION_CAUSES:Z
const-class v1, Landroidx/concurrent/futures/AbstractResolvableFuture;
invoke-virtual {v1}, Ljava/lang/Class;->getName()Ljava/lang/String;
move-result-object v1
invoke-static {v1}, Ljava/util/logging/Logger;->getLogger(Ljava/lang/String;)Ljava/util/logging/Logger;
move-result-object v1
sput-object v1, Landroidx/concurrent/futures/AbstractResolvableFuture;->log:Ljava/util/logging/Logger;
:try_start_0
new-instance v1, Landroidx/concurrent/futures/AbstractResolvableFuture$SafeAtomicHelper;
const-class v2, Ljava/lang/Thread;
const-string v3, "thread"
invoke-static {v0, v2, v3}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;
move-result-object v3
const-string v2, "next"
invoke-static {v0, v0, v2}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;
move-result-object v4
const-class v2, Landroidx/concurrent/futures/AbstractResolvableFuture;
const-string/jumbo v5, "waiters"
invoke-static {v2, v0, v5}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;
move-result-object v5
const-class v0, Landroidx/concurrent/futures/AbstractResolvableFuture;
const-class v2, Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;
const-string v6, "listeners"
invoke-static {v0, v2, v6}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;
move-result-object v6
const-class v0, Landroidx/concurrent/futures/AbstractResolvableFuture;
const-class v2, Ljava/lang/Object;
const-string/jumbo v7, "value"
invoke-static {v0, v2, v7}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;
move-result-object v7
move-object v2, v1
invoke-direct/range {v2 .. v7}, Landroidx/concurrent/futures/AbstractResolvableFuture$SafeAtomicHelper;-><init>(Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
const/4 v0, 0x0
goto :goto_0
:catchall_0
move-exception v0
new-instance v1, Landroidx/concurrent/futures/AbstractResolvableFuture$SynchronizedHelper;
invoke-direct {v1}, Landroidx/concurrent/futures/AbstractResolvableFuture$SynchronizedHelper;-><init>()V
:goto_0
sput-object v1, Landroidx/concurrent/futures/AbstractResolvableFuture;->ATOMIC_HELPER:Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;
const-class v1, Ljava/util/concurrent/locks/LockSupport;
if-eqz v0, :cond_0
sget-object v1, Landroidx/concurrent/futures/AbstractResolvableFuture;->log:Ljava/util/logging/Logger;
sget-object v2, Ljava/util/logging/Level;->SEVERE:Ljava/util/logging/Level;
const-string v3, "SafeAtomicHelper is broken!"
invoke-virtual {v1, v2, v3, v0}, Ljava/util/logging/Logger;->log(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
:cond_0
new-instance v0, Ljava/lang/Object;
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
sput-object v0, Landroidx/concurrent/futures/AbstractResolvableFuture;->NULL:Ljava/lang/Object;
return-void
.end method
.method public constructor <init>()V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method private addDoneString(Ljava/lang/StringBuilder;)V
.locals 3
const-string v0, "]"
:try_start_0
invoke-static {p0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->getUninterruptibly(Ljava/util/concurrent/Future;)Ljava/lang/Object;
move-result-object v1
const-string v2, "SUCCESS, result=["
invoke-virtual {p1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-direct {p0, v1}, Landroidx/concurrent/futures/AbstractResolvableFuture;->userObjectToString(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v1
invoke-virtual {p1, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
:try_end_0
.catch Ljava/util/concurrent/ExecutionException; {:try_start_0 .. :try_end_0} :catch_2
.catch Ljava/util/concurrent/CancellationException; {:try_start_0 .. :try_end_0} :catch_1
.catch Ljava/lang/RuntimeException; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
:catch_0
move-exception v0
const-string v1, "UNKNOWN, cause=["
invoke-virtual {p1, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v0
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string v0, " thrown from get()]"
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
goto :goto_0
:catch_1
const-string v0, "CANCELLED"
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
goto :goto_0
:catch_2
move-exception v1
const-string v2, "FAILURE, cause=["
invoke-virtual {p1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/util/concurrent/ExecutionException;->getCause()Ljava/lang/Throwable;
move-result-object v1
invoke-virtual {p1, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
:goto_0
return-void
.end method
.method public static cancellationExceptionWithCause(Ljava/lang/String;Ljava/lang/Throwable;)Ljava/util/concurrent/CancellationException;
.locals 1
.param p0 # Ljava/lang/String;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.param p1 # Ljava/lang/Throwable;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
new-instance v0, Ljava/util/concurrent/CancellationException;
invoke-direct {v0, p0}, Ljava/util/concurrent/CancellationException;-><init>(Ljava/lang/String;)V
invoke-virtual {v0, p1}, Ljava/util/concurrent/CancellationException;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;
return-object v0
.end method
.method public static checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.locals 0
.param p0 # Ljava/lang/Object;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.annotation build Landroidx/annotation/NonNull;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">(TT;)TT;"
}
.end annotation
if-eqz p0, :cond_0
return-object p0
:cond_0
const/4 p0, 0x0
throw p0
.end method
.method private clearListeners(Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;)Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;
.locals 4
:cond_0
iget-object v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->listeners:Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;
sget-object v1, Landroidx/concurrent/futures/AbstractResolvableFuture;->ATOMIC_HELPER:Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;
sget-object v2, Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;->TOMBSTONE:Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;
invoke-virtual {v1, p0, v0, v2}, Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;->casListeners(Landroidx/concurrent/futures/AbstractResolvableFuture;Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;)Z
move-result v1
if-eqz v1, :cond_0
move-object v3, v0
move-object v0, p1
move-object p1, v3
:goto_0
if-eqz p1, :cond_1
iget-object v1, p1, Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;->next:Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;
iput-object v0, p1, Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;->next:Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;
move-object v0, p1
move-object p1, v1
goto :goto_0
:cond_1
return-object v0
.end method
.method public static complete(Landroidx/concurrent/futures/AbstractResolvableFuture;)V
.locals 4
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroidx/concurrent/futures/AbstractResolvableFuture<",
"*>;)V"
}
.end annotation
const/4 v0, 0x0
:goto_0
invoke-direct {p0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->releaseWaiters()V
invoke-virtual {p0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->afterDone()V
invoke-direct {p0, v0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->clearListeners(Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;)Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;
move-result-object p0
:goto_1
if-eqz p0, :cond_2
iget-object v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;->next:Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;
iget-object v1, p0, Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;->task:Ljava/lang/Runnable;
instance-of v2, v1, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;
if-eqz v2, :cond_0
check-cast v1, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;
iget-object p0, v1, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;->owner:Landroidx/concurrent/futures/AbstractResolvableFuture;
iget-object v2, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->value:Ljava/lang/Object;
if-ne v2, v1, :cond_1
iget-object v2, v1, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;->future:Lf/h/b/a/a/a;
invoke-static {v2}, Landroidx/concurrent/futures/AbstractResolvableFuture;->getFutureValue(Lf/h/b/a/a/a;)Ljava/lang/Object;
move-result-object v2
sget-object v3, Landroidx/concurrent/futures/AbstractResolvableFuture;->ATOMIC_HELPER:Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;
invoke-virtual {v3, p0, v1, v2}, Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;->casValue(Landroidx/concurrent/futures/AbstractResolvableFuture;Ljava/lang/Object;Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_1
goto :goto_0
:cond_0
iget-object p0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;->executor:Ljava/util/concurrent/Executor;
invoke-static {v1, p0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->executeListener(Ljava/lang/Runnable;Ljava/util/concurrent/Executor;)V
:cond_1
move-object p0, v0
goto :goto_1
:cond_2
return-void
.end method
.method public static executeListener(Ljava/lang/Runnable;Ljava/util/concurrent/Executor;)V
.locals 5
:try_start_0
invoke-interface {p1, p0}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
:try_end_0
.catch Ljava/lang/RuntimeException; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
:catch_0
move-exception v0
sget-object v1, Landroidx/concurrent/futures/AbstractResolvableFuture;->log:Ljava/util/logging/Logger;
sget-object v2, Ljava/util/logging/Level;->SEVERE:Ljava/util/logging/Level;
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "RuntimeException while executing runnable "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string p0, " with executor "
invoke-virtual {v3, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
invoke-virtual {v1, v2, p0, v0}, Ljava/util/logging/Logger;->log(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
:goto_0
return-void
.end method
.method private getDoneValue(Ljava/lang/Object;)Ljava/lang/Object;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/lang/Object;",
")TV;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/util/concurrent/ExecutionException;
}
.end annotation
instance-of v0, p1, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;
if-nez v0, :cond_2
instance-of v0, p1, Landroidx/concurrent/futures/AbstractResolvableFuture$Failure;
if-nez v0, :cond_1
sget-object v0, Landroidx/concurrent/futures/AbstractResolvableFuture;->NULL:Ljava/lang/Object;
if-ne p1, v0, :cond_0
const/4 p1, 0x0
:cond_0
return-object p1
:cond_1
new-instance v0, Ljava/util/concurrent/ExecutionException;
check-cast p1, Landroidx/concurrent/futures/AbstractResolvableFuture$Failure;
iget-object p1, p1, Landroidx/concurrent/futures/AbstractResolvableFuture$Failure;->exception:Ljava/lang/Throwable;
invoke-direct {v0, p1}, Ljava/util/concurrent/ExecutionException;-><init>(Ljava/lang/Throwable;)V
throw v0
:cond_2
check-cast p1, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;
iget-object p1, p1, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;->cause:Ljava/lang/Throwable;
const-string v0, "Task was cancelled."
invoke-static {v0, p1}, Landroidx/concurrent/futures/AbstractResolvableFuture;->cancellationExceptionWithCause(Ljava/lang/String;Ljava/lang/Throwable;)Ljava/util/concurrent/CancellationException;
move-result-object p1
throw p1
.end method
.method public static getFutureValue(Lf/h/b/a/a/a;)Ljava/lang/Object;
.locals 5
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lf/h/b/a/a/a<",
"*>;)",
"Ljava/lang/Object;"
}
.end annotation
instance-of v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;
const/4 v1, 0x0
if-eqz v0, :cond_2
check-cast p0, Landroidx/concurrent/futures/AbstractResolvableFuture;
iget-object p0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->value:Ljava/lang/Object;
instance-of v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;
if-eqz v0, :cond_1
move-object v0, p0
check-cast v0, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;
iget-boolean v2, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;->wasInterrupted:Z
if-eqz v2, :cond_1
iget-object p0, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;->cause:Ljava/lang/Throwable;
if-eqz p0, :cond_0
new-instance p0, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;
iget-object v0, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;->cause:Ljava/lang/Throwable;
invoke-direct {p0, v1, v0}, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;-><init>(ZLjava/lang/Throwable;)V
goto :goto_0
:cond_0
sget-object p0, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;->CAUSELESS_CANCELLED:Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;
:cond_1
:goto_0
return-object p0
:cond_2
invoke-interface {p0}, Ljava/util/concurrent/Future;->isCancelled()Z
move-result v0
sget-boolean v2, Landroidx/concurrent/futures/AbstractResolvableFuture;->GENERATE_CANCELLATION_CAUSES:Z
xor-int/lit8 v2, v2, 0x1
and-int/2addr v2, v0
if-eqz v2, :cond_3
sget-object p0, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;->CAUSELESS_CANCELLED:Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;
return-object p0
:cond_3
:try_start_0
invoke-static {p0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->getUninterruptibly(Ljava/util/concurrent/Future;)Ljava/lang/Object;
move-result-object v2
if-nez v2, :cond_4
sget-object v2, Landroidx/concurrent/futures/AbstractResolvableFuture;->NULL:Ljava/lang/Object;
:try_end_0
.catch Ljava/util/concurrent/ExecutionException; {:try_start_0 .. :try_end_0} :catch_1
.catch Ljava/util/concurrent/CancellationException; {:try_start_0 .. :try_end_0} :catch_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
:cond_4
return-object v2
:catchall_0
move-exception p0
new-instance v0, Landroidx/concurrent/futures/AbstractResolvableFuture$Failure;
invoke-direct {v0, p0}, Landroidx/concurrent/futures/AbstractResolvableFuture$Failure;-><init>(Ljava/lang/Throwable;)V
return-object v0
:catch_0
move-exception v2
if-nez v0, :cond_5
new-instance v0, Landroidx/concurrent/futures/AbstractResolvableFuture$Failure;
new-instance v1, Ljava/lang/IllegalArgumentException;
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "get() threw CancellationException, despite reporting isCancelled() == false: "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
invoke-direct {v1, p0, v2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
invoke-direct {v0, v1}, Landroidx/concurrent/futures/AbstractResolvableFuture$Failure;-><init>(Ljava/lang/Throwable;)V
return-object v0
:cond_5
new-instance p0, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;
invoke-direct {p0, v1, v2}, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;-><init>(ZLjava/lang/Throwable;)V
return-object p0
:catch_1
move-exception p0
new-instance v0, Landroidx/concurrent/futures/AbstractResolvableFuture$Failure;
invoke-virtual {p0}, Ljava/util/concurrent/ExecutionException;->getCause()Ljava/lang/Throwable;
move-result-object p0
invoke-direct {v0, p0}, Landroidx/concurrent/futures/AbstractResolvableFuture$Failure;-><init>(Ljava/lang/Throwable;)V
return-object v0
.end method
.method public static getUninterruptibly(Ljava/util/concurrent/Future;)Ljava/lang/Object;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"<V:",
"Ljava/lang/Object;",
">(",
"Ljava/util/concurrent/Future<",
"TV;>;)TV;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/util/concurrent/ExecutionException;
}
.end annotation
const/4 v0, 0x0
:goto_0
:try_start_0
invoke-interface {p0}, Ljava/util/concurrent/Future;->get()Ljava/lang/Object;
move-result-object p0
:try_end_0
.catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-eqz v0, :cond_0
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Thread;->interrupt()V
:cond_0
return-object p0
:catchall_0
move-exception p0
if-eqz v0, :cond_1
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Thread;->interrupt()V
:cond_1
throw p0
:catch_0
const/4 v0, 0x1
goto :goto_0
.end method
.method private releaseWaiters()V
.locals 3
:cond_0
iget-object v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->waiters:Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;
sget-object v1, Landroidx/concurrent/futures/AbstractResolvableFuture;->ATOMIC_HELPER:Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;
sget-object v2, Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;->TOMBSTONE:Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;
invoke-virtual {v1, p0, v0, v2}, Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;->casWaiters(Landroidx/concurrent/futures/AbstractResolvableFuture;Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;)Z
move-result v1
if-eqz v1, :cond_0
:goto_0
if-eqz v0, :cond_1
invoke-virtual {v0}, Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;->unpark()V
iget-object v0, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;->next:Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;
goto :goto_0
:cond_1
return-void
.end method
.method private removeWaiter(Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;)V
.locals 4
const/4 v0, 0x0
iput-object v0, p1, Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;->thread:Ljava/lang/Thread;
:goto_0
iget-object p1, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->waiters:Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;
sget-object v1, Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;->TOMBSTONE:Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;
if-ne p1, v1, :cond_0
return-void
:cond_0
move-object v1, v0
:goto_1
if-eqz p1, :cond_4
iget-object v2, p1, Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;->next:Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;
iget-object v3, p1, Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;->thread:Ljava/lang/Thread;
if-eqz v3, :cond_1
move-object v1, p1
goto :goto_2
:cond_1
if-eqz v1, :cond_2
iput-object v2, v1, Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;->next:Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;
iget-object p1, v1, Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;->thread:Ljava/lang/Thread;
if-nez p1, :cond_3
goto :goto_0
:cond_2
sget-object v3, Landroidx/concurrent/futures/AbstractResolvableFuture;->ATOMIC_HELPER:Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;
invoke-virtual {v3, p0, p1, v2}, Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;->casWaiters(Landroidx/concurrent/futures/AbstractResolvableFuture;Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;)Z
move-result p1
if-nez p1, :cond_3
goto :goto_0
:cond_3
:goto_2
move-object p1, v2
goto :goto_1
:cond_4
return-void
.end method
.method private userObjectToString(Ljava/lang/Object;)Ljava/lang/String;
.locals 0
if-ne p1, p0, :cond_0
const-string p1, "this future"
return-object p1
:cond_0
invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object p1
return-object p1
.end method
# virtual methods
.method public final addListener(Ljava/lang/Runnable;Ljava/util/concurrent/Executor;)V
.locals 3
invoke-static {p1}, Landroidx/concurrent/futures/AbstractResolvableFuture;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
invoke-static {p2}, Landroidx/concurrent/futures/AbstractResolvableFuture;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
iget-object v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->listeners:Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;
sget-object v1, Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;->TOMBSTONE:Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;
if-eq v0, v1, :cond_2
new-instance v1, Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;
invoke-direct {v1, p1, p2}, Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;-><init>(Ljava/lang/Runnable;Ljava/util/concurrent/Executor;)V
:cond_0
iput-object v0, v1, Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;->next:Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;
sget-object v2, Landroidx/concurrent/futures/AbstractResolvableFuture;->ATOMIC_HELPER:Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;
invoke-virtual {v2, p0, v0, v1}, Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;->casListeners(Landroidx/concurrent/futures/AbstractResolvableFuture;Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;)Z
move-result v0
if-eqz v0, :cond_1
return-void
:cond_1
iget-object v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->listeners:Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;
sget-object v2, Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;->TOMBSTONE:Landroidx/concurrent/futures/AbstractResolvableFuture$Listener;
if-ne v0, v2, :cond_0
:cond_2
invoke-static {p1, p2}, Landroidx/concurrent/futures/AbstractResolvableFuture;->executeListener(Ljava/lang/Runnable;Ljava/util/concurrent/Executor;)V
return-void
.end method
.method public afterDone()V
.locals 0
return-void
.end method
.method public final cancel(Z)Z
.locals 7
iget-object v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->value:Ljava/lang/Object;
const/4 v1, 0x1
const/4 v2, 0x0
if-nez v0, :cond_0
const/4 v3, 0x1
goto :goto_0
:cond_0
const/4 v3, 0x0
:goto_0
instance-of v4, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;
or-int/2addr v3, v4
if-eqz v3, :cond_8
sget-boolean v3, Landroidx/concurrent/futures/AbstractResolvableFuture;->GENERATE_CANCELLATION_CAUSES:Z
if-eqz v3, :cond_1
new-instance v3, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;
new-instance v4, Ljava/util/concurrent/CancellationException;
const-string v5, "Future.cancel() was called."
invoke-direct {v4, v5}, Ljava/util/concurrent/CancellationException;-><init>(Ljava/lang/String;)V
invoke-direct {v3, p1, v4}, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;-><init>(ZLjava/lang/Throwable;)V
goto :goto_1
:cond_1
if-eqz p1, :cond_2
sget-object v3, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;->CAUSELESS_INTERRUPTED:Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;
goto :goto_1
:cond_2
sget-object v3, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;->CAUSELESS_CANCELLED:Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;
:goto_1
const/4 v5, 0x0
move-object v4, p0
:cond_3
:goto_2
sget-object v6, Landroidx/concurrent/futures/AbstractResolvableFuture;->ATOMIC_HELPER:Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;
invoke-virtual {v6, v4, v0, v3}, Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;->casValue(Landroidx/concurrent/futures/AbstractResolvableFuture;Ljava/lang/Object;Ljava/lang/Object;)Z
move-result v6
if-eqz v6, :cond_7
if-eqz p1, :cond_4
invoke-virtual {v4}, Landroidx/concurrent/futures/AbstractResolvableFuture;->interruptTask()V
:cond_4
invoke-static {v4}, Landroidx/concurrent/futures/AbstractResolvableFuture;->complete(Landroidx/concurrent/futures/AbstractResolvableFuture;)V
instance-of v4, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;
if-eqz v4, :cond_9
check-cast v0, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;
iget-object v0, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;->future:Lf/h/b/a/a/a;
instance-of v4, v0, Landroidx/concurrent/futures/AbstractResolvableFuture;
if-eqz v4, :cond_6
move-object v4, v0
check-cast v4, Landroidx/concurrent/futures/AbstractResolvableFuture;
iget-object v0, v4, Landroidx/concurrent/futures/AbstractResolvableFuture;->value:Ljava/lang/Object;
if-nez v0, :cond_5
const/4 v5, 0x1
goto :goto_3
:cond_5
const/4 v5, 0x0
:goto_3
instance-of v6, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;
or-int/2addr v5, v6
if-eqz v5, :cond_9
const/4 v5, 0x1
goto :goto_2
:cond_6
invoke-interface {v0, p1}, Ljava/util/concurrent/Future;->cancel(Z)Z
goto :goto_4
:cond_7
iget-object v0, v4, Landroidx/concurrent/futures/AbstractResolvableFuture;->value:Ljava/lang/Object;
instance-of v6, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;
if-nez v6, :cond_3
move v1, v5
goto :goto_4
:cond_8
const/4 v1, 0x0
:cond_9
:goto_4
return v1
.end method
.method public final get()Ljava/lang/Object;
.locals 6
.annotation system Ldalvik/annotation/Signature;
value = {
"()TV;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/InterruptedException;,
Ljava/util/concurrent/ExecutionException;
}
.end annotation
invoke-static {}, Ljava/lang/Thread;->interrupted()Z
move-result v0
if-nez v0, :cond_8
iget-object v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->value:Ljava/lang/Object;
const/4 v1, 0x0
const/4 v2, 0x1
if-eqz v0, :cond_0
const/4 v3, 0x1
goto :goto_0
:cond_0
const/4 v3, 0x0
:goto_0
instance-of v4, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;
xor-int/2addr v4, v2
and-int/2addr v3, v4
if-eqz v3, :cond_1
invoke-direct {p0, v0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->getDoneValue(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
return-object v0
:cond_1
iget-object v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->waiters:Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;
sget-object v3, Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;->TOMBSTONE:Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;
if-eq v0, v3, :cond_7
new-instance v3, Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;
invoke-direct {v3}, Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;-><init>()V
:cond_2
invoke-virtual {v3, v0}, Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;->setNext(Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;)V
sget-object v4, Landroidx/concurrent/futures/AbstractResolvableFuture;->ATOMIC_HELPER:Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;
invoke-virtual {v4, p0, v0, v3}, Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;->casWaiters(Landroidx/concurrent/futures/AbstractResolvableFuture;Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;)Z
move-result v0
if-eqz v0, :cond_6
:cond_3
invoke-static {p0}, Ljava/util/concurrent/locks/LockSupport;->park(Ljava/lang/Object;)V
invoke-static {}, Ljava/lang/Thread;->interrupted()Z
move-result v0
if-nez v0, :cond_5
iget-object v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->value:Ljava/lang/Object;
if-eqz v0, :cond_4
const/4 v4, 0x1
goto :goto_1
:cond_4
const/4 v4, 0x0
:goto_1
instance-of v5, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;
xor-int/2addr v5, v2
and-int/2addr v4, v5
if-eqz v4, :cond_3
invoke-direct {p0, v0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->getDoneValue(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
return-object v0
:cond_5
invoke-direct {p0, v3}, Landroidx/concurrent/futures/AbstractResolvableFuture;->removeWaiter(Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;)V
new-instance v0, Ljava/lang/InterruptedException;
invoke-direct {v0}, Ljava/lang/InterruptedException;-><init>()V
throw v0
:cond_6
iget-object v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->waiters:Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;
sget-object v4, Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;->TOMBSTONE:Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;
if-ne v0, v4, :cond_2
:cond_7
iget-object v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->value:Ljava/lang/Object;
invoke-direct {p0, v0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->getDoneValue(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
return-object v0
:cond_8
new-instance v0, Ljava/lang/InterruptedException;
invoke-direct {v0}, Ljava/lang/InterruptedException;-><init>()V
throw v0
.end method
.method public final get(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;
.locals 12
.annotation system Ldalvik/annotation/Signature;
value = {
"(J",
"Ljava/util/concurrent/TimeUnit;",
")TV;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/InterruptedException;,
Ljava/util/concurrent/TimeoutException;,
Ljava/util/concurrent/ExecutionException;
}
.end annotation
invoke-virtual {p3, p1, p2}, Ljava/util/concurrent/TimeUnit;->toNanos(J)J
move-result-wide v0
invoke-static {}, Ljava/lang/Thread;->interrupted()Z
move-result v2
if-nez v2, :cond_16
iget-object v2, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->value:Ljava/lang/Object;
if-eqz v2, :cond_0
const/4 v3, 0x1
goto :goto_0
:cond_0
const/4 v3, 0x0
:goto_0
instance-of v4, v2, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;
xor-int/lit8 v4, v4, 0x1
and-int/2addr v3, v4
if-eqz v3, :cond_1
invoke-direct {p0, v2}, Landroidx/concurrent/futures/AbstractResolvableFuture;->getDoneValue(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p1
return-object p1
:cond_1
const-wide/16 v2, 0x0
cmp-long v4, v0, v2
if-lez v4, :cond_2
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide v4
add-long/2addr v4, v0
goto :goto_1
:cond_2
move-wide v4, v2
:goto_1
const-wide/16 v6, 0x3e8
cmp-long v8, v0, v6
if-ltz v8, :cond_a
iget-object v8, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->waiters:Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;
sget-object v9, Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;->TOMBSTONE:Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;
if-eq v8, v9, :cond_9
new-instance v9, Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;
invoke-direct {v9}, Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;-><init>()V
:cond_3
invoke-virtual {v9, v8}, Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;->setNext(Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;)V
sget-object v10, Landroidx/concurrent/futures/AbstractResolvableFuture;->ATOMIC_HELPER:Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;
invoke-virtual {v10, p0, v8, v9}, Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;->casWaiters(Landroidx/concurrent/futures/AbstractResolvableFuture;Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;)Z
move-result v8
if-eqz v8, :cond_8
:cond_4
invoke-static {p0, v0, v1}, Ljava/util/concurrent/locks/LockSupport;->parkNanos(Ljava/lang/Object;J)V
invoke-static {}, Ljava/lang/Thread;->interrupted()Z
move-result v0
if-nez v0, :cond_7
iget-object v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->value:Ljava/lang/Object;
if-eqz v0, :cond_5
const/4 v1, 0x1
goto :goto_2
:cond_5
const/4 v1, 0x0
:goto_2
instance-of v8, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;
xor-int/lit8 v8, v8, 0x1
and-int/2addr v1, v8
if-eqz v1, :cond_6
invoke-direct {p0, v0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->getDoneValue(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p1
return-object p1
:cond_6
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide v0
sub-long v0, v4, v0
cmp-long v8, v0, v6
if-gez v8, :cond_4
invoke-direct {p0, v9}, Landroidx/concurrent/futures/AbstractResolvableFuture;->removeWaiter(Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;)V
goto :goto_3
:cond_7
invoke-direct {p0, v9}, Landroidx/concurrent/futures/AbstractResolvableFuture;->removeWaiter(Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;)V
new-instance p1, Ljava/lang/InterruptedException;
invoke-direct {p1}, Ljava/lang/InterruptedException;-><init>()V
throw p1
:cond_8
iget-object v8, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->waiters:Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;
sget-object v10, Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;->TOMBSTONE:Landroidx/concurrent/futures/AbstractResolvableFuture$Waiter;
if-ne v8, v10, :cond_3
:cond_9
iget-object p1, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->value:Ljava/lang/Object;
invoke-direct {p0, p1}, Landroidx/concurrent/futures/AbstractResolvableFuture;->getDoneValue(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p1
return-object p1
:cond_a
:goto_3
cmp-long v8, v0, v2
if-lez v8, :cond_e
iget-object v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->value:Ljava/lang/Object;
if-eqz v0, :cond_b
const/4 v1, 0x1
goto :goto_4
:cond_b
const/4 v1, 0x0
:goto_4
instance-of v8, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;
xor-int/lit8 v8, v8, 0x1
and-int/2addr v1, v8
if-eqz v1, :cond_c
invoke-direct {p0, v0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->getDoneValue(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p1
return-object p1
:cond_c
invoke-static {}, Ljava/lang/Thread;->interrupted()Z
move-result v0
if-nez v0, :cond_d
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide v0
sub-long v0, v4, v0
goto :goto_3
:cond_d
new-instance p1, Ljava/lang/InterruptedException;
invoke-direct {p1}, Ljava/lang/InterruptedException;-><init>()V
throw p1
:cond_e
invoke-virtual {p0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->toString()Ljava/lang/String;
move-result-object v4
invoke-virtual {p3}, Ljava/util/concurrent/TimeUnit;->toString()Ljava/lang/String;
move-result-object v5
sget-object v8, Ljava/util/Locale;->ROOT:Ljava/util/Locale;
invoke-virtual {v5, v8}, Ljava/lang/String;->toLowerCase(Ljava/util/Locale;)Ljava/lang/String;
move-result-object v5
const-string v8, "Waited "
const-string v9, " "
invoke-static {v8, p1, p2, v9}, Lf/e/b/a/a;->H(Ljava/lang/String;JLjava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p1
invoke-virtual {p3}, Ljava/util/concurrent/TimeUnit;->toString()Ljava/lang/String;
move-result-object p2
sget-object v8, Ljava/util/Locale;->ROOT:Ljava/util/Locale;
invoke-virtual {p2, v8}, Ljava/lang/String;->toLowerCase(Ljava/util/Locale;)Ljava/lang/String;
move-result-object p2
invoke-virtual {p1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
add-long v10, v0, v6
cmp-long p2, v10, v2
if-gez p2, :cond_14
const-string p2, " (plus "
invoke-static {p1, p2}, Lf/e/b/a/a;->q(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
neg-long v0, v0
sget-object p2, Ljava/util/concurrent/TimeUnit;->NANOSECONDS:Ljava/util/concurrent/TimeUnit;
invoke-virtual {p3, v0, v1, p2}, Ljava/util/concurrent/TimeUnit;->convert(JLjava/util/concurrent/TimeUnit;)J
move-result-wide v10
invoke-virtual {p3, v10, v11}, Ljava/util/concurrent/TimeUnit;->toNanos(J)J
move-result-wide p2
sub-long/2addr v0, p2
cmp-long p2, v10, v2
if-eqz p2, :cond_10
cmp-long p3, v0, v6
if-lez p3, :cond_f
goto :goto_5
:cond_f
const/4 p3, 0x0
goto :goto_6
:cond_10
:goto_5
const/4 p3, 0x1
:goto_6
if-lez p2, :cond_12
new-instance p2, Ljava/lang/StringBuilder;
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2, v10, v11}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
invoke-virtual {p2, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
if-eqz p3, :cond_11
const-string p2, ","
invoke-static {p1, p2}, Lf/e/b/a/a;->q(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
:cond_11
invoke-static {p1, v9}, Lf/e/b/a/a;->q(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
:cond_12
if-eqz p3, :cond_13
const-string p2, " nanoseconds "
invoke-static {p1, v0, v1, p2}, Lf/e/b/a/a;->o(Ljava/lang/String;JLjava/lang/String;)Ljava/lang/String;
move-result-object p1
:cond_13
const-string p2, "delay)"
invoke-static {p1, p2}, Lf/e/b/a/a;->q(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
:cond_14
invoke-virtual {p0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->isDone()Z
move-result p2
if-eqz p2, :cond_15
new-instance p2, Ljava/util/concurrent/TimeoutException;
const-string p3, " but future completed as timeout expired"
invoke-static {p1, p3}, Lf/e/b/a/a;->q(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
invoke-direct {p2, p1}, Ljava/util/concurrent/TimeoutException;-><init>(Ljava/lang/String;)V
throw p2
:cond_15
new-instance p2, Ljava/util/concurrent/TimeoutException;
const-string p3, " for "
invoke-static {p1, p3, v4}, Lf/e/b/a/a;->r(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
invoke-direct {p2, p1}, Ljava/util/concurrent/TimeoutException;-><init>(Ljava/lang/String;)V
throw p2
:cond_16
new-instance p1, Ljava/lang/InterruptedException;
invoke-direct {p1}, Ljava/lang/InterruptedException;-><init>()V
throw p1
.end method
.method public interruptTask()V
.locals 0
return-void
.end method
.method public final isCancelled()Z
.locals 1
iget-object v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->value:Ljava/lang/Object;
instance-of v0, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;
return v0
.end method
.method public final isDone()Z
.locals 3
iget-object v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->value:Ljava/lang/Object;
const/4 v1, 0x1
if-eqz v0, :cond_0
const/4 v2, 0x1
goto :goto_0
:cond_0
const/4 v2, 0x0
:goto_0
instance-of v0, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;
xor-int/2addr v0, v1
and-int/2addr v0, v2
return v0
.end method
.method public final maybePropagateCancellationTo(Ljava/util/concurrent/Future;)V
.locals 2
.param p1 # Ljava/util/concurrent/Future;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/concurrent/Future<",
"*>;)V"
}
.end annotation
if-eqz p1, :cond_0
const/4 v0, 0x1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
invoke-virtual {p0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->isCancelled()Z
move-result v1
and-int/2addr v0, v1
if-eqz v0, :cond_1
invoke-virtual {p0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->wasInterrupted()Z
move-result v0
invoke-interface {p1, v0}, Ljava/util/concurrent/Future;->cancel(Z)Z
:cond_1
return-void
.end method
.method public pendingToString()Ljava/lang/String;
.locals 3
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->value:Ljava/lang/Object;
instance-of v1, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;
if-eqz v1, :cond_0
const-string v1, "setFuture=["
invoke-static {v1}, Lf/e/b/a/a;->E(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
check-cast v0, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;
iget-object v0, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;->future:Lf/h/b/a/a/a;
invoke-direct {p0, v0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->userObjectToString(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v0
const-string v2, "]"
invoke-static {v1, v0, v2}, Lf/e/b/a/a;->w(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
return-object v0
:cond_0
instance-of v0, p0, Ljava/util/concurrent/ScheduledFuture;
if-eqz v0, :cond_1
const-string v0, "remaining delay=["
invoke-static {v0}, Lf/e/b/a/a;->E(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
move-object v1, p0
check-cast v1, Ljava/util/concurrent/ScheduledFuture;
sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
invoke-interface {v1, v2}, Ljava/util/concurrent/ScheduledFuture;->getDelay(Ljava/util/concurrent/TimeUnit;)J
move-result-wide v1
invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
const-string v1, " ms]"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
:cond_1
const/4 v0, 0x0
return-object v0
.end method
.method public set(Ljava/lang/Object;)Z
.locals 2
.param p1 # Ljava/lang/Object;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.annotation system Ldalvik/annotation/Signature;
value = {
"(TV;)Z"
}
.end annotation
if-nez p1, :cond_0
sget-object p1, Landroidx/concurrent/futures/AbstractResolvableFuture;->NULL:Ljava/lang/Object;
:cond_0
sget-object v0, Landroidx/concurrent/futures/AbstractResolvableFuture;->ATOMIC_HELPER:Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;
const/4 v1, 0x0
invoke-virtual {v0, p0, v1, p1}, Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;->casValue(Landroidx/concurrent/futures/AbstractResolvableFuture;Ljava/lang/Object;Ljava/lang/Object;)Z
move-result p1
if-eqz p1, :cond_1
invoke-static {p0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->complete(Landroidx/concurrent/futures/AbstractResolvableFuture;)V
const/4 p1, 0x1
return p1
:cond_1
const/4 p1, 0x0
return p1
.end method
.method public setException(Ljava/lang/Throwable;)Z
.locals 2
new-instance v0, Landroidx/concurrent/futures/AbstractResolvableFuture$Failure;
invoke-static {p1}, Landroidx/concurrent/futures/AbstractResolvableFuture;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p1
check-cast p1, Ljava/lang/Throwable;
invoke-direct {v0, p1}, Landroidx/concurrent/futures/AbstractResolvableFuture$Failure;-><init>(Ljava/lang/Throwable;)V
sget-object p1, Landroidx/concurrent/futures/AbstractResolvableFuture;->ATOMIC_HELPER:Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;
const/4 v1, 0x0
invoke-virtual {p1, p0, v1, v0}, Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;->casValue(Landroidx/concurrent/futures/AbstractResolvableFuture;Ljava/lang/Object;Ljava/lang/Object;)Z
move-result p1
if-eqz p1, :cond_0
invoke-static {p0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->complete(Landroidx/concurrent/futures/AbstractResolvableFuture;)V
const/4 p1, 0x1
return p1
:cond_0
const/4 p1, 0x0
return p1
.end method
.method public setFuture(Lf/h/b/a/a/a;)Z
.locals 5
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lf/h/b/a/a/a<",
"+TV;>;)Z"
}
.end annotation
invoke-static {p1}, Landroidx/concurrent/futures/AbstractResolvableFuture;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
iget-object v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->value:Ljava/lang/Object;
const/4 v1, 0x0
if-nez v0, :cond_3
invoke-interface {p1}, Ljava/util/concurrent/Future;->isDone()Z
move-result v0
const/4 v2, 0x1
const/4 v3, 0x0
if-eqz v0, :cond_1
invoke-static {p1}, Landroidx/concurrent/futures/AbstractResolvableFuture;->getFutureValue(Lf/h/b/a/a/a;)Ljava/lang/Object;
move-result-object p1
sget-object v0, Landroidx/concurrent/futures/AbstractResolvableFuture;->ATOMIC_HELPER:Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;
invoke-virtual {v0, p0, v3, p1}, Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;->casValue(Landroidx/concurrent/futures/AbstractResolvableFuture;Ljava/lang/Object;Ljava/lang/Object;)Z
move-result p1
if-eqz p1, :cond_0
invoke-static {p0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->complete(Landroidx/concurrent/futures/AbstractResolvableFuture;)V
return v2
:cond_0
return v1
:cond_1
new-instance v0, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;
invoke-direct {v0, p0, p1}, Landroidx/concurrent/futures/AbstractResolvableFuture$SetFuture;-><init>(Landroidx/concurrent/futures/AbstractResolvableFuture;Lf/h/b/a/a/a;)V
sget-object v4, Landroidx/concurrent/futures/AbstractResolvableFuture;->ATOMIC_HELPER:Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;
invoke-virtual {v4, p0, v3, v0}, Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;->casValue(Landroidx/concurrent/futures/AbstractResolvableFuture;Ljava/lang/Object;Ljava/lang/Object;)Z
move-result v3
if-eqz v3, :cond_2
:try_start_0
sget-object v1, Landroidx/concurrent/futures/DirectExecutor;->INSTANCE:Landroidx/concurrent/futures/DirectExecutor;
invoke-interface {p1, v0, v1}, Lf/h/b/a/a/a;->addListener(Ljava/lang/Runnable;Ljava/util/concurrent/Executor;)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
goto :goto_1
:catchall_0
move-exception p1
:try_start_1
new-instance v1, Landroidx/concurrent/futures/AbstractResolvableFuture$Failure;
invoke-direct {v1, p1}, Landroidx/concurrent/futures/AbstractResolvableFuture$Failure;-><init>(Ljava/lang/Throwable;)V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_1
goto :goto_0
:catchall_1
sget-object v1, Landroidx/concurrent/futures/AbstractResolvableFuture$Failure;->FALLBACK_INSTANCE:Landroidx/concurrent/futures/AbstractResolvableFuture$Failure;
:goto_0
sget-object p1, Landroidx/concurrent/futures/AbstractResolvableFuture;->ATOMIC_HELPER:Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;
invoke-virtual {p1, p0, v0, v1}, Landroidx/concurrent/futures/AbstractResolvableFuture$AtomicHelper;->casValue(Landroidx/concurrent/futures/AbstractResolvableFuture;Ljava/lang/Object;Ljava/lang/Object;)Z
:goto_1
return v2
:cond_2
iget-object v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->value:Ljava/lang/Object;
:cond_3
instance-of v2, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;
if-eqz v2, :cond_4
check-cast v0, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;
iget-boolean v0, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;->wasInterrupted:Z
invoke-interface {p1, v0}, Ljava/util/concurrent/Future;->cancel(Z)Z
:cond_4
return v1
.end method
.method public toString()Ljava/lang/String;
.locals 4
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
invoke-super {p0}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, "[status="
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->isCancelled()Z
move-result v1
const-string v2, "]"
if-eqz v1, :cond_0
const-string v1, "CANCELLED"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
goto :goto_1
:cond_0
invoke-virtual {p0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->isDone()Z
move-result v1
if-eqz v1, :cond_1
invoke-direct {p0, v0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->addDoneString(Ljava/lang/StringBuilder;)V
goto :goto_1
:cond_1
:try_start_0
invoke-virtual {p0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->pendingToString()Ljava/lang/String;
move-result-object v1
:try_end_0
.catch Ljava/lang/RuntimeException; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
:catch_0
move-exception v1
const-string v3, "Exception thrown from implementation: "
invoke-static {v3}, Lf/e/b/a/a;->E(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v1
invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
:goto_0
if-eqz v1, :cond_2
invoke-virtual {v1}, Ljava/lang/String;->isEmpty()Z
move-result v3
if-nez v3, :cond_2
const-string v3, "PENDING, info=["
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
goto :goto_1
:cond_2
invoke-virtual {p0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->isDone()Z
move-result v1
if-eqz v1, :cond_3
invoke-direct {p0, v0}, Landroidx/concurrent/futures/AbstractResolvableFuture;->addDoneString(Ljava/lang/StringBuilder;)V
goto :goto_1
:cond_3
const-string v1, "PENDING"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
:goto_1
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public final wasInterrupted()Z
.locals 2
iget-object v0, p0, Landroidx/concurrent/futures/AbstractResolvableFuture;->value:Ljava/lang/Object;
instance-of v1, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;
if-eqz v1, :cond_0
check-cast v0, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;
iget-boolean v0, v0, Landroidx/concurrent/futures/AbstractResolvableFuture$Cancellation;->wasInterrupted:Z
if-eqz v0, :cond_0
const/4 v0, 0x1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
return v0
.end method