238 lines
6.3 KiB
Smali
238 lines
6.3 KiB
Smali
.class public abstract Landroidx/work/WorkerFactory;
|
|
.super Ljava/lang/Object;
|
|
.source "WorkerFactory.java"
|
|
|
|
|
|
# static fields
|
|
.field public static final TAG:Ljava/lang/String;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
const-string v0, "WorkerFactory"
|
|
|
|
invoke-static {v0}, Landroidx/work/Logger;->tagWithPrefix(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Landroidx/work/WorkerFactory;->TAG:Ljava/lang/String;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static getDefaultWorkerFactory()Landroidx/work/WorkerFactory;
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
value = {
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP:Landroidx/annotation/RestrictTo$Scope;
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Landroidx/work/WorkerFactory$1;
|
|
|
|
invoke-direct {v0}, Landroidx/work/WorkerFactory$1;-><init>()V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public abstract createWorker(Landroid/content/Context;Ljava/lang/String;Landroidx/work/WorkerParameters;)Landroidx/work/ListenableWorker;
|
|
.param p1 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p3 # Landroidx/work/WorkerParameters;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
.end method
|
|
|
|
.method public final createWorkerWithDefaultFallback(Landroid/content/Context;Ljava/lang/String;Landroidx/work/WorkerParameters;)Landroidx/work/ListenableWorker;
|
|
.locals 9
|
|
.param p1 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p3 # Landroidx/work/WorkerParameters;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
value = {
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP:Landroidx/annotation/RestrictTo$Scope;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0, p1, p2, p3}, Landroidx/work/WorkerFactory;->createWorker(Landroid/content/Context;Ljava/lang/String;Landroidx/work/WorkerParameters;)Landroidx/work/ListenableWorker;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x2
|
|
|
|
const/4 v2, 0x1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
:try_start_0
|
|
invoke-static {p2}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
|
|
|
|
move-result-object v5
|
|
|
|
const-class v6, Landroidx/work/ListenableWorker;
|
|
|
|
invoke-virtual {v5, v6}, Ljava/lang/Class;->asSubclass(Ljava/lang/Class;)Ljava/lang/Class;
|
|
|
|
move-result-object v4
|
|
:try_end_0
|
|
.catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
invoke-static {}, Landroidx/work/Logger;->get()Landroidx/work/Logger;
|
|
|
|
move-result-object v5
|
|
|
|
sget-object v6, Landroidx/work/WorkerFactory;->TAG:Ljava/lang/String;
|
|
|
|
const-string v7, "Class not found: "
|
|
|
|
invoke-static {v7, p2}, Lf/e/b/a/a;->p(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v7
|
|
|
|
new-array v8, v3, [Ljava/lang/Throwable;
|
|
|
|
invoke-virtual {v5, v6, v7, v8}, Landroidx/work/Logger;->error(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
|
|
|
:goto_0
|
|
if-eqz v4, :cond_0
|
|
|
|
:try_start_1
|
|
new-array v5, v1, [Ljava/lang/Class;
|
|
|
|
const-class v6, Landroid/content/Context;
|
|
|
|
aput-object v6, v5, v3
|
|
|
|
const-class v6, Landroidx/work/WorkerParameters;
|
|
|
|
aput-object v6, v5, v2
|
|
|
|
invoke-virtual {v4, v5}, Ljava/lang/Class;->getDeclaredConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
|
|
|
|
move-result-object v4
|
|
|
|
new-array v5, v1, [Ljava/lang/Object;
|
|
|
|
aput-object p1, v5, v3
|
|
|
|
aput-object p3, v5, v2
|
|
|
|
invoke-virtual {v4, v5}, Ljava/lang/reflect/Constructor;->newInstance([Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroidx/work/ListenableWorker;
|
|
:try_end_1
|
|
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1
|
|
|
|
move-object v0, p1
|
|
|
|
goto :goto_1
|
|
|
|
:catch_1
|
|
move-exception p1
|
|
|
|
invoke-static {}, Landroidx/work/Logger;->get()Landroidx/work/Logger;
|
|
|
|
move-result-object p3
|
|
|
|
sget-object v4, Landroidx/work/WorkerFactory;->TAG:Ljava/lang/String;
|
|
|
|
const-string v5, "Could not instantiate "
|
|
|
|
invoke-static {v5, p2}, Lf/e/b/a/a;->p(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
new-array v6, v2, [Ljava/lang/Throwable;
|
|
|
|
aput-object p1, v6, v3
|
|
|
|
invoke-virtual {p3, v4, v5, v6}, Landroidx/work/Logger;->error(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
|
|
|
:cond_0
|
|
:goto_1
|
|
if-eqz v0, :cond_2
|
|
|
|
invoke-virtual {v0}, Landroidx/work/ListenableWorker;->isUsed()Z
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_1
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
new-array p3, v1, [Ljava/lang/Object;
|
|
|
|
aput-object p1, p3, v3
|
|
|
|
aput-object p2, p3, v2
|
|
|
|
const-string p1, "WorkerFactory (%s) returned an instance of a ListenableWorker (%s) which has already been invoked. createWorker() must always return a new instance of a ListenableWorker."
|
|
|
|
invoke-static {p1, p3}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance p2, Ljava/lang/IllegalStateException;
|
|
|
|
invoke-direct {p2, p1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p2
|
|
|
|
:cond_2
|
|
:goto_2
|
|
return-object v0
|
|
.end method
|