apkfuckery/com.discord/smali/androidx/lifecycle/LiveData.smali
2020-09-16 23:45:23 +00:00

745 lines
19 KiB
Smali

.class public abstract Landroidx/lifecycle/LiveData;
.super Ljava/lang/Object;
.source "LiveData.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/lifecycle/LiveData$AlwaysActiveObserver;,
Landroidx/lifecycle/LiveData$ObserverWrapper;,
Landroidx/lifecycle/LiveData$LifecycleBoundObserver;
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">",
"Ljava/lang/Object;"
}
.end annotation
# static fields
.field public static final NOT_SET:Ljava/lang/Object;
.field public static final START_VERSION:I = -0x1
# instance fields
.field public mActiveCount:I
.field public volatile mData:Ljava/lang/Object;
.field public final mDataLock:Ljava/lang/Object;
.field public mDispatchInvalidated:Z
.field public mDispatchingValue:Z
.field public mObservers:Landroidx/arch/core/internal/SafeIterableMap;
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroidx/arch/core/internal/SafeIterableMap<",
"Landroidx/lifecycle/Observer<",
"-TT;>;",
"Landroidx/lifecycle/LiveData<",
"TT;>.ObserverWrapper;>;"
}
.end annotation
.end field
.field public volatile mPendingData:Ljava/lang/Object;
.field public final mPostValueRunnable:Ljava/lang/Runnable;
.field public mVersion:I
# direct methods
.method public static constructor <clinit>()V
.locals 1
new-instance v0, Ljava/lang/Object;
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
sput-object v0, Landroidx/lifecycle/LiveData;->NOT_SET:Ljava/lang/Object;
return-void
.end method
.method public constructor <init>()V
.locals 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
new-instance v0, Ljava/lang/Object;
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
iput-object v0, p0, Landroidx/lifecycle/LiveData;->mDataLock:Ljava/lang/Object;
new-instance v0, Landroidx/arch/core/internal/SafeIterableMap;
invoke-direct {v0}, Landroidx/arch/core/internal/SafeIterableMap;-><init>()V
iput-object v0, p0, Landroidx/lifecycle/LiveData;->mObservers:Landroidx/arch/core/internal/SafeIterableMap;
const/4 v0, 0x0
iput v0, p0, Landroidx/lifecycle/LiveData;->mActiveCount:I
sget-object v0, Landroidx/lifecycle/LiveData;->NOT_SET:Ljava/lang/Object;
iput-object v0, p0, Landroidx/lifecycle/LiveData;->mPendingData:Ljava/lang/Object;
new-instance v0, Landroidx/lifecycle/LiveData$1;
invoke-direct {v0, p0}, Landroidx/lifecycle/LiveData$1;-><init>(Landroidx/lifecycle/LiveData;)V
iput-object v0, p0, Landroidx/lifecycle/LiveData;->mPostValueRunnable:Ljava/lang/Runnable;
sget-object v0, Landroidx/lifecycle/LiveData;->NOT_SET:Ljava/lang/Object;
iput-object v0, p0, Landroidx/lifecycle/LiveData;->mData:Ljava/lang/Object;
const/4 v0, -0x1
iput v0, p0, Landroidx/lifecycle/LiveData;->mVersion:I
return-void
.end method
.method public constructor <init>(Ljava/lang/Object;)V
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(TT;)V"
}
.end annotation
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
new-instance v0, Ljava/lang/Object;
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
iput-object v0, p0, Landroidx/lifecycle/LiveData;->mDataLock:Ljava/lang/Object;
new-instance v0, Landroidx/arch/core/internal/SafeIterableMap;
invoke-direct {v0}, Landroidx/arch/core/internal/SafeIterableMap;-><init>()V
iput-object v0, p0, Landroidx/lifecycle/LiveData;->mObservers:Landroidx/arch/core/internal/SafeIterableMap;
const/4 v0, 0x0
iput v0, p0, Landroidx/lifecycle/LiveData;->mActiveCount:I
sget-object v1, Landroidx/lifecycle/LiveData;->NOT_SET:Ljava/lang/Object;
iput-object v1, p0, Landroidx/lifecycle/LiveData;->mPendingData:Ljava/lang/Object;
new-instance v1, Landroidx/lifecycle/LiveData$1;
invoke-direct {v1, p0}, Landroidx/lifecycle/LiveData$1;-><init>(Landroidx/lifecycle/LiveData;)V
iput-object v1, p0, Landroidx/lifecycle/LiveData;->mPostValueRunnable:Ljava/lang/Runnable;
iput-object p1, p0, Landroidx/lifecycle/LiveData;->mData:Ljava/lang/Object;
iput v0, p0, Landroidx/lifecycle/LiveData;->mVersion:I
return-void
.end method
.method public static assertMainThread(Ljava/lang/String;)V
.locals 3
invoke-static {}, Landroidx/arch/core/executor/ArchTaskExecutor;->getInstance()Landroidx/arch/core/executor/ArchTaskExecutor;
move-result-object v0
invoke-virtual {v0}, Landroidx/arch/core/executor/ArchTaskExecutor;->isMainThread()Z
move-result v0
if-eqz v0, :cond_0
return-void
:cond_0
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "Cannot invoke "
const-string v2, " on a background thread"
invoke-static {v1, p0, v2}, Lf/e/b/a/a;->r(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object p0
invoke-direct {v0, p0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method private considerNotify(Landroidx/lifecycle/LiveData$ObserverWrapper;)V
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroidx/lifecycle/LiveData<",
"TT;>.ObserverWrapper;)V"
}
.end annotation
iget-boolean v0, p1, Landroidx/lifecycle/LiveData$ObserverWrapper;->mActive:Z
if-nez v0, :cond_0
return-void
:cond_0
invoke-virtual {p1}, Landroidx/lifecycle/LiveData$ObserverWrapper;->shouldBeActive()Z
move-result v0
if-nez v0, :cond_1
const/4 v0, 0x0
invoke-virtual {p1, v0}, Landroidx/lifecycle/LiveData$ObserverWrapper;->activeStateChanged(Z)V
return-void
:cond_1
iget v0, p1, Landroidx/lifecycle/LiveData$ObserverWrapper;->mLastVersion:I
iget v1, p0, Landroidx/lifecycle/LiveData;->mVersion:I
if-lt v0, v1, :cond_2
return-void
:cond_2
iput v1, p1, Landroidx/lifecycle/LiveData$ObserverWrapper;->mLastVersion:I
iget-object p1, p1, Landroidx/lifecycle/LiveData$ObserverWrapper;->mObserver:Landroidx/lifecycle/Observer;
iget-object v0, p0, Landroidx/lifecycle/LiveData;->mData:Ljava/lang/Object;
invoke-interface {p1, v0}, Landroidx/lifecycle/Observer;->onChanged(Ljava/lang/Object;)V
return-void
.end method
# virtual methods
.method public dispatchingValue(Landroidx/lifecycle/LiveData$ObserverWrapper;)V
.locals 3
.param p1 # Landroidx/lifecycle/LiveData$ObserverWrapper;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroidx/lifecycle/LiveData<",
"TT;>.ObserverWrapper;)V"
}
.end annotation
iget-boolean v0, p0, Landroidx/lifecycle/LiveData;->mDispatchingValue:Z
const/4 v1, 0x1
if-eqz v0, :cond_0
iput-boolean v1, p0, Landroidx/lifecycle/LiveData;->mDispatchInvalidated:Z
return-void
:cond_0
iput-boolean v1, p0, Landroidx/lifecycle/LiveData;->mDispatchingValue:Z
:cond_1
const/4 v0, 0x0
iput-boolean v0, p0, Landroidx/lifecycle/LiveData;->mDispatchInvalidated:Z
if-eqz p1, :cond_2
invoke-direct {p0, p1}, Landroidx/lifecycle/LiveData;->considerNotify(Landroidx/lifecycle/LiveData$ObserverWrapper;)V
const/4 p1, 0x0
goto :goto_0
:cond_2
iget-object v1, p0, Landroidx/lifecycle/LiveData;->mObservers:Landroidx/arch/core/internal/SafeIterableMap;
invoke-virtual {v1}, Landroidx/arch/core/internal/SafeIterableMap;->iteratorWithAdditions()Landroidx/arch/core/internal/SafeIterableMap$IteratorWithAdditions;
move-result-object v1
:cond_3
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_4
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Ljava/util/Map$Entry;
invoke-interface {v2}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroidx/lifecycle/LiveData$ObserverWrapper;
invoke-direct {p0, v2}, Landroidx/lifecycle/LiveData;->considerNotify(Landroidx/lifecycle/LiveData$ObserverWrapper;)V
iget-boolean v2, p0, Landroidx/lifecycle/LiveData;->mDispatchInvalidated:Z
if-eqz v2, :cond_3
:cond_4
:goto_0
iget-boolean v1, p0, Landroidx/lifecycle/LiveData;->mDispatchInvalidated:Z
if-nez v1, :cond_1
iput-boolean v0, p0, Landroidx/lifecycle/LiveData;->mDispatchingValue:Z
return-void
.end method
.method public getValue()Ljava/lang/Object;
.locals 2
.annotation build Landroidx/annotation/Nullable;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"()TT;"
}
.end annotation
iget-object v0, p0, Landroidx/lifecycle/LiveData;->mData:Ljava/lang/Object;
sget-object v1, Landroidx/lifecycle/LiveData;->NOT_SET:Ljava/lang/Object;
if-eq v0, v1, :cond_0
return-object v0
:cond_0
const/4 v0, 0x0
return-object v0
.end method
.method public getVersion()I
.locals 1
iget v0, p0, Landroidx/lifecycle/LiveData;->mVersion:I
return v0
.end method
.method public hasActiveObservers()Z
.locals 1
iget v0, p0, Landroidx/lifecycle/LiveData;->mActiveCount:I
if-lez v0, :cond_0
const/4 v0, 0x1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
return v0
.end method
.method public hasObservers()Z
.locals 1
iget-object v0, p0, Landroidx/lifecycle/LiveData;->mObservers:Landroidx/arch/core/internal/SafeIterableMap;
invoke-virtual {v0}, Landroidx/arch/core/internal/SafeIterableMap;->size()I
move-result v0
if-lez v0, :cond_0
const/4 v0, 0x1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
return v0
.end method
.method public observe(Landroidx/lifecycle/LifecycleOwner;Landroidx/lifecycle/Observer;)V
.locals 2
.param p1 # Landroidx/lifecycle/LifecycleOwner;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Landroidx/lifecycle/Observer;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/MainThread;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroidx/lifecycle/LifecycleOwner;",
"Landroidx/lifecycle/Observer<",
"-TT;>;)V"
}
.end annotation
const-string v0, "observe"
invoke-static {v0}, Landroidx/lifecycle/LiveData;->assertMainThread(Ljava/lang/String;)V
invoke-interface {p1}, Landroidx/lifecycle/LifecycleOwner;->getLifecycle()Landroidx/lifecycle/Lifecycle;
move-result-object v0
invoke-virtual {v0}, Landroidx/lifecycle/Lifecycle;->getCurrentState()Landroidx/lifecycle/Lifecycle$State;
move-result-object v0
sget-object v1, Landroidx/lifecycle/Lifecycle$State;->DESTROYED:Landroidx/lifecycle/Lifecycle$State;
if-ne v0, v1, :cond_0
return-void
:cond_0
new-instance v0, Landroidx/lifecycle/LiveData$LifecycleBoundObserver;
invoke-direct {v0, p0, p1, p2}, Landroidx/lifecycle/LiveData$LifecycleBoundObserver;-><init>(Landroidx/lifecycle/LiveData;Landroidx/lifecycle/LifecycleOwner;Landroidx/lifecycle/Observer;)V
iget-object v1, p0, Landroidx/lifecycle/LiveData;->mObservers:Landroidx/arch/core/internal/SafeIterableMap;
invoke-virtual {v1, p2, v0}, Landroidx/arch/core/internal/SafeIterableMap;->putIfAbsent(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p2
check-cast p2, Landroidx/lifecycle/LiveData$ObserverWrapper;
if-eqz p2, :cond_2
invoke-virtual {p2, p1}, Landroidx/lifecycle/LiveData$ObserverWrapper;->isAttachedTo(Landroidx/lifecycle/LifecycleOwner;)Z
move-result v1
if-eqz v1, :cond_1
goto :goto_0
:cond_1
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string p2, "Cannot add the same observer with different lifecycles"
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
:cond_2
:goto_0
if-eqz p2, :cond_3
return-void
:cond_3
invoke-interface {p1}, Landroidx/lifecycle/LifecycleOwner;->getLifecycle()Landroidx/lifecycle/Lifecycle;
move-result-object p1
invoke-virtual {p1, v0}, Landroidx/lifecycle/Lifecycle;->addObserver(Landroidx/lifecycle/LifecycleObserver;)V
return-void
.end method
.method public observeForever(Landroidx/lifecycle/Observer;)V
.locals 2
.param p1 # Landroidx/lifecycle/Observer;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/MainThread;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroidx/lifecycle/Observer<",
"-TT;>;)V"
}
.end annotation
const-string v0, "observeForever"
invoke-static {v0}, Landroidx/lifecycle/LiveData;->assertMainThread(Ljava/lang/String;)V
new-instance v0, Landroidx/lifecycle/LiveData$AlwaysActiveObserver;
invoke-direct {v0, p0, p1}, Landroidx/lifecycle/LiveData$AlwaysActiveObserver;-><init>(Landroidx/lifecycle/LiveData;Landroidx/lifecycle/Observer;)V
iget-object v1, p0, Landroidx/lifecycle/LiveData;->mObservers:Landroidx/arch/core/internal/SafeIterableMap;
invoke-virtual {v1, p1, v0}, Landroidx/arch/core/internal/SafeIterableMap;->putIfAbsent(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p1
check-cast p1, Landroidx/lifecycle/LiveData$ObserverWrapper;
instance-of v1, p1, Landroidx/lifecycle/LiveData$LifecycleBoundObserver;
if-nez v1, :cond_1
if-eqz p1, :cond_0
return-void
:cond_0
const/4 p1, 0x1
invoke-virtual {v0, p1}, Landroidx/lifecycle/LiveData$ObserverWrapper;->activeStateChanged(Z)V
return-void
:cond_1
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string v0, "Cannot add the same observer with different lifecycles"
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public onActive()V
.locals 0
return-void
.end method
.method public onInactive()V
.locals 0
return-void
.end method
.method public postValue(Ljava/lang/Object;)V
.locals 3
.annotation system Ldalvik/annotation/Signature;
value = {
"(TT;)V"
}
.end annotation
iget-object v0, p0, Landroidx/lifecycle/LiveData;->mDataLock:Ljava/lang/Object;
monitor-enter v0
:try_start_0
iget-object v1, p0, Landroidx/lifecycle/LiveData;->mPendingData:Ljava/lang/Object;
sget-object v2, Landroidx/lifecycle/LiveData;->NOT_SET:Ljava/lang/Object;
if-ne v1, v2, :cond_0
const/4 v1, 0x1
goto :goto_0
:cond_0
const/4 v1, 0x0
:goto_0
iput-object p1, p0, Landroidx/lifecycle/LiveData;->mPendingData:Ljava/lang/Object;
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-nez v1, :cond_1
return-void
:cond_1
invoke-static {}, Landroidx/arch/core/executor/ArchTaskExecutor;->getInstance()Landroidx/arch/core/executor/ArchTaskExecutor;
move-result-object p1
iget-object v0, p0, Landroidx/lifecycle/LiveData;->mPostValueRunnable:Ljava/lang/Runnable;
invoke-virtual {p1, v0}, Landroidx/arch/core/executor/ArchTaskExecutor;->postToMainThread(Ljava/lang/Runnable;)V
return-void
:catchall_0
move-exception p1
:try_start_1
monitor-exit v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw p1
.end method
.method public removeObserver(Landroidx/lifecycle/Observer;)V
.locals 1
.param p1 # Landroidx/lifecycle/Observer;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/MainThread;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroidx/lifecycle/Observer<",
"-TT;>;)V"
}
.end annotation
const-string v0, "removeObserver"
invoke-static {v0}, Landroidx/lifecycle/LiveData;->assertMainThread(Ljava/lang/String;)V
iget-object v0, p0, Landroidx/lifecycle/LiveData;->mObservers:Landroidx/arch/core/internal/SafeIterableMap;
invoke-virtual {v0, p1}, Landroidx/arch/core/internal/SafeIterableMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p1
check-cast p1, Landroidx/lifecycle/LiveData$ObserverWrapper;
if-nez p1, :cond_0
return-void
:cond_0
invoke-virtual {p1}, Landroidx/lifecycle/LiveData$ObserverWrapper;->detachObserver()V
const/4 v0, 0x0
invoke-virtual {p1, v0}, Landroidx/lifecycle/LiveData$ObserverWrapper;->activeStateChanged(Z)V
return-void
.end method
.method public removeObservers(Landroidx/lifecycle/LifecycleOwner;)V
.locals 3
.param p1 # Landroidx/lifecycle/LifecycleOwner;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/MainThread;
.end annotation
const-string v0, "removeObservers"
invoke-static {v0}, Landroidx/lifecycle/LiveData;->assertMainThread(Ljava/lang/String;)V
iget-object v0, p0, Landroidx/lifecycle/LiveData;->mObservers:Landroidx/arch/core/internal/SafeIterableMap;
invoke-virtual {v0}, Landroidx/arch/core/internal/SafeIterableMap;->iterator()Ljava/util/Iterator;
move-result-object v0
:cond_0
:goto_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, Ljava/util/Map$Entry;
invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroidx/lifecycle/LiveData$ObserverWrapper;
invoke-virtual {v2, p1}, Landroidx/lifecycle/LiveData$ObserverWrapper;->isAttachedTo(Landroidx/lifecycle/LifecycleOwner;)Z
move-result v2
if-eqz v2, :cond_0
invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroidx/lifecycle/Observer;
invoke-virtual {p0, v1}, Landroidx/lifecycle/LiveData;->removeObserver(Landroidx/lifecycle/Observer;)V
goto :goto_0
:cond_1
return-void
.end method
.method public setValue(Ljava/lang/Object;)V
.locals 1
.annotation build Landroidx/annotation/MainThread;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"(TT;)V"
}
.end annotation
const-string v0, "setValue"
invoke-static {v0}, Landroidx/lifecycle/LiveData;->assertMainThread(Ljava/lang/String;)V
iget v0, p0, Landroidx/lifecycle/LiveData;->mVersion:I
add-int/lit8 v0, v0, 0x1
iput v0, p0, Landroidx/lifecycle/LiveData;->mVersion:I
iput-object p1, p0, Landroidx/lifecycle/LiveData;->mData:Ljava/lang/Object;
const/4 p1, 0x0
invoke-virtual {p0, p1}, Landroidx/lifecycle/LiveData;->dispatchingValue(Landroidx/lifecycle/LiveData$ObserverWrapper;)V
return-void
.end method