1842 lines
58 KiB
Smali
1842 lines
58 KiB
Smali
.class public Landroidx/work/impl/WorkerWrapper;
|
|
.super Ljava/lang/Object;
|
|
.source "WorkerWrapper.java"
|
|
|
|
# interfaces
|
|
.implements Ljava/lang/Runnable;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Landroidx/work/impl/WorkerWrapper$Builder;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field static final TAG:Ljava/lang/String;
|
|
|
|
|
|
# instance fields
|
|
.field private mAppContext:Landroid/content/Context;
|
|
|
|
.field private mConfiguration:Landroidx/work/Configuration;
|
|
|
|
.field private mDependencyDao:Landroidx/work/impl/model/DependencyDao;
|
|
|
|
.field private mFuture:Landroidx/work/impl/utils/futures/SettableFuture;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Landroidx/work/impl/utils/futures/SettableFuture<",
|
|
"Ljava/lang/Boolean;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field mInnerFuture:Lcom/google/a/a/a/a;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lcom/google/a/a/a/a<",
|
|
"Landroidx/work/ListenableWorker$Result;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private volatile mInterrupted:Z
|
|
|
|
.field mResult:Landroidx/work/ListenableWorker$Result;
|
|
|
|
.field private mRuntimeExtras:Landroidx/work/WorkerParameters$RuntimeExtras;
|
|
|
|
.field private mSchedulers:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Landroidx/work/impl/Scheduler;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private mTags:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Ljava/lang/String;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
.field private mWorkDescription:Ljava/lang/String;
|
|
|
|
.field mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
.field private mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
.field private mWorkSpecId:Ljava/lang/String;
|
|
|
|
.field private mWorkTagDao:Landroidx/work/impl/model/WorkTagDao;
|
|
|
|
.field private mWorkTaskExecutor:Landroidx/work/impl/utils/taskexecutor/TaskExecutor;
|
|
|
|
.field mWorker:Landroidx/work/ListenableWorker;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
const-string v0, "WorkerWrapper"
|
|
|
|
invoke-static {v0}, Landroidx/work/Logger;->tagWithPrefix(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Landroidx/work/impl/WorkerWrapper;->TAG:Ljava/lang/String;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method constructor <init>(Landroidx/work/impl/WorkerWrapper$Builder;)V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
invoke-static {}, Landroidx/work/ListenableWorker$Result;->failure()Landroidx/work/ListenableWorker$Result;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mResult:Landroidx/work/ListenableWorker$Result;
|
|
|
|
invoke-static {}, Landroidx/work/impl/utils/futures/SettableFuture;->create()Landroidx/work/impl/utils/futures/SettableFuture;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mFuture:Landroidx/work/impl/utils/futures/SettableFuture;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mInnerFuture:Lcom/google/a/a/a/a;
|
|
|
|
iget-object v0, p1, Landroidx/work/impl/WorkerWrapper$Builder;->mAppContext:Landroid/content/Context;
|
|
|
|
iput-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mAppContext:Landroid/content/Context;
|
|
|
|
iget-object v0, p1, Landroidx/work/impl/WorkerWrapper$Builder;->mWorkTaskExecutor:Landroidx/work/impl/utils/taskexecutor/TaskExecutor;
|
|
|
|
iput-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkTaskExecutor:Landroidx/work/impl/utils/taskexecutor/TaskExecutor;
|
|
|
|
iget-object v0, p1, Landroidx/work/impl/WorkerWrapper$Builder;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
iput-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
iget-object v0, p1, Landroidx/work/impl/WorkerWrapper$Builder;->mSchedulers:Ljava/util/List;
|
|
|
|
iput-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mSchedulers:Ljava/util/List;
|
|
|
|
iget-object v0, p1, Landroidx/work/impl/WorkerWrapper$Builder;->mRuntimeExtras:Landroidx/work/WorkerParameters$RuntimeExtras;
|
|
|
|
iput-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mRuntimeExtras:Landroidx/work/WorkerParameters$RuntimeExtras;
|
|
|
|
iget-object v0, p1, Landroidx/work/impl/WorkerWrapper$Builder;->mWorker:Landroidx/work/ListenableWorker;
|
|
|
|
iput-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorker:Landroidx/work/ListenableWorker;
|
|
|
|
iget-object v0, p1, Landroidx/work/impl/WorkerWrapper$Builder;->mConfiguration:Landroidx/work/Configuration;
|
|
|
|
iput-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mConfiguration:Landroidx/work/Configuration;
|
|
|
|
iget-object p1, p1, Landroidx/work/impl/WorkerWrapper$Builder;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
iput-object p1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
iget-object p1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {p1}, Landroidx/work/impl/WorkDatabase;->workSpecDao()Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
iget-object p1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {p1}, Landroidx/work/impl/WorkDatabase;->dependencyDao()Landroidx/work/impl/model/DependencyDao;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Landroidx/work/impl/WorkerWrapper;->mDependencyDao:Landroidx/work/impl/model/DependencyDao;
|
|
|
|
iget-object p1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {p1}, Landroidx/work/impl/WorkDatabase;->workTagDao()Landroidx/work/impl/model/WorkTagDao;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkTagDao:Landroidx/work/impl/model/WorkTagDao;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private assertBackgroundExecutorThread()V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkTaskExecutor:Landroidx/work/impl/utils/taskexecutor/TaskExecutor;
|
|
|
|
invoke-interface {v0}, Landroidx/work/impl/utils/taskexecutor/TaskExecutor;->getBackgroundExecutorThread()Ljava/lang/Thread;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
|
|
|
|
move-result-object v1
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v1, "Needs to be executed on the Background executor thread."
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method private createWorkDescription(Ljava/util/List;)Ljava/lang/String;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List<",
|
|
"Ljava/lang/String;",
|
|
">;)",
|
|
"Ljava/lang/String;"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "Work [ id="
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, ", tags={ "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 v1, 0x1
|
|
|
|
:goto_0
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/lang/String;
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
const-string v3, ", "
|
|
|
|
invoke-virtual {v0, v3}, 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;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const-string p1, " } ]"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private handleResult(Landroidx/work/ListenableWorker$Result;)V
|
|
.locals 4
|
|
|
|
instance-of v0, p1, Landroidx/work/ListenableWorker$Result$Success;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-static {}, Landroidx/work/Logger;->get()Landroidx/work/Logger;
|
|
|
|
move-result-object p1
|
|
|
|
sget-object v0, Landroidx/work/impl/WorkerWrapper;->TAG:Ljava/lang/String;
|
|
|
|
new-array v1, v1, [Ljava/lang/Object;
|
|
|
|
iget-object v3, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDescription:Ljava/lang/String;
|
|
|
|
aput-object v3, v1, v2
|
|
|
|
const-string v3, "Worker result SUCCESS for %s"
|
|
|
|
invoke-static {v3, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
new-array v2, v2, [Ljava/lang/Throwable;
|
|
|
|
invoke-virtual {p1, v0, v1, v2}, Landroidx/work/Logger;->info(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
|
|
|
iget-object p1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
invoke-virtual {p1}, Landroidx/work/impl/model/WorkSpec;->isPeriodic()Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-direct {p0}, Landroidx/work/impl/WorkerWrapper;->resetPeriodicAndResolve()V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
invoke-direct {p0}, Landroidx/work/impl/WorkerWrapper;->setSucceededAndResolve()V
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
instance-of p1, p1, Landroidx/work/ListenableWorker$Result$Retry;
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
invoke-static {}, Landroidx/work/Logger;->get()Landroidx/work/Logger;
|
|
|
|
move-result-object p1
|
|
|
|
sget-object v0, Landroidx/work/impl/WorkerWrapper;->TAG:Ljava/lang/String;
|
|
|
|
new-array v1, v1, [Ljava/lang/Object;
|
|
|
|
iget-object v3, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDescription:Ljava/lang/String;
|
|
|
|
aput-object v3, v1, v2
|
|
|
|
const-string v3, "Worker result RETRY for %s"
|
|
|
|
invoke-static {v3, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
new-array v2, v2, [Ljava/lang/Throwable;
|
|
|
|
invoke-virtual {p1, v0, v1, v2}, Landroidx/work/Logger;->info(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
|
|
|
invoke-direct {p0}, Landroidx/work/impl/WorkerWrapper;->rescheduleAndResolve()V
|
|
|
|
return-void
|
|
|
|
:cond_2
|
|
invoke-static {}, Landroidx/work/Logger;->get()Landroidx/work/Logger;
|
|
|
|
move-result-object p1
|
|
|
|
sget-object v0, Landroidx/work/impl/WorkerWrapper;->TAG:Ljava/lang/String;
|
|
|
|
new-array v1, v1, [Ljava/lang/Object;
|
|
|
|
iget-object v3, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDescription:Ljava/lang/String;
|
|
|
|
aput-object v3, v1, v2
|
|
|
|
const-string v3, "Worker result FAILURE for %s"
|
|
|
|
invoke-static {v3, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
new-array v2, v2, [Ljava/lang/Throwable;
|
|
|
|
invoke-virtual {p1, v0, v1, v2}, Landroidx/work/Logger;->info(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
|
|
|
iget-object p1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
invoke-virtual {p1}, Landroidx/work/impl/model/WorkSpec;->isPeriodic()Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
invoke-direct {p0}, Landroidx/work/impl/WorkerWrapper;->resetPeriodicAndResolve()V
|
|
|
|
return-void
|
|
|
|
:cond_3
|
|
invoke-virtual {p0}, Landroidx/work/impl/WorkerWrapper;->setFailedAndResolve()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private iterativelyFailWorkAndDependents(Ljava/lang/String;)V
|
|
.locals 5
|
|
|
|
new-instance v0, Ljava/util/LinkedList;
|
|
|
|
invoke-direct {v0}, Ljava/util/LinkedList;-><init>()V
|
|
|
|
invoke-virtual {v0, p1}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z
|
|
|
|
:goto_0
|
|
invoke-virtual {v0}, Ljava/util/LinkedList;->isEmpty()Z
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_1
|
|
|
|
invoke-virtual {v0}, Ljava/util/LinkedList;->remove()Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Ljava/lang/String;
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
invoke-interface {v1, p1}, Landroidx/work/impl/model/WorkSpecDao;->getState(Ljava/lang/String;)Landroidx/work/WorkInfo$State;
|
|
|
|
move-result-object v1
|
|
|
|
sget-object v2, Landroidx/work/WorkInfo$State;->CANCELLED:Landroidx/work/WorkInfo$State;
|
|
|
|
if-eq v1, v2, :cond_0
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
sget-object v2, Landroidx/work/WorkInfo$State;->FAILED:Landroidx/work/WorkInfo$State;
|
|
|
|
const/4 v3, 0x1
|
|
|
|
new-array v3, v3, [Ljava/lang/String;
|
|
|
|
const/4 v4, 0x0
|
|
|
|
aput-object p1, v3, v4
|
|
|
|
invoke-interface {v1, v2, v3}, Landroidx/work/impl/model/WorkSpecDao;->setState(Landroidx/work/WorkInfo$State;[Ljava/lang/String;)I
|
|
|
|
:cond_0
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mDependencyDao:Landroidx/work/impl/model/DependencyDao;
|
|
|
|
invoke-interface {v1, p1}, Landroidx/work/impl/model/DependencyDao;->getDependentWorkIds(Ljava/lang/String;)Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0, p1}, Ljava/util/LinkedList;->addAll(Ljava/util/Collection;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method private rescheduleAndResolve()V
|
|
.locals 6
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->beginTransaction()V
|
|
|
|
const/4 v0, 0x1
|
|
|
|
:try_start_0
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
sget-object v2, Landroidx/work/WorkInfo$State;->ENQUEUED:Landroidx/work/WorkInfo$State;
|
|
|
|
new-array v3, v0, [Ljava/lang/String;
|
|
|
|
const/4 v4, 0x0
|
|
|
|
iget-object v5, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
aput-object v5, v3, v4
|
|
|
|
invoke-interface {v1, v2, v3}, Landroidx/work/impl/model/WorkSpecDao;->setState(Landroidx/work/WorkInfo$State;[Ljava/lang/String;)I
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
iget-object v2, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
|
|
|
|
move-result-wide v3
|
|
|
|
invoke-interface {v1, v2, v3, v4}, Landroidx/work/impl/model/WorkSpecDao;->setPeriodStartTime(Ljava/lang/String;J)V
|
|
|
|
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v2, 0x17
|
|
|
|
if-ge v1, v2, :cond_0
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
iget-object v2, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
const-wide/16 v3, -0x1
|
|
|
|
invoke-interface {v1, v2, v3, v4}, Landroidx/work/impl/model/WorkSpecDao;->markWorkSpecScheduled(Ljava/lang/String;J)I
|
|
|
|
:cond_0
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v1}, Landroidx/work/impl/WorkDatabase;->setTransactionSuccessful()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v1}, Landroidx/work/impl/WorkDatabase;->endTransaction()V
|
|
|
|
invoke-direct {p0, v0}, Landroidx/work/impl/WorkerWrapper;->resolve(Z)V
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception v1
|
|
|
|
iget-object v2, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v2}, Landroidx/work/impl/WorkDatabase;->endTransaction()V
|
|
|
|
invoke-direct {p0, v0}, Landroidx/work/impl/WorkerWrapper;->resolve(Z)V
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method private resetPeriodicAndResolve()V
|
|
.locals 5
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->beginTransaction()V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:try_start_0
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
iget-object v2, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
|
|
|
|
move-result-wide v3
|
|
|
|
invoke-interface {v1, v2, v3, v4}, Landroidx/work/impl/model/WorkSpecDao;->setPeriodStartTime(Ljava/lang/String;J)V
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
sget-object v2, Landroidx/work/WorkInfo$State;->ENQUEUED:Landroidx/work/WorkInfo$State;
|
|
|
|
const/4 v3, 0x1
|
|
|
|
new-array v3, v3, [Ljava/lang/String;
|
|
|
|
iget-object v4, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
aput-object v4, v3, v0
|
|
|
|
invoke-interface {v1, v2, v3}, Landroidx/work/impl/model/WorkSpecDao;->setState(Landroidx/work/WorkInfo$State;[Ljava/lang/String;)I
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
iget-object v2, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
invoke-interface {v1, v2}, Landroidx/work/impl/model/WorkSpecDao;->resetWorkSpecRunAttemptCount(Ljava/lang/String;)I
|
|
|
|
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v2, 0x17
|
|
|
|
if-ge v1, v2, :cond_0
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
iget-object v2, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
const-wide/16 v3, -0x1
|
|
|
|
invoke-interface {v1, v2, v3, v4}, Landroidx/work/impl/model/WorkSpecDao;->markWorkSpecScheduled(Ljava/lang/String;J)I
|
|
|
|
:cond_0
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v1}, Landroidx/work/impl/WorkDatabase;->setTransactionSuccessful()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v1}, Landroidx/work/impl/WorkDatabase;->endTransaction()V
|
|
|
|
invoke-direct {p0, v0}, Landroidx/work/impl/WorkerWrapper;->resolve(Z)V
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception v1
|
|
|
|
iget-object v2, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v2}, Landroidx/work/impl/WorkDatabase;->endTransaction()V
|
|
|
|
invoke-direct {p0, v0}, Landroidx/work/impl/WorkerWrapper;->resolve(Z)V
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method private resolve(Z)V
|
|
.locals 3
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->beginTransaction()V
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->workSpecDao()Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Landroidx/work/impl/model/WorkSpecDao;->getAllUnfinishedWork()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
const/4 v0, 0x1
|
|
|
|
:goto_1
|
|
if-eqz v0, :cond_2
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mAppContext:Landroid/content/Context;
|
|
|
|
const-class v2, Landroidx/work/impl/background/systemalarm/RescheduleReceiver;
|
|
|
|
invoke-static {v0, v2, v1}, Landroidx/work/impl/utils/PackageManagerHelper;->setComponentEnabled(Landroid/content/Context;Ljava/lang/Class;Z)V
|
|
|
|
:cond_2
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->setTransactionSuccessful()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->endTransaction()V
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mFuture:Landroidx/work/impl/utils/futures/SettableFuture;
|
|
|
|
invoke-static {p1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0, p1}, Landroidx/work/impl/utils/futures/SettableFuture;->set(Ljava/lang/Object;)Z
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->endTransaction()V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private resolveIncorrectStatus()V
|
|
.locals 7
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
invoke-interface {v0, v1}, Landroidx/work/impl/model/WorkSpecDao;->getState(Ljava/lang/String;)Landroidx/work/WorkInfo$State;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Landroidx/work/WorkInfo$State;->RUNNING:Landroidx/work/WorkInfo$State;
|
|
|
|
const/4 v2, 0x1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
invoke-static {}, Landroidx/work/Logger;->get()Landroidx/work/Logger;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Landroidx/work/impl/WorkerWrapper;->TAG:Ljava/lang/String;
|
|
|
|
new-array v4, v2, [Ljava/lang/Object;
|
|
|
|
iget-object v5, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
aput-object v5, v4, v3
|
|
|
|
const-string v5, "Status for %s is RUNNING;not doing any work and rescheduling for later execution"
|
|
|
|
invoke-static {v5, v4}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
new-array v3, v3, [Ljava/lang/Throwable;
|
|
|
|
invoke-virtual {v0, v1, v4, v3}, Landroidx/work/Logger;->debug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
|
|
|
invoke-direct {p0, v2}, Landroidx/work/impl/WorkerWrapper;->resolve(Z)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
invoke-static {}, Landroidx/work/Logger;->get()Landroidx/work/Logger;
|
|
|
|
move-result-object v1
|
|
|
|
sget-object v4, Landroidx/work/impl/WorkerWrapper;->TAG:Ljava/lang/String;
|
|
|
|
const/4 v5, 0x2
|
|
|
|
new-array v5, v5, [Ljava/lang/Object;
|
|
|
|
iget-object v6, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
aput-object v6, v5, v3
|
|
|
|
aput-object v0, v5, v2
|
|
|
|
const-string v0, "Status for %s is %s; not doing any work"
|
|
|
|
invoke-static {v0, v5}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
new-array v2, v3, [Ljava/lang/Throwable;
|
|
|
|
invoke-virtual {v1, v4, v0, v2}, Landroidx/work/Logger;->debug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
|
|
|
invoke-direct {p0, v3}, Landroidx/work/impl/WorkerWrapper;->resolve(Z)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private runWorker()V
|
|
.locals 12
|
|
|
|
invoke-direct {p0}, Landroidx/work/impl/WorkerWrapper;->tryCheckForInterruptionAndResolve()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->beginTransaction()V
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
invoke-interface {v0, v1}, Landroidx/work/impl/model/WorkSpecDao;->getWorkSpec(Ljava/lang/String;)Landroidx/work/impl/model/WorkSpec;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
invoke-static {}, Landroidx/work/Logger;->get()Landroidx/work/Logger;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v3, Landroidx/work/impl/WorkerWrapper;->TAG:Ljava/lang/String;
|
|
|
|
const-string v4, "Didn\'t find WorkSpec for id %s"
|
|
|
|
new-array v1, v1, [Ljava/lang/Object;
|
|
|
|
iget-object v5, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
aput-object v5, v1, v2
|
|
|
|
invoke-static {v4, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
new-array v4, v2, [Ljava/lang/Throwable;
|
|
|
|
invoke-virtual {v0, v3, v1, v4}, Landroidx/work/Logger;->error(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
|
|
|
invoke-direct {p0, v2}, Landroidx/work/impl/WorkerWrapper;->resolve(Z)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->endTransaction()V
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
:try_start_1
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
iget-object v0, v0, Landroidx/work/impl/model/WorkSpec;->state:Landroidx/work/WorkInfo$State;
|
|
|
|
sget-object v3, Landroidx/work/WorkInfo$State;->ENQUEUED:Landroidx/work/WorkInfo$State;
|
|
|
|
if-eq v0, v3, :cond_2
|
|
|
|
invoke-direct {p0}, Landroidx/work/impl/WorkerWrapper;->resolveIncorrectStatus()V
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->setTransactionSuccessful()V
|
|
|
|
invoke-static {}, Landroidx/work/Logger;->get()Landroidx/work/Logger;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v3, Landroidx/work/impl/WorkerWrapper;->TAG:Ljava/lang/String;
|
|
|
|
const-string v4, "%s is not in ENQUEUED state. Nothing more to do."
|
|
|
|
new-array v1, v1, [Ljava/lang/Object;
|
|
|
|
iget-object v5, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
iget-object v5, v5, Landroidx/work/impl/model/WorkSpec;->workerClassName:Ljava/lang/String;
|
|
|
|
aput-object v5, v1, v2
|
|
|
|
invoke-static {v4, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
new-array v2, v2, [Ljava/lang/Throwable;
|
|
|
|
invoke-virtual {v0, v3, v1, v2}, Landroidx/work/Logger;->debug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->endTransaction()V
|
|
|
|
return-void
|
|
|
|
:cond_2
|
|
:try_start_2
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/model/WorkSpec;->isPeriodic()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_3
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/model/WorkSpec;->isBackedOff()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
:cond_3
|
|
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
|
|
|
|
move-result-wide v3
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v5, 0x17
|
|
|
|
if-ge v0, v5, :cond_4
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
iget-wide v5, v0, Landroidx/work/impl/model/WorkSpec;->intervalDuration:J
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
iget-wide v7, v0, Landroidx/work/impl/model/WorkSpec;->flexDuration:J
|
|
|
|
cmp-long v0, v5, v7
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
iget-wide v5, v0, Landroidx/work/impl/model/WorkSpec;->periodStartTime:J
|
|
|
|
const-wide/16 v7, 0x0
|
|
|
|
cmp-long v0, v5, v7
|
|
|
|
if-nez v0, :cond_4
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_4
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
if-nez v0, :cond_5
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/model/WorkSpec;->calculateNextRunTime()J
|
|
|
|
move-result-wide v5
|
|
|
|
cmp-long v0, v3, v5
|
|
|
|
if-gez v0, :cond_5
|
|
|
|
invoke-static {}, Landroidx/work/Logger;->get()Landroidx/work/Logger;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v3, Landroidx/work/impl/WorkerWrapper;->TAG:Ljava/lang/String;
|
|
|
|
const-string v4, "Delaying execution for %s because it is being executed before schedule."
|
|
|
|
new-array v5, v1, [Ljava/lang/Object;
|
|
|
|
iget-object v6, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
iget-object v6, v6, Landroidx/work/impl/model/WorkSpec;->workerClassName:Ljava/lang/String;
|
|
|
|
aput-object v6, v5, v2
|
|
|
|
invoke-static {v4, v5}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
new-array v2, v2, [Ljava/lang/Throwable;
|
|
|
|
invoke-virtual {v0, v3, v4, v2}, Landroidx/work/Logger;->debug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
|
|
|
invoke-direct {p0, v1}, Landroidx/work/impl/WorkerWrapper;->resolve(Z)V
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->endTransaction()V
|
|
|
|
return-void
|
|
|
|
:cond_5
|
|
:try_start_3
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->setTransactionSuccessful()V
|
|
:try_end_3
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_0
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->endTransaction()V
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/model/WorkSpec;->isPeriodic()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_6
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
iget-object v0, v0, Landroidx/work/impl/model/WorkSpec;->input:Landroidx/work/Data;
|
|
|
|
:goto_1
|
|
move-object v5, v0
|
|
|
|
goto :goto_2
|
|
|
|
:cond_6
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
iget-object v0, v0, Landroidx/work/impl/model/WorkSpec;->inputMergerClassName:Ljava/lang/String;
|
|
|
|
invoke-static {v0}, Landroidx/work/InputMerger;->fromClassName(Ljava/lang/String;)Landroidx/work/InputMerger;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_7
|
|
|
|
invoke-static {}, Landroidx/work/Logger;->get()Landroidx/work/Logger;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v3, Landroidx/work/impl/WorkerWrapper;->TAG:Ljava/lang/String;
|
|
|
|
new-array v1, v1, [Ljava/lang/Object;
|
|
|
|
iget-object v4, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
iget-object v4, v4, Landroidx/work/impl/model/WorkSpec;->inputMergerClassName:Ljava/lang/String;
|
|
|
|
aput-object v4, v1, v2
|
|
|
|
const-string v4, "Could not create Input Merger %s"
|
|
|
|
invoke-static {v4, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
new-array v2, v2, [Ljava/lang/Throwable;
|
|
|
|
invoke-virtual {v0, v3, v1, v2}, Landroidx/work/Logger;->error(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
|
|
|
invoke-virtual {p0}, Landroidx/work/impl/WorkerWrapper;->setFailedAndResolve()V
|
|
|
|
return-void
|
|
|
|
:cond_7
|
|
new-instance v3, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iget-object v4, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
iget-object v4, v4, Landroidx/work/impl/model/WorkSpec;->input:Landroidx/work/Data;
|
|
|
|
invoke-interface {v3, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
iget-object v4, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
iget-object v5, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
invoke-interface {v4, v5}, Landroidx/work/impl/model/WorkSpecDao;->getInputsFromPrerequisites(Ljava/lang/String;)Ljava/util/List;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-interface {v3, v4}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z
|
|
|
|
invoke-virtual {v0, v3}, Landroidx/work/InputMerger;->merge(Ljava/util/List;)Landroidx/work/Data;
|
|
|
|
move-result-object v0
|
|
|
|
goto :goto_1
|
|
|
|
:goto_2
|
|
new-instance v0, Landroidx/work/WorkerParameters;
|
|
|
|
iget-object v3, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
invoke-static {v3}, Ljava/util/UUID;->fromString(Ljava/lang/String;)Ljava/util/UUID;
|
|
|
|
move-result-object v4
|
|
|
|
iget-object v6, p0, Landroidx/work/impl/WorkerWrapper;->mTags:Ljava/util/List;
|
|
|
|
iget-object v7, p0, Landroidx/work/impl/WorkerWrapper;->mRuntimeExtras:Landroidx/work/WorkerParameters$RuntimeExtras;
|
|
|
|
iget-object v3, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
iget v8, v3, Landroidx/work/impl/model/WorkSpec;->runAttemptCount:I
|
|
|
|
iget-object v3, p0, Landroidx/work/impl/WorkerWrapper;->mConfiguration:Landroidx/work/Configuration;
|
|
|
|
invoke-virtual {v3}, Landroidx/work/Configuration;->getExecutor()Ljava/util/concurrent/Executor;
|
|
|
|
move-result-object v9
|
|
|
|
iget-object v10, p0, Landroidx/work/impl/WorkerWrapper;->mWorkTaskExecutor:Landroidx/work/impl/utils/taskexecutor/TaskExecutor;
|
|
|
|
iget-object v3, p0, Landroidx/work/impl/WorkerWrapper;->mConfiguration:Landroidx/work/Configuration;
|
|
|
|
invoke-virtual {v3}, Landroidx/work/Configuration;->getWorkerFactory()Landroidx/work/WorkerFactory;
|
|
|
|
move-result-object v11
|
|
|
|
move-object v3, v0
|
|
|
|
invoke-direct/range {v3 .. v11}, Landroidx/work/WorkerParameters;-><init>(Ljava/util/UUID;Landroidx/work/Data;Ljava/util/Collection;Landroidx/work/WorkerParameters$RuntimeExtras;ILjava/util/concurrent/Executor;Landroidx/work/impl/utils/taskexecutor/TaskExecutor;Landroidx/work/WorkerFactory;)V
|
|
|
|
iget-object v3, p0, Landroidx/work/impl/WorkerWrapper;->mWorker:Landroidx/work/ListenableWorker;
|
|
|
|
if-nez v3, :cond_8
|
|
|
|
iget-object v3, p0, Landroidx/work/impl/WorkerWrapper;->mConfiguration:Landroidx/work/Configuration;
|
|
|
|
invoke-virtual {v3}, Landroidx/work/Configuration;->getWorkerFactory()Landroidx/work/WorkerFactory;
|
|
|
|
move-result-object v3
|
|
|
|
iget-object v4, p0, Landroidx/work/impl/WorkerWrapper;->mAppContext:Landroid/content/Context;
|
|
|
|
iget-object v5, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
iget-object v5, v5, Landroidx/work/impl/model/WorkSpec;->workerClassName:Ljava/lang/String;
|
|
|
|
invoke-virtual {v3, v4, v5, v0}, Landroidx/work/WorkerFactory;->createWorkerWithDefaultFallback(Landroid/content/Context;Ljava/lang/String;Landroidx/work/WorkerParameters;)Landroidx/work/ListenableWorker;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorker:Landroidx/work/ListenableWorker;
|
|
|
|
:cond_8
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorker:Landroidx/work/ListenableWorker;
|
|
|
|
if-nez v0, :cond_9
|
|
|
|
invoke-static {}, Landroidx/work/Logger;->get()Landroidx/work/Logger;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v3, Landroidx/work/impl/WorkerWrapper;->TAG:Ljava/lang/String;
|
|
|
|
new-array v1, v1, [Ljava/lang/Object;
|
|
|
|
iget-object v4, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
iget-object v4, v4, Landroidx/work/impl/model/WorkSpec;->workerClassName:Ljava/lang/String;
|
|
|
|
aput-object v4, v1, v2
|
|
|
|
const-string v4, "Could not create Worker %s"
|
|
|
|
invoke-static {v4, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
new-array v2, v2, [Ljava/lang/Throwable;
|
|
|
|
invoke-virtual {v0, v3, v1, v2}, Landroidx/work/Logger;->error(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
|
|
|
invoke-virtual {p0}, Landroidx/work/impl/WorkerWrapper;->setFailedAndResolve()V
|
|
|
|
return-void
|
|
|
|
:cond_9
|
|
invoke-virtual {v0}, Landroidx/work/ListenableWorker;->isUsed()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_a
|
|
|
|
invoke-static {}, Landroidx/work/Logger;->get()Landroidx/work/Logger;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v3, Landroidx/work/impl/WorkerWrapper;->TAG:Ljava/lang/String;
|
|
|
|
new-array v1, v1, [Ljava/lang/Object;
|
|
|
|
iget-object v4, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpec:Landroidx/work/impl/model/WorkSpec;
|
|
|
|
iget-object v4, v4, Landroidx/work/impl/model/WorkSpec;->workerClassName:Ljava/lang/String;
|
|
|
|
aput-object v4, v1, v2
|
|
|
|
const-string v4, "Received an already-used Worker %s; WorkerFactory should return new instances"
|
|
|
|
invoke-static {v4, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
new-array v2, v2, [Ljava/lang/Throwable;
|
|
|
|
invoke-virtual {v0, v3, v1, v2}, Landroidx/work/Logger;->error(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
|
|
|
invoke-virtual {p0}, Landroidx/work/impl/WorkerWrapper;->setFailedAndResolve()V
|
|
|
|
return-void
|
|
|
|
:cond_a
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorker:Landroidx/work/ListenableWorker;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/ListenableWorker;->setUsed()V
|
|
|
|
invoke-direct {p0}, Landroidx/work/impl/WorkerWrapper;->trySetRunning()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_c
|
|
|
|
invoke-direct {p0}, Landroidx/work/impl/WorkerWrapper;->tryCheckForInterruptionAndResolve()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_b
|
|
|
|
return-void
|
|
|
|
:cond_b
|
|
invoke-static {}, Landroidx/work/impl/utils/futures/SettableFuture;->create()Landroidx/work/impl/utils/futures/SettableFuture;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkTaskExecutor:Landroidx/work/impl/utils/taskexecutor/TaskExecutor;
|
|
|
|
invoke-interface {v1}, Landroidx/work/impl/utils/taskexecutor/TaskExecutor;->getMainThreadExecutor()Ljava/util/concurrent/Executor;
|
|
|
|
move-result-object v1
|
|
|
|
new-instance v2, Landroidx/work/impl/WorkerWrapper$1;
|
|
|
|
invoke-direct {v2, p0, v0}, Landroidx/work/impl/WorkerWrapper$1;-><init>(Landroidx/work/impl/WorkerWrapper;Landroidx/work/impl/utils/futures/SettableFuture;)V
|
|
|
|
invoke-interface {v1, v2}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDescription:Ljava/lang/String;
|
|
|
|
new-instance v2, Landroidx/work/impl/WorkerWrapper$2;
|
|
|
|
invoke-direct {v2, p0, v0, v1}, Landroidx/work/impl/WorkerWrapper$2;-><init>(Landroidx/work/impl/WorkerWrapper;Landroidx/work/impl/utils/futures/SettableFuture;Ljava/lang/String;)V
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkTaskExecutor:Landroidx/work/impl/utils/taskexecutor/TaskExecutor;
|
|
|
|
invoke-interface {v1}, Landroidx/work/impl/utils/taskexecutor/TaskExecutor;->getBackgroundExecutor()Ljava/util/concurrent/Executor;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v2, v1}, Landroidx/work/impl/utils/futures/SettableFuture;->addListener(Ljava/lang/Runnable;Ljava/util/concurrent/Executor;)V
|
|
|
|
return-void
|
|
|
|
:cond_c
|
|
invoke-direct {p0}, Landroidx/work/impl/WorkerWrapper;->resolveIncorrectStatus()V
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v1}, Landroidx/work/impl/WorkDatabase;->endTransaction()V
|
|
|
|
goto :goto_4
|
|
|
|
:goto_3
|
|
throw v0
|
|
|
|
:goto_4
|
|
goto :goto_3
|
|
.end method
|
|
|
|
.method private setSucceededAndResolve()V
|
|
.locals 10
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->beginTransaction()V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:try_start_0
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
sget-object v2, Landroidx/work/WorkInfo$State;->SUCCEEDED:Landroidx/work/WorkInfo$State;
|
|
|
|
const/4 v3, 0x1
|
|
|
|
new-array v4, v3, [Ljava/lang/String;
|
|
|
|
iget-object v5, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
aput-object v5, v4, v0
|
|
|
|
invoke-interface {v1, v2, v4}, Landroidx/work/impl/model/WorkSpecDao;->setState(Landroidx/work/WorkInfo$State;[Ljava/lang/String;)I
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mResult:Landroidx/work/ListenableWorker$Result;
|
|
|
|
check-cast v1, Landroidx/work/ListenableWorker$Result$Success;
|
|
|
|
invoke-virtual {v1}, Landroidx/work/ListenableWorker$Result$Success;->getOutputData()Landroidx/work/Data;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
iget-object v4, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
invoke-interface {v2, v4, v1}, Landroidx/work/impl/model/WorkSpecDao;->setOutput(Ljava/lang/String;Landroidx/work/Data;)V
|
|
|
|
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
|
|
|
|
move-result-wide v1
|
|
|
|
iget-object v4, p0, Landroidx/work/impl/WorkerWrapper;->mDependencyDao:Landroidx/work/impl/model/DependencyDao;
|
|
|
|
iget-object v5, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
invoke-interface {v4, v5}, Landroidx/work/impl/model/DependencyDao;->getDependentWorkIds(Ljava/lang/String;)Ljava/util/List;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-interface {v4}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v4
|
|
|
|
:cond_0
|
|
:goto_0
|
|
invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_1
|
|
|
|
invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v5
|
|
|
|
check-cast v5, Ljava/lang/String;
|
|
|
|
iget-object v6, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
invoke-interface {v6, v5}, Landroidx/work/impl/model/WorkSpecDao;->getState(Ljava/lang/String;)Landroidx/work/WorkInfo$State;
|
|
|
|
move-result-object v6
|
|
|
|
sget-object v7, Landroidx/work/WorkInfo$State;->BLOCKED:Landroidx/work/WorkInfo$State;
|
|
|
|
if-ne v6, v7, :cond_0
|
|
|
|
iget-object v6, p0, Landroidx/work/impl/WorkerWrapper;->mDependencyDao:Landroidx/work/impl/model/DependencyDao;
|
|
|
|
invoke-interface {v6, v5}, Landroidx/work/impl/model/DependencyDao;->hasCompletedAllPrerequisites(Ljava/lang/String;)Z
|
|
|
|
move-result v6
|
|
|
|
if-eqz v6, :cond_0
|
|
|
|
invoke-static {}, Landroidx/work/Logger;->get()Landroidx/work/Logger;
|
|
|
|
move-result-object v6
|
|
|
|
sget-object v7, Landroidx/work/impl/WorkerWrapper;->TAG:Ljava/lang/String;
|
|
|
|
const-string v8, "Setting status to enqueued for %s"
|
|
|
|
new-array v9, v3, [Ljava/lang/Object;
|
|
|
|
aput-object v5, v9, v0
|
|
|
|
invoke-static {v8, v9}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v8
|
|
|
|
new-array v9, v0, [Ljava/lang/Throwable;
|
|
|
|
invoke-virtual {v6, v7, v8, v9}, Landroidx/work/Logger;->info(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
|
|
|
iget-object v6, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
sget-object v7, Landroidx/work/WorkInfo$State;->ENQUEUED:Landroidx/work/WorkInfo$State;
|
|
|
|
new-array v8, v3, [Ljava/lang/String;
|
|
|
|
aput-object v5, v8, v0
|
|
|
|
invoke-interface {v6, v7, v8}, Landroidx/work/impl/model/WorkSpecDao;->setState(Landroidx/work/WorkInfo$State;[Ljava/lang/String;)I
|
|
|
|
iget-object v6, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
invoke-interface {v6, v5, v1, v2}, Landroidx/work/impl/model/WorkSpecDao;->setPeriodStartTime(Ljava/lang/String;J)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v1}, Landroidx/work/impl/WorkDatabase;->setTransactionSuccessful()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v1}, Landroidx/work/impl/WorkDatabase;->endTransaction()V
|
|
|
|
invoke-direct {p0, v0}, Landroidx/work/impl/WorkerWrapper;->resolve(Z)V
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception v1
|
|
|
|
iget-object v2, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v2}, Landroidx/work/impl/WorkDatabase;->endTransaction()V
|
|
|
|
invoke-direct {p0, v0}, Landroidx/work/impl/WorkerWrapper;->resolve(Z)V
|
|
|
|
goto :goto_2
|
|
|
|
:goto_1
|
|
throw v1
|
|
|
|
:goto_2
|
|
goto :goto_1
|
|
.end method
|
|
|
|
.method private tryCheckForInterruptionAndResolve()Z
|
|
.locals 6
|
|
|
|
iget-boolean v0, p0, Landroidx/work/impl/WorkerWrapper;->mInterrupted:Z
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
invoke-static {}, Landroidx/work/Logger;->get()Landroidx/work/Logger;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v2, Landroidx/work/impl/WorkerWrapper;->TAG:Ljava/lang/String;
|
|
|
|
const/4 v3, 0x1
|
|
|
|
new-array v4, v3, [Ljava/lang/Object;
|
|
|
|
iget-object v5, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDescription:Ljava/lang/String;
|
|
|
|
aput-object v5, v4, v1
|
|
|
|
const-string v5, "Work interrupted for %s"
|
|
|
|
invoke-static {v5, v4}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
new-array v5, v1, [Ljava/lang/Throwable;
|
|
|
|
invoke-virtual {v0, v2, v4, v5}, Landroidx/work/Logger;->debug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
iget-object v2, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
invoke-interface {v0, v2}, Landroidx/work/impl/model/WorkSpecDao;->getState(Ljava/lang/String;)Landroidx/work/WorkInfo$State;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {v0}, Landroidx/work/WorkInfo$State;->isFinished()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
const/4 v1, 0x1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
invoke-direct {p0, v1}, Landroidx/work/impl/WorkerWrapper;->resolve(Z)V
|
|
|
|
return v3
|
|
|
|
:cond_2
|
|
return v1
|
|
.end method
|
|
|
|
.method private trySetRunning()Z
|
|
.locals 6
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->beginTransaction()V
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
invoke-interface {v0, v1}, Landroidx/work/impl/model/WorkSpecDao;->getState(Ljava/lang/String;)Landroidx/work/WorkInfo$State;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Landroidx/work/WorkInfo$State;->ENQUEUED:Landroidx/work/WorkInfo$State;
|
|
|
|
const/4 v2, 0x1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
sget-object v1, Landroidx/work/WorkInfo$State;->RUNNING:Landroidx/work/WorkInfo$State;
|
|
|
|
new-array v4, v2, [Ljava/lang/String;
|
|
|
|
iget-object v5, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
aput-object v5, v4, v3
|
|
|
|
invoke-interface {v0, v1, v4}, Landroidx/work/impl/model/WorkSpecDao;->setState(Landroidx/work/WorkInfo$State;[Ljava/lang/String;)I
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
invoke-interface {v0, v1}, Landroidx/work/impl/model/WorkSpecDao;->incrementWorkSpecRunAttemptCount(Ljava/lang/String;)I
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->setTransactionSuccessful()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->endTransaction()V
|
|
|
|
return v2
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v1}, Landroidx/work/impl/WorkDatabase;->endTransaction()V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public getFuture()Lcom/google/a/a/a/a;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lcom/google/a/a/a/a<",
|
|
"Ljava/lang/Boolean;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mFuture:Landroidx/work/impl/utils/futures/SettableFuture;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public interrupt(Z)V
|
|
.locals 1
|
|
|
|
const/4 p1, 0x1
|
|
|
|
iput-boolean p1, p0, Landroidx/work/impl/WorkerWrapper;->mInterrupted:Z
|
|
|
|
invoke-direct {p0}, Landroidx/work/impl/WorkerWrapper;->tryCheckForInterruptionAndResolve()Z
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mInnerFuture:Lcom/google/a/a/a/a;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-interface {v0, p1}, Lcom/google/a/a/a/a;->cancel(Z)Z
|
|
|
|
:cond_0
|
|
iget-object p1, p0, Landroidx/work/impl/WorkerWrapper;->mWorker:Landroidx/work/ListenableWorker;
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
invoke-virtual {p1}, Landroidx/work/ListenableWorker;->stop()V
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method onWorkFinished()V
|
|
.locals 3
|
|
|
|
invoke-direct {p0}, Landroidx/work/impl/WorkerWrapper;->assertBackgroundExecutorThread()V
|
|
|
|
invoke-direct {p0}, Landroidx/work/impl/WorkerWrapper;->tryCheckForInterruptionAndResolve()Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-nez v0, :cond_3
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->beginTransaction()V
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
iget-object v2, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
invoke-interface {v0, v2}, Landroidx/work/impl/model/WorkSpecDao;->getState(Ljava/lang/String;)Landroidx/work/WorkInfo$State;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
invoke-direct {p0, v1}, Landroidx/work/impl/WorkerWrapper;->resolve(Z)V
|
|
|
|
const/4 v0, 0x1
|
|
|
|
const/4 v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
sget-object v2, Landroidx/work/WorkInfo$State;->RUNNING:Landroidx/work/WorkInfo$State;
|
|
|
|
if-ne v0, v2, :cond_1
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mResult:Landroidx/work/ListenableWorker$Result;
|
|
|
|
invoke-direct {p0, v0}, Landroidx/work/impl/WorkerWrapper;->handleResult(Landroidx/work/ListenableWorker$Result;)V
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
invoke-interface {v0, v1}, Landroidx/work/impl/model/WorkSpecDao;->getState(Ljava/lang/String;)Landroidx/work/WorkInfo$State;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Landroidx/work/WorkInfo$State;->isFinished()Z
|
|
|
|
move-result v0
|
|
|
|
move v1, v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
invoke-virtual {v0}, Landroidx/work/WorkInfo$State;->isFinished()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
invoke-direct {p0}, Landroidx/work/impl/WorkerWrapper;->rescheduleAndResolve()V
|
|
|
|
:cond_2
|
|
:goto_0
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->setTransactionSuccessful()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->endTransaction()V
|
|
|
|
goto :goto_1
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v1}, Landroidx/work/impl/WorkDatabase;->endTransaction()V
|
|
|
|
throw v0
|
|
|
|
:cond_3
|
|
:goto_1
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mSchedulers:Ljava/util/List;
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
if-eqz v1, :cond_4
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_2
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_4
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Landroidx/work/impl/Scheduler;
|
|
|
|
iget-object v2, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
invoke-interface {v1, v2}, Landroidx/work/impl/Scheduler;->cancel(Ljava/lang/String;)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_4
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mConfiguration:Landroidx/work/Configuration;
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
iget-object v2, p0, Landroidx/work/impl/WorkerWrapper;->mSchedulers:Ljava/util/List;
|
|
|
|
invoke-static {v0, v1, v2}, Landroidx/work/impl/Schedulers;->schedule(Landroidx/work/Configuration;Landroidx/work/impl/WorkDatabase;Ljava/util/List;)V
|
|
|
|
:cond_5
|
|
return-void
|
|
.end method
|
|
|
|
.method public run()V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkTagDao:Landroidx/work/impl/model/WorkTagDao;
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
invoke-interface {v0, v1}, Landroidx/work/impl/model/WorkTagDao;->getTagsForWorkSpecId(Ljava/lang/String;)Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mTags:Ljava/util/List;
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mTags:Ljava/util/List;
|
|
|
|
invoke-direct {p0, v0}, Landroidx/work/impl/WorkerWrapper;->createWorkDescription(Ljava/util/List;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDescription:Ljava/lang/String;
|
|
|
|
invoke-direct {p0}, Landroidx/work/impl/WorkerWrapper;->runWorker()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method setFailedAndResolve()V
|
|
.locals 4
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->beginTransaction()V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:try_start_0
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
invoke-direct {p0, v1}, Landroidx/work/impl/WorkerWrapper;->iterativelyFailWorkAndDependents(Ljava/lang/String;)V
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mResult:Landroidx/work/ListenableWorker$Result;
|
|
|
|
check-cast v1, Landroidx/work/ListenableWorker$Result$Failure;
|
|
|
|
invoke-virtual {v1}, Landroidx/work/ListenableWorker$Result$Failure;->getOutputData()Landroidx/work/Data;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecDao:Landroidx/work/impl/model/WorkSpecDao;
|
|
|
|
iget-object v3, p0, Landroidx/work/impl/WorkerWrapper;->mWorkSpecId:Ljava/lang/String;
|
|
|
|
invoke-interface {v2, v3, v1}, Landroidx/work/impl/model/WorkSpecDao;->setOutput(Ljava/lang/String;Landroidx/work/Data;)V
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v1}, Landroidx/work/impl/WorkDatabase;->setTransactionSuccessful()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v1}, Landroidx/work/impl/WorkDatabase;->endTransaction()V
|
|
|
|
invoke-direct {p0, v0}, Landroidx/work/impl/WorkerWrapper;->resolve(Z)V
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception v1
|
|
|
|
iget-object v2, p0, Landroidx/work/impl/WorkerWrapper;->mWorkDatabase:Landroidx/work/impl/WorkDatabase;
|
|
|
|
invoke-virtual {v2}, Landroidx/work/impl/WorkDatabase;->endTransaction()V
|
|
|
|
invoke-direct {p0, v0}, Landroidx/work/impl/WorkerWrapper;->resolve(Z)V
|
|
|
|
throw v1
|
|
.end method
|