215 lines
5.5 KiB
Smali
215 lines
5.5 KiB
Smali
.class public final Landroidx/work/Configuration;
|
|
.super Ljava/lang/Object;
|
|
.source "Configuration.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Landroidx/work/Configuration$Provider;,
|
|
Landroidx/work/Configuration$Builder;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final MIN_SCHEDULER_LIMIT:I = 0x14
|
|
|
|
|
|
# instance fields
|
|
.field private final mExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
.field private final mLoggingLevel:I
|
|
|
|
.field private final mMaxJobSchedulerId:I
|
|
|
|
.field private final mMaxSchedulerLimit:I
|
|
|
|
.field private final mMinJobSchedulerId:I
|
|
|
|
.field private final mTaskExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
.field private final mWorkerFactory:Landroidx/work/WorkerFactory;
|
|
|
|
|
|
# direct methods
|
|
.method constructor <init>(Landroidx/work/Configuration$Builder;)V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iget-object v0, p1, Landroidx/work/Configuration$Builder;->mExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
invoke-direct {p0}, Landroidx/work/Configuration;->createDefaultExecutor()Ljava/util/concurrent/Executor;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Landroidx/work/Configuration;->mExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object v0, p1, Landroidx/work/Configuration$Builder;->mExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
iput-object v0, p0, Landroidx/work/Configuration;->mExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
:goto_0
|
|
iget-object v0, p1, Landroidx/work/Configuration$Builder;->mTaskExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
invoke-direct {p0}, Landroidx/work/Configuration;->createDefaultExecutor()Ljava/util/concurrent/Executor;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Landroidx/work/Configuration;->mTaskExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
iget-object v0, p1, Landroidx/work/Configuration$Builder;->mTaskExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
iput-object v0, p0, Landroidx/work/Configuration;->mTaskExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
:goto_1
|
|
iget-object v0, p1, Landroidx/work/Configuration$Builder;->mWorkerFactory:Landroidx/work/WorkerFactory;
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
invoke-static {}, Landroidx/work/WorkerFactory;->getDefaultWorkerFactory()Landroidx/work/WorkerFactory;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Landroidx/work/Configuration;->mWorkerFactory:Landroidx/work/WorkerFactory;
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
iget-object v0, p1, Landroidx/work/Configuration$Builder;->mWorkerFactory:Landroidx/work/WorkerFactory;
|
|
|
|
iput-object v0, p0, Landroidx/work/Configuration;->mWorkerFactory:Landroidx/work/WorkerFactory;
|
|
|
|
:goto_2
|
|
iget v0, p1, Landroidx/work/Configuration$Builder;->mLoggingLevel:I
|
|
|
|
iput v0, p0, Landroidx/work/Configuration;->mLoggingLevel:I
|
|
|
|
iget v0, p1, Landroidx/work/Configuration$Builder;->mMinJobSchedulerId:I
|
|
|
|
iput v0, p0, Landroidx/work/Configuration;->mMinJobSchedulerId:I
|
|
|
|
iget v0, p1, Landroidx/work/Configuration$Builder;->mMaxJobSchedulerId:I
|
|
|
|
iput v0, p0, Landroidx/work/Configuration;->mMaxJobSchedulerId:I
|
|
|
|
iget p1, p1, Landroidx/work/Configuration$Builder;->mMaxSchedulerLimit:I
|
|
|
|
iput p1, p0, Landroidx/work/Configuration;->mMaxSchedulerLimit:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private createDefaultExecutor()Ljava/util/concurrent/Executor;
|
|
.locals 2
|
|
|
|
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Runtime;->availableProcessors()I
|
|
|
|
move-result v0
|
|
|
|
add-int/lit8 v0, v0, -0x1
|
|
|
|
const/4 v1, 0x4
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Math;->min(II)I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x2
|
|
|
|
invoke-static {v1, v0}, Ljava/lang/Math;->max(II)I
|
|
|
|
move-result v0
|
|
|
|
invoke-static {v0}, Ljava/util/concurrent/Executors;->newFixedThreadPool(I)Ljava/util/concurrent/ExecutorService;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final getExecutor()Ljava/util/concurrent/Executor;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Landroidx/work/Configuration;->mExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final getMaxJobSchedulerId()I
|
|
.locals 1
|
|
|
|
iget v0, p0, Landroidx/work/Configuration;->mMaxJobSchedulerId:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public final getMaxSchedulerLimit()I
|
|
.locals 2
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v1, 0x17
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
iget v0, p0, Landroidx/work/Configuration;->mMaxSchedulerLimit:I
|
|
|
|
div-int/lit8 v0, v0, 0x2
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
iget v0, p0, Landroidx/work/Configuration;->mMaxSchedulerLimit:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public final getMinJobSchedulerId()I
|
|
.locals 1
|
|
|
|
iget v0, p0, Landroidx/work/Configuration;->mMinJobSchedulerId:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public final getMinimumLoggingLevel()I
|
|
.locals 1
|
|
|
|
iget v0, p0, Landroidx/work/Configuration;->mLoggingLevel:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public final getTaskExecutor()Ljava/util/concurrent/Executor;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Landroidx/work/Configuration;->mTaskExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final getWorkerFactory()Landroidx/work/WorkerFactory;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Landroidx/work/Configuration;->mWorkerFactory:Landroidx/work/WorkerFactory;
|
|
|
|
return-object v0
|
|
.end method
|