172 lines
4.4 KiB
Smali
172 lines
4.4 KiB
Smali
|
.class public Landroidx/work/DelegatingWorkerFactory;
|
||
|
.super Landroidx/work/WorkerFactory;
|
||
|
.source "DelegatingWorkerFactory.java"
|
||
|
|
||
|
|
||
|
# static fields
|
||
|
.field public static final TAG:Ljava/lang/String;
|
||
|
|
||
|
|
||
|
# instance fields
|
||
|
.field public final mFactories:Ljava/util/List;
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"Ljava/util/List<",
|
||
|
"Landroidx/work/WorkerFactory;",
|
||
|
">;"
|
||
|
}
|
||
|
.end annotation
|
||
|
.end field
|
||
|
|
||
|
|
||
|
# direct methods
|
||
|
.method public static constructor <clinit>()V
|
||
|
.locals 1
|
||
|
|
||
|
const-string v0, "DelegatingWkrFctry"
|
||
|
|
||
|
invoke-static {v0}, Landroidx/work/Logger;->tagWithPrefix(Ljava/lang/String;)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
sput-object v0, Landroidx/work/DelegatingWorkerFactory;->TAG:Ljava/lang/String;
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public constructor <init>()V
|
||
|
.locals 1
|
||
|
|
||
|
invoke-direct {p0}, Landroidx/work/WorkerFactory;-><init>()V
|
||
|
|
||
|
new-instance v0, Ljava/util/LinkedList;
|
||
|
|
||
|
invoke-direct {v0}, Ljava/util/LinkedList;-><init>()V
|
||
|
|
||
|
iput-object v0, p0, Landroidx/work/DelegatingWorkerFactory;->mFactories:Ljava/util/List;
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
|
||
|
# virtual methods
|
||
|
.method public final addFactory(Landroidx/work/WorkerFactory;)V
|
||
|
.locals 1
|
||
|
.param p1 # Landroidx/work/WorkerFactory;
|
||
|
.annotation build Landroidx/annotation/NonNull;
|
||
|
.end annotation
|
||
|
.end param
|
||
|
|
||
|
iget-object v0, p0, Landroidx/work/DelegatingWorkerFactory;->mFactories:Ljava/util/List;
|
||
|
|
||
|
invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public final createWorker(Landroid/content/Context;Ljava/lang/String;Landroidx/work/WorkerParameters;)Landroidx/work/ListenableWorker;
|
||
|
.locals 3
|
||
|
.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
|
||
|
|
||
|
iget-object v0, p0, Landroidx/work/DelegatingWorkerFactory;->mFactories:Ljava/util/List;
|
||
|
|
||
|
invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
:cond_0
|
||
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
if-eqz v1, :cond_1
|
||
|
|
||
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
check-cast v1, Landroidx/work/WorkerFactory;
|
||
|
|
||
|
:try_start_0
|
||
|
invoke-virtual {v1, p1, p2, p3}, Landroidx/work/WorkerFactory;->createWorker(Landroid/content/Context;Ljava/lang/String;Landroidx/work/WorkerParameters;)Landroidx/work/ListenableWorker;
|
||
|
|
||
|
move-result-object v1
|
||
|
:try_end_0
|
||
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
||
|
|
||
|
if-eqz v1, :cond_0
|
||
|
|
||
|
return-object v1
|
||
|
|
||
|
:catchall_0
|
||
|
move-exception p1
|
||
|
|
||
|
const/4 p3, 0x1
|
||
|
|
||
|
new-array v0, p3, [Ljava/lang/Object;
|
||
|
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
aput-object p2, v0, v1
|
||
|
|
||
|
const-string p2, "Unable to instantiate a ListenableWorker (%s)"
|
||
|
|
||
|
invoke-static {p2, v0}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
||
|
|
||
|
move-result-object p2
|
||
|
|
||
|
invoke-static {}, Landroidx/work/Logger;->get()Landroidx/work/Logger;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
sget-object v2, Landroidx/work/DelegatingWorkerFactory;->TAG:Ljava/lang/String;
|
||
|
|
||
|
new-array p3, p3, [Ljava/lang/Throwable;
|
||
|
|
||
|
aput-object p1, p3, v1
|
||
|
|
||
|
invoke-virtual {v0, v2, p2, p3}, Landroidx/work/Logger;->error(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
||
|
|
||
|
throw p1
|
||
|
|
||
|
:cond_1
|
||
|
const/4 p1, 0x0
|
||
|
|
||
|
return-object p1
|
||
|
.end method
|
||
|
|
||
|
.method public getFactories()Ljava/util/List;
|
||
|
.locals 1
|
||
|
.annotation build Landroidx/annotation/NonNull;
|
||
|
.end annotation
|
||
|
|
||
|
.annotation build Landroidx/annotation/VisibleForTesting;
|
||
|
.end annotation
|
||
|
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"()",
|
||
|
"Ljava/util/List<",
|
||
|
"Landroidx/work/WorkerFactory;",
|
||
|
">;"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
iget-object v0, p0, Landroidx/work/DelegatingWorkerFactory;->mFactories:Ljava/util/List;
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|