.class abstract Landroidx/loader/content/ModernAsyncTask; .super Ljava/lang/Object; .source "ModernAsyncTask.java" # annotations .annotation system Ldalvik/annotation/MemberClasses; value = { Landroidx/loader/content/ModernAsyncTask$AsyncTaskResult;, Landroidx/loader/content/ModernAsyncTask$WorkerRunnable;, Landroidx/loader/content/ModernAsyncTask$InternalHandler;, Landroidx/loader/content/ModernAsyncTask$Status; } .end annotation .annotation system Ldalvik/annotation/Signature; value = { "", "Ljava/lang/Object;" } .end annotation # static fields .field private static final CORE_POOL_SIZE:I = 0x5 .field private static final KEEP_ALIVE:I = 0x1 .field private static final LOG_TAG:Ljava/lang/String; = "AsyncTask" .field private static final MAXIMUM_POOL_SIZE:I = 0x80 .field private static final MESSAGE_POST_PROGRESS:I = 0x2 .field private static final MESSAGE_POST_RESULT:I = 0x1 .field public static final THREAD_POOL_EXECUTOR:Ljava/util/concurrent/Executor; .field private static volatile sDefaultExecutor:Ljava/util/concurrent/Executor; .field private static sHandler:Landroidx/loader/content/ModernAsyncTask$InternalHandler; .field private static final sPoolWorkQueue:Ljava/util/concurrent/BlockingQueue; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/concurrent/BlockingQueue<", "Ljava/lang/Runnable;", ">;" } .end annotation .end field .field private static final sThreadFactory:Ljava/util/concurrent/ThreadFactory; # instance fields .field final mCancelled:Ljava/util/concurrent/atomic/AtomicBoolean; .field private final mFuture:Ljava/util/concurrent/FutureTask; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/concurrent/FutureTask<", "TResult;>;" } .end annotation .end field .field private volatile mStatus:Landroidx/loader/content/ModernAsyncTask$Status; .field final mTaskInvoked:Ljava/util/concurrent/atomic/AtomicBoolean; .field private final mWorker:Landroidx/loader/content/ModernAsyncTask$WorkerRunnable; .annotation system Ldalvik/annotation/Signature; value = { "Landroidx/loader/content/ModernAsyncTask$WorkerRunnable<", "TParams;TResult;>;" } .end annotation .end field # direct methods .method static constructor ()V .locals 9 .line 60 new-instance v7, Landroidx/loader/content/ModernAsyncTask$1; invoke-direct {v7}, Landroidx/loader/content/ModernAsyncTask$1;->()V sput-object v7, Landroidx/loader/content/ModernAsyncTask;->sThreadFactory:Ljava/util/concurrent/ThreadFactory; .line 69 new-instance v6, Ljava/util/concurrent/LinkedBlockingQueue; const/16 v0, 0xa invoke-direct {v6, v0}, Ljava/util/concurrent/LinkedBlockingQueue;->(I)V sput-object v6, Landroidx/loader/content/ModernAsyncTask;->sPoolWorkQueue:Ljava/util/concurrent/BlockingQueue; .line 75 new-instance v8, Ljava/util/concurrent/ThreadPoolExecutor; const/4 v1, 0x5 const/16 v2, 0x80 const-wide/16 v3, 0x1 sget-object v5, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit; move-object v0, v8 invoke-direct/range {v0 .. v7}, Ljava/util/concurrent/ThreadPoolExecutor;->(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;)V sput-object v8, Landroidx/loader/content/ModernAsyncTask;->THREAD_POOL_EXECUTOR:Ljava/util/concurrent/Executor; sput-object v8, Landroidx/loader/content/ModernAsyncTask;->sDefaultExecutor:Ljava/util/concurrent/Executor; return-void .end method .method constructor ()V .locals 2 .line 132 invoke-direct {p0}, Ljava/lang/Object;->()V .line 88 sget-object v0, Landroidx/loader/content/ModernAsyncTask$Status;->PENDING:Landroidx/loader/content/ModernAsyncTask$Status; iput-object v0, p0, Landroidx/loader/content/ModernAsyncTask;->mStatus:Landroidx/loader/content/ModernAsyncTask$Status; .line 90 new-instance v0, Ljava/util/concurrent/atomic/AtomicBoolean; invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicBoolean;->()V iput-object v0, p0, Landroidx/loader/content/ModernAsyncTask;->mCancelled:Ljava/util/concurrent/atomic/AtomicBoolean; .line 92 new-instance v0, Ljava/util/concurrent/atomic/AtomicBoolean; invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicBoolean;->()V iput-object v0, p0, Landroidx/loader/content/ModernAsyncTask;->mTaskInvoked:Ljava/util/concurrent/atomic/AtomicBoolean; .line 133 new-instance v0, Landroidx/loader/content/ModernAsyncTask$2; invoke-direct {v0, p0}, Landroidx/loader/content/ModernAsyncTask$2;->(Landroidx/loader/content/ModernAsyncTask;)V iput-object v0, p0, Landroidx/loader/content/ModernAsyncTask;->mWorker:Landroidx/loader/content/ModernAsyncTask$WorkerRunnable; .line 153 new-instance v1, Landroidx/loader/content/ModernAsyncTask$3; invoke-direct {v1, p0, v0}, Landroidx/loader/content/ModernAsyncTask$3;->(Landroidx/loader/content/ModernAsyncTask;Ljava/util/concurrent/Callable;)V iput-object v1, p0, Landroidx/loader/content/ModernAsyncTask;->mFuture:Ljava/util/concurrent/FutureTask; return-void .end method .method public static execute(Ljava/lang/Runnable;)V .locals 1 sget-object v0, Landroidx/loader/content/ModernAsyncTask;->sDefaultExecutor:Ljava/util/concurrent/Executor; .line 462 invoke-interface {v0, p0}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V return-void .end method .method private static getHandler()Landroid/os/Handler; .locals 2 const-class v0, Landroidx/loader/content/ModernAsyncTask; .line 115 monitor-enter v0 :try_start_0 sget-object v1, Landroidx/loader/content/ModernAsyncTask;->sHandler:Landroidx/loader/content/ModernAsyncTask$InternalHandler; if-nez v1, :cond_0 .line 117 new-instance v1, Landroidx/loader/content/ModernAsyncTask$InternalHandler; invoke-direct {v1}, Landroidx/loader/content/ModernAsyncTask$InternalHandler;->()V sput-object v1, Landroidx/loader/content/ModernAsyncTask;->sHandler:Landroidx/loader/content/ModernAsyncTask$InternalHandler; :cond_0 sget-object v1, Landroidx/loader/content/ModernAsyncTask;->sHandler:Landroidx/loader/content/ModernAsyncTask$InternalHandler; .line 119 monitor-exit v0 return-object v1 :catchall_0 move-exception v1 .line 120 monitor-exit v0 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 throw v1 .end method .method public static setDefaultExecutor(Ljava/util/concurrent/Executor;)V .locals 0 sput-object p0, Landroidx/loader/content/ModernAsyncTask;->sDefaultExecutor:Ljava/util/concurrent/Executor; return-void .end method # virtual methods .method public final cancel(Z)Z .locals 2 iget-object v0, p0, Landroidx/loader/content/ModernAsyncTask;->mCancelled:Ljava/util/concurrent/atomic/AtomicBoolean; const/4 v1, 0x1 .line 332 invoke-virtual {v0, v1}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V iget-object p0, p0, Landroidx/loader/content/ModernAsyncTask;->mFuture:Ljava/util/concurrent/FutureTask; .line 333 invoke-virtual {p0, p1}, Ljava/util/concurrent/FutureTask;->cancel(Z)Z move-result p0 return p0 .end method .method protected varargs abstract doInBackground([Ljava/lang/Object;)Ljava/lang/Object; .annotation system Ldalvik/annotation/Signature; value = { "([TParams;)TResult;" } .end annotation .end method .method public final varargs execute([Ljava/lang/Object;)Landroidx/loader/content/ModernAsyncTask; .locals 1 .annotation system Ldalvik/annotation/Signature; value = { "([TParams;)", "Landroidx/loader/content/ModernAsyncTask<", "TParams;TProgress;TResult;>;" } .end annotation sget-object v0, Landroidx/loader/content/ModernAsyncTask;->sDefaultExecutor:Ljava/util/concurrent/Executor; .line 398 invoke-virtual {p0, v0, p1}, Landroidx/loader/content/ModernAsyncTask;->executeOnExecutor(Ljava/util/concurrent/Executor;[Ljava/lang/Object;)Landroidx/loader/content/ModernAsyncTask; move-result-object p0 return-object p0 .end method .method public final varargs executeOnExecutor(Ljava/util/concurrent/Executor;[Ljava/lang/Object;)Landroidx/loader/content/ModernAsyncTask; .locals 2 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/util/concurrent/Executor;", "[TParams;)", "Landroidx/loader/content/ModernAsyncTask<", "TParams;TProgress;TResult;>;" } .end annotation iget-object v0, p0, Landroidx/loader/content/ModernAsyncTask;->mStatus:Landroidx/loader/content/ModernAsyncTask$Status; .line 433 sget-object v1, Landroidx/loader/content/ModernAsyncTask$Status;->PENDING:Landroidx/loader/content/ModernAsyncTask$Status; if-eq v0, v1, :cond_2 .line 434 sget-object p1, Landroidx/loader/content/ModernAsyncTask$4;->$SwitchMap$androidx$loader$content$ModernAsyncTask$Status:[I iget-object p0, p0, Landroidx/loader/content/ModernAsyncTask;->mStatus:Landroidx/loader/content/ModernAsyncTask$Status; invoke-virtual {p0}, Landroidx/loader/content/ModernAsyncTask$Status;->ordinal()I move-result p0 aget p0, p1, p0 const/4 p1, 0x1 if-eq p0, p1, :cond_1 const/4 p1, 0x2 if-eq p0, p1, :cond_0 .line 443 new-instance p0, Ljava/lang/IllegalStateException; const-string p1, "We should never reach this state" invoke-direct {p0, p1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p0 .line 439 :cond_0 new-instance p0, Ljava/lang/IllegalStateException; const-string p1, "Cannot execute task: the task has already been executed (a task can be executed only once)" invoke-direct {p0, p1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p0 .line 436 :cond_1 new-instance p0, Ljava/lang/IllegalStateException; const-string p1, "Cannot execute task: the task is already running." invoke-direct {p0, p1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p0 .line 447 :cond_2 sget-object v0, Landroidx/loader/content/ModernAsyncTask$Status;->RUNNING:Landroidx/loader/content/ModernAsyncTask$Status; iput-object v0, p0, Landroidx/loader/content/ModernAsyncTask;->mStatus:Landroidx/loader/content/ModernAsyncTask$Status; .line 449 invoke-virtual {p0}, Landroidx/loader/content/ModernAsyncTask;->onPreExecute()V iget-object v0, p0, Landroidx/loader/content/ModernAsyncTask;->mWorker:Landroidx/loader/content/ModernAsyncTask$WorkerRunnable; .line 451 iput-object p2, v0, Landroidx/loader/content/ModernAsyncTask$WorkerRunnable;->mParams:[Ljava/lang/Object; iget-object p2, p0, Landroidx/loader/content/ModernAsyncTask;->mFuture:Ljava/util/concurrent/FutureTask; .line 452 invoke-interface {p1, p2}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V return-object p0 .end method .method finish(Ljava/lang/Object;)V .locals 1 .annotation system Ldalvik/annotation/Signature; value = { "(TResult;)V" } .end annotation .line 487 invoke-virtual {p0}, Landroidx/loader/content/ModernAsyncTask;->isCancelled()Z move-result v0 if-eqz v0, :cond_0 .line 488 invoke-virtual {p0, p1}, Landroidx/loader/content/ModernAsyncTask;->onCancelled(Ljava/lang/Object;)V goto :goto_0 .line 490 :cond_0 invoke-virtual {p0, p1}, Landroidx/loader/content/ModernAsyncTask;->onPostExecute(Ljava/lang/Object;)V .line 492 :goto_0 sget-object p1, Landroidx/loader/content/ModernAsyncTask$Status;->FINISHED:Landroidx/loader/content/ModernAsyncTask$Status; iput-object p1, p0, Landroidx/loader/content/ModernAsyncTask;->mStatus:Landroidx/loader/content/ModernAsyncTask$Status; return-void .end method .method public final get()Ljava/lang/Object; .locals 0 .annotation system Ldalvik/annotation/Signature; value = { "()TResult;" } .end annotation .annotation system Ldalvik/annotation/Throws; value = { Ljava/lang/InterruptedException;, Ljava/util/concurrent/ExecutionException; } .end annotation iget-object p0, p0, Landroidx/loader/content/ModernAsyncTask;->mFuture:Ljava/util/concurrent/FutureTask; .line 348 invoke-virtual {p0}, Ljava/util/concurrent/FutureTask;->get()Ljava/lang/Object; move-result-object p0 return-object p0 .end method .method public final get(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object; .locals 0 .annotation system Ldalvik/annotation/Signature; value = { "(J", "Ljava/util/concurrent/TimeUnit;", ")TResult;" } .end annotation .annotation system Ldalvik/annotation/Throws; value = { Ljava/lang/InterruptedException;, Ljava/util/concurrent/ExecutionException;, Ljava/util/concurrent/TimeoutException; } .end annotation iget-object p0, p0, Landroidx/loader/content/ModernAsyncTask;->mFuture:Ljava/util/concurrent/FutureTask; .line 368 invoke-virtual {p0, p1, p2, p3}, Ljava/util/concurrent/FutureTask;->get(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object; move-result-object p0 return-object p0 .end method .method public final getStatus()Landroidx/loader/content/ModernAsyncTask$Status; .locals 0 iget-object p0, p0, Landroidx/loader/content/ModernAsyncTask;->mStatus:Landroidx/loader/content/ModernAsyncTask$Status; return-object p0 .end method .method public final isCancelled()Z .locals 0 iget-object p0, p0, Landroidx/loader/content/ModernAsyncTask;->mCancelled:Ljava/util/concurrent/atomic/AtomicBoolean; .line 299 invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicBoolean;->get()Z move-result p0 return p0 .end method .method protected onCancelled()V .locals 0 return-void .end method .method protected onCancelled(Ljava/lang/Object;)V .locals 0 .annotation system Ldalvik/annotation/Signature; value = { "(TResult;)V" } .end annotation .line 270 invoke-virtual {p0}, Landroidx/loader/content/ModernAsyncTask;->onCancelled()V return-void .end method .method protected onPostExecute(Ljava/lang/Object;)V .locals 0 .annotation system Ldalvik/annotation/Signature; value = { "(TResult;)V" } .end annotation return-void .end method .method protected onPreExecute()V .locals 0 return-void .end method .method protected varargs onProgressUpdate([Ljava/lang/Object;)V .locals 0 .annotation system Ldalvik/annotation/Signature; value = { "([TProgress;)V" } .end annotation return-void .end method .method postResult(Ljava/lang/Object;)Ljava/lang/Object; .locals 3 .annotation system Ldalvik/annotation/Signature; value = { "(TResult;)TResult;" } .end annotation .line 183 invoke-static {}, Landroidx/loader/content/ModernAsyncTask;->getHandler()Landroid/os/Handler; move-result-object v0 new-instance v1, Landroidx/loader/content/ModernAsyncTask$AsyncTaskResult; filled-new-array {p1}, [Ljava/lang/Object; move-result-object v2 invoke-direct {v1, p0, v2}, Landroidx/loader/content/ModernAsyncTask$AsyncTaskResult;->(Landroidx/loader/content/ModernAsyncTask;[Ljava/lang/Object;)V const/4 p0, 0x1 invoke-virtual {v0, p0, v1}, Landroid/os/Handler;->obtainMessage(ILjava/lang/Object;)Landroid/os/Message; move-result-object p0 .line 185 invoke-virtual {p0}, Landroid/os/Message;->sendToTarget()V return-object p1 .end method .method postResultIfNotInvoked(Ljava/lang/Object;)V .locals 1 .annotation system Ldalvik/annotation/Signature; value = { "(TResult;)V" } .end annotation iget-object v0, p0, Landroidx/loader/content/ModernAsyncTask;->mTaskInvoked:Ljava/util/concurrent/atomic/AtomicBoolean; .line 176 invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicBoolean;->get()Z move-result v0 if-nez v0, :cond_0 .line 178 invoke-virtual {p0, p1}, Landroidx/loader/content/ModernAsyncTask;->postResult(Ljava/lang/Object;)Ljava/lang/Object; :cond_0 return-void .end method .method protected final varargs publishProgress([Ljava/lang/Object;)V .locals 2 .annotation system Ldalvik/annotation/Signature; value = { "([TProgress;)V" } .end annotation .line 480 invoke-virtual {p0}, Landroidx/loader/content/ModernAsyncTask;->isCancelled()Z move-result v0 if-nez v0, :cond_0 .line 481 invoke-static {}, Landroidx/loader/content/ModernAsyncTask;->getHandler()Landroid/os/Handler; move-result-object v0 new-instance v1, Landroidx/loader/content/ModernAsyncTask$AsyncTaskResult; invoke-direct {v1, p0, p1}, Landroidx/loader/content/ModernAsyncTask$AsyncTaskResult;->(Landroidx/loader/content/ModernAsyncTask;[Ljava/lang/Object;)V const/4 p0, 0x2 invoke-virtual {v0, p0, v1}, Landroid/os/Handler;->obtainMessage(ILjava/lang/Object;)Landroid/os/Message; move-result-object p0 .line 482 invoke-virtual {p0}, Landroid/os/Message;->sendToTarget()V :cond_0 return-void .end method