133 lines
3.9 KiB
Smali
133 lines
3.9 KiB
Smali
|
.class public abstract Landroidx/lifecycle/ComputableLiveData;
|
||
|
.super Ljava/lang/Object;
|
||
|
.source "ComputableLiveData.java"
|
||
|
|
||
|
|
||
|
# annotations
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"<T:",
|
||
|
"Ljava/lang/Object;",
|
||
|
">",
|
||
|
"Ljava/lang/Object;"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
|
||
|
# instance fields
|
||
|
.field final mComputing:Ljava/util/concurrent/atomic/AtomicBoolean;
|
||
|
|
||
|
.field final mExecutor:Ljava/util/concurrent/Executor;
|
||
|
|
||
|
.field final mInvalid:Ljava/util/concurrent/atomic/AtomicBoolean;
|
||
|
|
||
|
.field final mInvalidationRunnable:Ljava/lang/Runnable;
|
||
|
|
||
|
.field final mLiveData:Landroidx/lifecycle/LiveData;
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"Landroidx/lifecycle/LiveData<",
|
||
|
"TT;>;"
|
||
|
}
|
||
|
.end annotation
|
||
|
.end field
|
||
|
|
||
|
.field final mRefreshRunnable:Ljava/lang/Runnable;
|
||
|
|
||
|
|
||
|
# direct methods
|
||
|
.method public constructor <init>()V
|
||
|
.locals 1
|
||
|
|
||
|
invoke-static {}, Landroidx/arch/core/executor/ArchTaskExecutor;->getIOThreadExecutor()Ljava/util/concurrent/Executor;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-direct {p0, v0}, Landroidx/lifecycle/ComputableLiveData;-><init>(Ljava/util/concurrent/Executor;)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public constructor <init>(Ljava/util/concurrent/Executor;)V
|
||
|
.locals 2
|
||
|
|
||
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||
|
|
||
|
new-instance v0, Ljava/util/concurrent/atomic/AtomicBoolean;
|
||
|
|
||
|
const/4 v1, 0x1
|
||
|
|
||
|
invoke-direct {v0, v1}, Ljava/util/concurrent/atomic/AtomicBoolean;-><init>(Z)V
|
||
|
|
||
|
iput-object v0, p0, Landroidx/lifecycle/ComputableLiveData;->mInvalid:Ljava/util/concurrent/atomic/AtomicBoolean;
|
||
|
|
||
|
new-instance v0, Ljava/util/concurrent/atomic/AtomicBoolean;
|
||
|
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
invoke-direct {v0, v1}, Ljava/util/concurrent/atomic/AtomicBoolean;-><init>(Z)V
|
||
|
|
||
|
iput-object v0, p0, Landroidx/lifecycle/ComputableLiveData;->mComputing:Ljava/util/concurrent/atomic/AtomicBoolean;
|
||
|
|
||
|
new-instance v0, Landroidx/lifecycle/ComputableLiveData$2;
|
||
|
|
||
|
invoke-direct {v0, p0}, Landroidx/lifecycle/ComputableLiveData$2;-><init>(Landroidx/lifecycle/ComputableLiveData;)V
|
||
|
|
||
|
iput-object v0, p0, Landroidx/lifecycle/ComputableLiveData;->mRefreshRunnable:Ljava/lang/Runnable;
|
||
|
|
||
|
new-instance v0, Landroidx/lifecycle/ComputableLiveData$3;
|
||
|
|
||
|
invoke-direct {v0, p0}, Landroidx/lifecycle/ComputableLiveData$3;-><init>(Landroidx/lifecycle/ComputableLiveData;)V
|
||
|
|
||
|
iput-object v0, p0, Landroidx/lifecycle/ComputableLiveData;->mInvalidationRunnable:Ljava/lang/Runnable;
|
||
|
|
||
|
iput-object p1, p0, Landroidx/lifecycle/ComputableLiveData;->mExecutor:Ljava/util/concurrent/Executor;
|
||
|
|
||
|
new-instance p1, Landroidx/lifecycle/ComputableLiveData$1;
|
||
|
|
||
|
invoke-direct {p1, p0}, Landroidx/lifecycle/ComputableLiveData$1;-><init>(Landroidx/lifecycle/ComputableLiveData;)V
|
||
|
|
||
|
iput-object p1, p0, Landroidx/lifecycle/ComputableLiveData;->mLiveData:Landroidx/lifecycle/LiveData;
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
|
||
|
# virtual methods
|
||
|
.method protected abstract compute()Ljava/lang/Object;
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"()TT;"
|
||
|
}
|
||
|
.end annotation
|
||
|
.end method
|
||
|
|
||
|
.method public getLiveData()Landroidx/lifecycle/LiveData;
|
||
|
.locals 1
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"()",
|
||
|
"Landroidx/lifecycle/LiveData<",
|
||
|
"TT;>;"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
iget-object v0, p0, Landroidx/lifecycle/ComputableLiveData;->mLiveData:Landroidx/lifecycle/LiveData;
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public invalidate()V
|
||
|
.locals 2
|
||
|
|
||
|
invoke-static {}, Landroidx/arch/core/executor/ArchTaskExecutor;->getInstance()Landroidx/arch/core/executor/ArchTaskExecutor;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
iget-object v1, p0, Landroidx/lifecycle/ComputableLiveData;->mInvalidationRunnable:Ljava/lang/Runnable;
|
||
|
|
||
|
invoke-virtual {v0, v1}, Landroidx/arch/core/executor/ArchTaskExecutor;->executeOnMainThread(Ljava/lang/Runnable;)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|