2020-11-12 02:11:44 +00:00
.class public abstract L androidx/work/WorkerFactory ;
.super L java/lang/Object ;
.source "WorkerFactory.java"
# static fields
2020-11-21 22:11:07 +00:00
.field private static final TAG : L java/lang/String ;
2020-11-12 02:11:44 +00:00
# direct methods
.method public static constructor <clinit> ( ) V
.locals 1
const-string v0 , "WorkerFactory"
invoke-static { v0 } , L androidx/work/Logger ;-> tagWithPrefix ( L java/lang/String ;) L java/lang/String ;
move-result-object v0
sput-object v0 , L androidx/work/WorkerFactory ;-> TAG : L java/lang/String ;
return-void
.end method
.method public constructor <init> ( ) V
.locals 0
invoke-direct { p0 } , L java/lang/Object ;-> <init> ( ) V
return-void
.end method
.method public static getDefaultWorkerFactory ( ) L androidx/work/WorkerFactory ;
.locals 1
.annotation build L androidx/annotation/NonNull ;
.end annotation
.annotation build L androidx/annotation/RestrictTo ;
value = {
.enum L androidx/annotation/RestrictTo$Scope ;-> LIBRARY_GROUP : L androidx/annotation/RestrictTo$Scope ;
}
.end annotation
new-instance v0 , L androidx/work/WorkerFactory$1 ;
invoke-direct { v0 } , L androidx/work/WorkerFactory$1 ;-> <init> ( ) V
return-object v0
.end method
# virtual methods
.method public abstract createWorker ( L android/content/Context ;L java/lang/String ;L androidx/work/WorkerParameters ;) L androidx/work/ListenableWorker ;
. param p1 # Landroid/content/Context;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
. param p2 # Ljava/lang/String;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
. param p3 # Landroidx/work/WorkerParameters;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
.annotation build L androidx/annotation/Nullable ;
.end annotation
.end method
.method public final createWorkerWithDefaultFallback ( L android/content/Context ;L java/lang/String ;L androidx/work/WorkerParameters ;) L androidx/work/ListenableWorker ;
.locals 10
. param p1 # Landroid/content/Context;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
. param p2 # Ljava/lang/String;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
. param p3 # Landroidx/work/WorkerParameters;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
.annotation build L androidx/annotation/Nullable ;
.end annotation
.annotation build L androidx/annotation/RestrictTo ;
value = {
.enum L androidx/annotation/RestrictTo$Scope ;-> LIBRARY_GROUP : L androidx/annotation/RestrictTo$Scope ;
}
.end annotation
invoke-virtual { p0 , p1 , p2 , p3 } , L androidx/work/WorkerFactory ;-> createWorker ( L android/content/Context ;L java/lang/String ;L androidx/work/WorkerParameters ;) L androidx/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 } , L java/lang/Class ;-> forName ( L java/lang/String ;) L java/lang/Class ;
move-result-object v5
const-class v6 , L androidx/work/ListenableWorker ;
invoke-virtual { v5 , v6 } , L java/lang/Class ;-> asSubclass ( L java/lang/Class ;) L java/lang/Class ;
move-result-object v4
:try_end_0
.catchall { :try_start_0 . . :try_end_0 } :catchall_0
goto :goto_0
:catchall_0
move-exception v5
invoke-static { } , L androidx/work/Logger ;-> get ( ) L androidx/work/Logger ;
move-result-object v6
sget-object v7 , L androidx/work/WorkerFactory ;-> TAG : L java/lang/String ;
const-string v8 , "Invalid class: "
2020-11-21 22:11:07 +00:00
invoke-static { v8 , p2 } , L f/e/c/a/a ;-> r ( L java/lang/String ;L java/lang/String ;) L java/lang/String ;
2020-11-12 02:11:44 +00:00
move-result-object v8
new-array v9 , v2 , [ L java/lang/Throwable ;
aput-object v5 , v9 , v3
invoke-virtual { v6 , v7 , v8 , v9 } , L androidx/work/Logger ;-> error ( L java/lang/String ;L java/lang/String ;[ L java/lang/Throwable ;) V
:goto_0
if-eqz v4 , :cond_0
:try_start_1
new-array v5 , v1 , [ L java/lang/Class ;
const-class v6 , L android/content/Context ;
aput-object v6 , v5 , v3
const-class v6 , L androidx/work/WorkerParameters ;
aput-object v6 , v5 , v2
invoke-virtual { v4 , v5 } , L java/lang/Class ;-> getDeclaredConstructor ( [ L java/lang/Class ;) L java/lang/reflect/Constructor ;
move-result-object v4
new-array v5 , v1 , [ L java/lang/Object ;
aput-object p1 , v5 , v3
aput-object p3 , v5 , v2
invoke-virtual { v4 , v5 } , L java/lang/reflect/Constructor ;-> newInstance ( [ L java/lang/Object ;) L java/lang/Object ;
move-result-object p1
check-cast p1 , L androidx/work/ListenableWorker ;
:try_end_1
.catchall { :try_start_1 . . :try_end_1 } :catchall_1
move-object v0 , p1
goto :goto_1
:catchall_1
move-exception p1
invoke-static { } , L androidx/work/Logger ;-> get ( ) L androidx/work/Logger ;
move-result-object p3
sget-object v4 , L androidx/work/WorkerFactory ;-> TAG : L java/lang/String ;
const-string v5 , "Could not instantiate "
2020-11-21 22:11:07 +00:00
invoke-static { v5 , p2 } , L f/e/c/a/a ;-> r ( L java/lang/String ;L java/lang/String ;) L java/lang/String ;
2020-11-12 02:11:44 +00:00
move-result-object v5
new-array v6 , v2 , [ L java/lang/Throwable ;
aput-object p1 , v6 , v3
invoke-virtual { p3 , v4 , v5 , v6 } , L androidx/work/Logger ;-> error ( L java/lang/String ;L java/lang/String ;[ L java/lang/Throwable ;) V
:cond_0
:goto_1
if-eqz v0 , :cond_2
invoke-virtual { v0 } , L androidx/work/ListenableWorker ;-> isUsed ( ) Z
move-result p1
if-nez p1 , :cond_1
goto :goto_2
:cond_1
invoke-virtual { p0 } , L java/lang/Object ;-> getClass ( ) L java/lang/Class ;
move-result-object p1
invoke-virtual { p1 } , L java/lang/Class ;-> getName ( ) L java/lang/String ;
move-result-object p1
new-array p3 , v1 , [ L java/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 } , L java/lang/String ;-> format ( L java/lang/String ;[ L java/lang/Object ;) L java/lang/String ;
move-result-object p1
new-instance p2 , L java/lang/IllegalStateException ;
invoke-direct { p2 , p1 } , L java/lang/IllegalStateException ;-> <init> ( L java/lang/String ;) V
throw p2
:cond_2
:goto_2
return-object v0
.end method