165 lines
5.1 KiB
Smali
165 lines
5.1 KiB
Smali
.class public Landroidx/arch/core/executor/ArchTaskExecutor;
|
|
.super Landroidx/arch/core/executor/TaskExecutor;
|
|
.source "ArchTaskExecutor.java"
|
|
|
|
|
|
# static fields
|
|
.field private static final sIOThreadExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
.field private static volatile sInstance:Landroidx/arch/core/executor/ArchTaskExecutor;
|
|
|
|
.field private static final sMainThreadExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
|
|
# instance fields
|
|
.field private mDefaultTaskExecutor:Landroidx/arch/core/executor/TaskExecutor;
|
|
|
|
.field private mDelegate:Landroidx/arch/core/executor/TaskExecutor;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Landroidx/arch/core/executor/ArchTaskExecutor$1;
|
|
|
|
invoke-direct {v0}, Landroidx/arch/core/executor/ArchTaskExecutor$1;-><init>()V
|
|
|
|
sput-object v0, Landroidx/arch/core/executor/ArchTaskExecutor;->sMainThreadExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
new-instance v0, Landroidx/arch/core/executor/ArchTaskExecutor$2;
|
|
|
|
invoke-direct {v0}, Landroidx/arch/core/executor/ArchTaskExecutor$2;-><init>()V
|
|
|
|
sput-object v0, Landroidx/arch/core/executor/ArchTaskExecutor;->sIOThreadExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private constructor <init>()V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Landroidx/arch/core/executor/TaskExecutor;-><init>()V
|
|
|
|
new-instance v0, Landroidx/arch/core/executor/DefaultTaskExecutor;
|
|
|
|
invoke-direct {v0}, Landroidx/arch/core/executor/DefaultTaskExecutor;-><init>()V
|
|
|
|
iput-object v0, p0, Landroidx/arch/core/executor/ArchTaskExecutor;->mDefaultTaskExecutor:Landroidx/arch/core/executor/TaskExecutor;
|
|
|
|
iget-object v0, p0, Landroidx/arch/core/executor/ArchTaskExecutor;->mDefaultTaskExecutor:Landroidx/arch/core/executor/TaskExecutor;
|
|
|
|
iput-object v0, p0, Landroidx/arch/core/executor/ArchTaskExecutor;->mDelegate:Landroidx/arch/core/executor/TaskExecutor;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static getIOThreadExecutor()Ljava/util/concurrent/Executor;
|
|
.locals 1
|
|
|
|
sget-object v0, Landroidx/arch/core/executor/ArchTaskExecutor;->sIOThreadExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static getInstance()Landroidx/arch/core/executor/ArchTaskExecutor;
|
|
.locals 2
|
|
|
|
sget-object v0, Landroidx/arch/core/executor/ArchTaskExecutor;->sInstance:Landroidx/arch/core/executor/ArchTaskExecutor;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
sget-object v0, Landroidx/arch/core/executor/ArchTaskExecutor;->sInstance:Landroidx/arch/core/executor/ArchTaskExecutor;
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
const-class v0, Landroidx/arch/core/executor/ArchTaskExecutor;
|
|
|
|
monitor-enter v0
|
|
|
|
:try_start_0
|
|
sget-object v1, Landroidx/arch/core/executor/ArchTaskExecutor;->sInstance:Landroidx/arch/core/executor/ArchTaskExecutor;
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
new-instance v1, Landroidx/arch/core/executor/ArchTaskExecutor;
|
|
|
|
invoke-direct {v1}, Landroidx/arch/core/executor/ArchTaskExecutor;-><init>()V
|
|
|
|
sput-object v1, Landroidx/arch/core/executor/ArchTaskExecutor;->sInstance:Landroidx/arch/core/executor/ArchTaskExecutor;
|
|
|
|
:cond_1
|
|
monitor-exit v0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
sget-object v0, Landroidx/arch/core/executor/ArchTaskExecutor;->sInstance:Landroidx/arch/core/executor/ArchTaskExecutor;
|
|
|
|
return-object v0
|
|
|
|
:catchall_0
|
|
move-exception v1
|
|
|
|
:try_start_1
|
|
monitor-exit v0
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method public static getMainThreadExecutor()Ljava/util/concurrent/Executor;
|
|
.locals 1
|
|
|
|
sget-object v0, Landroidx/arch/core/executor/ArchTaskExecutor;->sMainThreadExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public executeOnDiskIO(Ljava/lang/Runnable;)V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Landroidx/arch/core/executor/ArchTaskExecutor;->mDelegate:Landroidx/arch/core/executor/TaskExecutor;
|
|
|
|
invoke-virtual {v0, p1}, Landroidx/arch/core/executor/TaskExecutor;->executeOnDiskIO(Ljava/lang/Runnable;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public isMainThread()Z
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Landroidx/arch/core/executor/ArchTaskExecutor;->mDelegate:Landroidx/arch/core/executor/TaskExecutor;
|
|
|
|
invoke-virtual {v0}, Landroidx/arch/core/executor/TaskExecutor;->isMainThread()Z
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public postToMainThread(Ljava/lang/Runnable;)V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Landroidx/arch/core/executor/ArchTaskExecutor;->mDelegate:Landroidx/arch/core/executor/TaskExecutor;
|
|
|
|
invoke-virtual {v0, p1}, Landroidx/arch/core/executor/TaskExecutor;->postToMainThread(Ljava/lang/Runnable;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setDelegate(Landroidx/arch/core/executor/TaskExecutor;)V
|
|
.locals 0
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
iget-object p1, p0, Landroidx/arch/core/executor/ArchTaskExecutor;->mDefaultTaskExecutor:Landroidx/arch/core/executor/TaskExecutor;
|
|
|
|
:cond_0
|
|
iput-object p1, p0, Landroidx/arch/core/executor/ArchTaskExecutor;->mDelegate:Landroidx/arch/core/executor/TaskExecutor;
|
|
|
|
return-void
|
|
.end method
|