994 lines
27 KiB
Smali
994 lines
27 KiB
Smali
.class public abstract Lcom/facebook/datasource/AbstractDataSource;
|
|
.super Ljava/lang/Object;
|
|
.source "AbstractDataSource.java"
|
|
|
|
# interfaces
|
|
.implements Lcom/facebook/datasource/DataSource;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">",
|
|
"Ljava/lang/Object;",
|
|
"Lcom/facebook/datasource/DataSource",
|
|
"<TT;>;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field private mDataSourceStatus:Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;
|
|
.annotation build Ljavax/annotation/concurrent/GuardedBy;
|
|
value = "this"
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private mFailureThrowable:Ljava/lang/Throwable;
|
|
.annotation build Ljavax/annotation/concurrent/GuardedBy;
|
|
value = "this"
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private mIsClosed:Z
|
|
.annotation build Ljavax/annotation/concurrent/GuardedBy;
|
|
value = "this"
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private mProgress:F
|
|
.annotation build Ljavax/annotation/concurrent/GuardedBy;
|
|
value = "this"
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private mResult:Ljava/lang/Object;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"TT;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
|
|
.annotation build Ljavax/annotation/concurrent/GuardedBy;
|
|
value = "this"
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private final mSubscribers:Ljava/util/concurrent/ConcurrentLinkedQueue;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/concurrent/ConcurrentLinkedQueue",
|
|
"<",
|
|
"Landroid/util/Pair",
|
|
"<",
|
|
"Lcom/facebook/datasource/DataSubscriber",
|
|
"<TT;>;",
|
|
"Ljava/util/concurrent/Executor;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method protected constructor <init>()V
|
|
.locals 1
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
const/4 v0, 0x0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/facebook/datasource/AbstractDataSource;->mResult:Ljava/lang/Object;
|
|
|
|
iput-object v0, p0, Lcom/facebook/datasource/AbstractDataSource;->mFailureThrowable:Ljava/lang/Throwable;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput v0, p0, Lcom/facebook/datasource/AbstractDataSource;->mProgress:F
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-boolean v0, p0, Lcom/facebook/datasource/AbstractDataSource;->mIsClosed:Z
|
|
|
|
sget-object v0, Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;->IN_PROGRESS:Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;
|
|
|
|
iput-object v0, p0, Lcom/facebook/datasource/AbstractDataSource;->mDataSourceStatus:Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;
|
|
|
|
new-instance v0, Ljava/util/concurrent/ConcurrentLinkedQueue;
|
|
|
|
invoke-direct {v0}, Ljava/util/concurrent/ConcurrentLinkedQueue;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/facebook/datasource/AbstractDataSource;->mSubscribers:Ljava/util/concurrent/ConcurrentLinkedQueue;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private notifyDataSubscriber(Lcom/facebook/datasource/DataSubscriber;Ljava/util/concurrent/Executor;ZZ)V
|
|
.locals 1
|
|
.param p2, "executor" # Ljava/util/concurrent/Executor;
|
|
.param p3, "isFailure" # Z
|
|
.param p4, "isCancellation" # Z
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lcom/facebook/datasource/DataSubscriber",
|
|
"<TT;>;",
|
|
"Ljava/util/concurrent/Executor;",
|
|
"ZZ)V"
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
.local p1, "dataSubscriber":Lcom/facebook/datasource/DataSubscriber;, "Lcom/facebook/datasource/DataSubscriber<TT;>;"
|
|
new-instance v0, Lcom/facebook/datasource/AbstractDataSource$1;
|
|
|
|
invoke-direct {v0, p0, p3, p1, p4}, Lcom/facebook/datasource/AbstractDataSource$1;-><init>(Lcom/facebook/datasource/AbstractDataSource;ZLcom/facebook/datasource/DataSubscriber;Z)V
|
|
|
|
invoke-interface {p2, v0}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private notifyDataSubscribers()V
|
|
.locals 6
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
invoke-virtual {p0}, Lcom/facebook/datasource/AbstractDataSource;->hasFailed()Z
|
|
|
|
move-result v1
|
|
|
|
.local v1, "isFailure":Z
|
|
invoke-direct {p0}, Lcom/facebook/datasource/AbstractDataSource;->wasCancelled()Z
|
|
|
|
move-result v0
|
|
|
|
.local v0, "isCancellation":Z
|
|
iget-object v3, p0, Lcom/facebook/datasource/AbstractDataSource;->mSubscribers:Ljava/util/concurrent/ConcurrentLinkedQueue;
|
|
|
|
invoke-virtual {v3}, Ljava/util/concurrent/ConcurrentLinkedQueue;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v5
|
|
|
|
:goto_0
|
|
invoke-interface {v5}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
invoke-interface {v5}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Landroid/util/Pair;
|
|
|
|
.local v2, "pair":Landroid/util/Pair;, "Landroid/util/Pair<Lcom/facebook/datasource/DataSubscriber<TT;>;Ljava/util/concurrent/Executor;>;"
|
|
iget-object v3, v2, Landroid/util/Pair;->first:Ljava/lang/Object;
|
|
|
|
check-cast v3, Lcom/facebook/datasource/DataSubscriber;
|
|
|
|
iget-object v4, v2, Landroid/util/Pair;->second:Ljava/lang/Object;
|
|
|
|
check-cast v4, Ljava/util/concurrent/Executor;
|
|
|
|
invoke-direct {p0, v3, v4, v1, v0}, Lcom/facebook/datasource/AbstractDataSource;->notifyDataSubscriber(Lcom/facebook/datasource/DataSubscriber;Ljava/util/concurrent/Executor;ZZ)V
|
|
|
|
goto :goto_0
|
|
|
|
.end local v2 # "pair":Landroid/util/Pair;, "Landroid/util/Pair<Lcom/facebook/datasource/DataSubscriber<TT;>;Ljava/util/concurrent/Executor;>;"
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private declared-synchronized setFailureInternal(Ljava/lang/Throwable;)Z
|
|
.locals 2
|
|
.param p1, "throwable" # Ljava/lang/Throwable;
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-boolean v0, p0, Lcom/facebook/datasource/AbstractDataSource;->mIsClosed:Z
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/facebook/datasource/AbstractDataSource;->mDataSourceStatus:Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;
|
|
|
|
sget-object v1, Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;->IN_PROGRESS:Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
if-eq v0, v1, :cond_1
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return v0
|
|
|
|
:cond_1
|
|
:try_start_1
|
|
sget-object v0, Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;->FAILURE:Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;
|
|
|
|
iput-object v0, p0, Lcom/facebook/datasource/AbstractDataSource;->mDataSourceStatus:Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;
|
|
|
|
iput-object p1, p0, Lcom/facebook/datasource/AbstractDataSource;->mFailureThrowable:Ljava/lang/Throwable;
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method private declared-synchronized setProgressInternal(F)Z
|
|
.locals 3
|
|
.param p1, "progress" # F
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
const/4 v0, 0x0
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-boolean v1, p0, Lcom/facebook/datasource/AbstractDataSource;->mIsClosed:Z
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
iget-object v1, p0, Lcom/facebook/datasource/AbstractDataSource;->mDataSourceStatus:Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;
|
|
|
|
sget-object v2, Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;->IN_PROGRESS:Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
if-eq v1, v2, :cond_1
|
|
|
|
:cond_0
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return v0
|
|
|
|
:cond_1
|
|
:try_start_1
|
|
iget v1, p0, Lcom/facebook/datasource/AbstractDataSource;->mProgress:F
|
|
|
|
cmpg-float v1, p1, v1
|
|
|
|
if-ltz v1, :cond_0
|
|
|
|
iput p1, p0, Lcom/facebook/datasource/AbstractDataSource;->mProgress:F
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method private setResultInternal(Ljava/lang/Object;Z)Z
|
|
.locals 3
|
|
.param p1 # Ljava/lang/Object;
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.param p2, "isLast" # Z
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(TT;Z)Z"
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
.local p1, "value":Ljava/lang/Object;, "TT;"
|
|
const/4 v0, 0x0
|
|
|
|
.local v0, "resultToClose":Ljava/lang/Object;, "TT;"
|
|
:try_start_0
|
|
monitor-enter p0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_1
|
|
|
|
:try_start_1
|
|
iget-boolean v1, p0, Lcom/facebook/datasource/AbstractDataSource;->mIsClosed:Z
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
iget-object v1, p0, Lcom/facebook/datasource/AbstractDataSource;->mDataSourceStatus:Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;
|
|
|
|
sget-object v2, Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;->IN_PROGRESS:Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;
|
|
|
|
if-eq v1, v2, :cond_2
|
|
|
|
:cond_0
|
|
move-object v0, p1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
monitor-exit p0
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {p0, v0}, Lcom/facebook/datasource/AbstractDataSource;->closeResult(Ljava/lang/Object;)V
|
|
|
|
.end local v0 # "resultToClose":Ljava/lang/Object;, "TT;"
|
|
:cond_1
|
|
:goto_0
|
|
return v1
|
|
|
|
.restart local v0 # "resultToClose":Ljava/lang/Object;, "TT;"
|
|
:cond_2
|
|
if-eqz p2, :cond_3
|
|
|
|
:try_start_2
|
|
sget-object v1, Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;->SUCCESS:Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;
|
|
|
|
iput-object v1, p0, Lcom/facebook/datasource/AbstractDataSource;->mDataSourceStatus:Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;
|
|
|
|
const/high16 v1, 0x3f800000 # 1.0f
|
|
|
|
iput v1, p0, Lcom/facebook/datasource/AbstractDataSource;->mProgress:F
|
|
|
|
:cond_3
|
|
iget-object v1, p0, Lcom/facebook/datasource/AbstractDataSource;->mResult:Ljava/lang/Object;
|
|
|
|
if-eq v1, p1, :cond_4
|
|
|
|
iget-object v0, p0, Lcom/facebook/datasource/AbstractDataSource;->mResult:Ljava/lang/Object;
|
|
|
|
iput-object p1, p0, Lcom/facebook/datasource/AbstractDataSource;->mResult:Ljava/lang/Object;
|
|
|
|
.end local v0 # "resultToClose":Ljava/lang/Object;, "TT;"
|
|
:cond_4
|
|
const/4 v1, 0x1
|
|
|
|
monitor-exit p0
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {p0, v0}, Lcom/facebook/datasource/AbstractDataSource;->closeResult(Ljava/lang/Object;)V
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception v1
|
|
|
|
:try_start_3
|
|
monitor-exit p0
|
|
:try_end_3
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_0
|
|
|
|
:try_start_4
|
|
throw v1
|
|
:try_end_4
|
|
.catchall {:try_start_4 .. :try_end_4} :catchall_1
|
|
|
|
:catchall_1
|
|
move-exception v1
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
invoke-virtual {p0, v0}, Lcom/facebook/datasource/AbstractDataSource;->closeResult(Ljava/lang/Object;)V
|
|
|
|
:cond_5
|
|
throw v1
|
|
.end method
|
|
|
|
.method private declared-synchronized wasCancelled()Z
|
|
.locals 1
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
invoke-virtual {p0}, Lcom/facebook/datasource/AbstractDataSource;->isClosed()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {p0}, Lcom/facebook/datasource/AbstractDataSource;->isFinished()Z
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public close()Z
|
|
.locals 3
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
const/4 v1, 0x1
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-boolean v2, p0, Lcom/facebook/datasource/AbstractDataSource;->mIsClosed:Z
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
monitor-exit p0
|
|
|
|
:goto_0
|
|
return v1
|
|
|
|
:cond_0
|
|
const/4 v2, 0x1
|
|
|
|
iput-boolean v2, p0, Lcom/facebook/datasource/AbstractDataSource;->mIsClosed:Z
|
|
|
|
iget-object v0, p0, Lcom/facebook/datasource/AbstractDataSource;->mResult:Ljava/lang/Object;
|
|
|
|
.local v0, "resultToClose":Ljava/lang/Object;, "TT;"
|
|
const/4 v2, 0x0
|
|
|
|
iput-object v2, p0, Lcom/facebook/datasource/AbstractDataSource;->mResult:Ljava/lang/Object;
|
|
|
|
monitor-exit p0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_1
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {p0, v0}, Lcom/facebook/datasource/AbstractDataSource;->closeResult(Ljava/lang/Object;)V
|
|
|
|
:cond_1
|
|
invoke-virtual {p0}, Lcom/facebook/datasource/AbstractDataSource;->isFinished()Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_2
|
|
|
|
invoke-direct {p0}, Lcom/facebook/datasource/AbstractDataSource;->notifyDataSubscribers()V
|
|
|
|
:cond_2
|
|
monitor-enter p0
|
|
|
|
:try_start_1
|
|
iget-object v2, p0, Lcom/facebook/datasource/AbstractDataSource;->mSubscribers:Ljava/util/concurrent/ConcurrentLinkedQueue;
|
|
|
|
invoke-virtual {v2}, Ljava/util/concurrent/ConcurrentLinkedQueue;->clear()V
|
|
|
|
monitor-exit p0
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception v1
|
|
|
|
monitor-exit p0
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
throw v1
|
|
|
|
.end local v0 # "resultToClose":Ljava/lang/Object;, "TT;"
|
|
:catchall_1
|
|
move-exception v1
|
|
|
|
:try_start_2
|
|
monitor-exit p0
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_1
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method protected closeResult(Ljava/lang/Object;)V
|
|
.locals 0
|
|
.param p1 # Ljava/lang/Object;
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(TT;)V"
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
.local p1, "result":Ljava/lang/Object;, "TT;"
|
|
return-void
|
|
.end method
|
|
|
|
.method public declared-synchronized getFailureCause()Ljava/lang/Throwable;
|
|
.locals 1
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/facebook/datasource/AbstractDataSource;->mFailureThrowable:Ljava/lang/Throwable;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return-object v0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public declared-synchronized getProgress()F
|
|
.locals 1
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget v0, p0, Lcom/facebook/datasource/AbstractDataSource;->mProgress:F
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return v0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public declared-synchronized getResult()Ljava/lang/Object;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()TT;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/facebook/datasource/AbstractDataSource;->mResult:Ljava/lang/Object;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return-object v0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public declared-synchronized hasFailed()Z
|
|
.locals 2
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/facebook/datasource/AbstractDataSource;->mDataSourceStatus:Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;
|
|
|
|
sget-object v1, Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;->FAILURE:Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public declared-synchronized hasResult()Z
|
|
.locals 1
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/facebook/datasource/AbstractDataSource;->mResult:Ljava/lang/Object;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public declared-synchronized isClosed()Z
|
|
.locals 1
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-boolean v0, p0, Lcom/facebook/datasource/AbstractDataSource;->mIsClosed:Z
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return v0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public declared-synchronized isFinished()Z
|
|
.locals 2
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/facebook/datasource/AbstractDataSource;->mDataSourceStatus:Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;
|
|
|
|
sget-object v1, Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;->IN_PROGRESS:Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method protected notifyProgressUpdate()V
|
|
.locals 5
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
iget-object v3, p0, Lcom/facebook/datasource/AbstractDataSource;->mSubscribers:Ljava/util/concurrent/ConcurrentLinkedQueue;
|
|
|
|
invoke-virtual {v3}, Ljava/util/concurrent/ConcurrentLinkedQueue;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v3
|
|
|
|
:goto_0
|
|
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Landroid/util/Pair;
|
|
|
|
.local v1, "pair":Landroid/util/Pair;, "Landroid/util/Pair<Lcom/facebook/datasource/DataSubscriber<TT;>;Ljava/util/concurrent/Executor;>;"
|
|
iget-object v2, v1, Landroid/util/Pair;->first:Ljava/lang/Object;
|
|
|
|
check-cast v2, Lcom/facebook/datasource/DataSubscriber;
|
|
|
|
.local v2, "subscriber":Lcom/facebook/datasource/DataSubscriber;, "Lcom/facebook/datasource/DataSubscriber<TT;>;"
|
|
iget-object v0, v1, Landroid/util/Pair;->second:Ljava/lang/Object;
|
|
|
|
check-cast v0, Ljava/util/concurrent/Executor;
|
|
|
|
.local v0, "executor":Ljava/util/concurrent/Executor;
|
|
new-instance v4, Lcom/facebook/datasource/AbstractDataSource$2;
|
|
|
|
invoke-direct {v4, p0, v2}, Lcom/facebook/datasource/AbstractDataSource$2;-><init>(Lcom/facebook/datasource/AbstractDataSource;Lcom/facebook/datasource/DataSubscriber;)V
|
|
|
|
invoke-interface {v0, v4}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
|
|
|
|
goto :goto_0
|
|
|
|
.end local v0 # "executor":Ljava/util/concurrent/Executor;
|
|
.end local v1 # "pair":Landroid/util/Pair;, "Landroid/util/Pair<Lcom/facebook/datasource/DataSubscriber<TT;>;Ljava/util/concurrent/Executor;>;"
|
|
.end local v2 # "subscriber":Lcom/facebook/datasource/DataSubscriber;, "Lcom/facebook/datasource/DataSubscriber<TT;>;"
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method protected setFailure(Ljava/lang/Throwable;)Z
|
|
.locals 1
|
|
.param p1, "throwable" # Ljava/lang/Throwable;
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
invoke-direct {p0, p1}, Lcom/facebook/datasource/AbstractDataSource;->setFailureInternal(Ljava/lang/Throwable;)Z
|
|
|
|
move-result v0
|
|
|
|
.local v0, "result":Z
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-direct {p0}, Lcom/facebook/datasource/AbstractDataSource;->notifyDataSubscribers()V
|
|
|
|
:cond_0
|
|
return v0
|
|
.end method
|
|
|
|
.method protected setProgress(F)Z
|
|
.locals 1
|
|
.param p1, "progress" # F
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
invoke-direct {p0, p1}, Lcom/facebook/datasource/AbstractDataSource;->setProgressInternal(F)Z
|
|
|
|
move-result v0
|
|
|
|
.local v0, "result":Z
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {p0}, Lcom/facebook/datasource/AbstractDataSource;->notifyProgressUpdate()V
|
|
|
|
:cond_0
|
|
return v0
|
|
.end method
|
|
|
|
.method protected setResult(Ljava/lang/Object;Z)Z
|
|
.locals 1
|
|
.param p1 # Ljava/lang/Object;
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.param p2, "isLast" # Z
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(TT;Z)Z"
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
.local p1, "value":Ljava/lang/Object;, "TT;"
|
|
invoke-direct {p0, p1, p2}, Lcom/facebook/datasource/AbstractDataSource;->setResultInternal(Ljava/lang/Object;Z)Z
|
|
|
|
move-result v0
|
|
|
|
.local v0, "result":Z
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-direct {p0}, Lcom/facebook/datasource/AbstractDataSource;->notifyDataSubscribers()V
|
|
|
|
:cond_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public subscribe(Lcom/facebook/datasource/DataSubscriber;Ljava/util/concurrent/Executor;)V
|
|
.locals 3
|
|
.param p2, "executor" # Ljava/util/concurrent/Executor;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lcom/facebook/datasource/DataSubscriber",
|
|
"<TT;>;",
|
|
"Ljava/util/concurrent/Executor;",
|
|
")V"
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
.local p0, "this":Lcom/facebook/datasource/AbstractDataSource;, "Lcom/facebook/datasource/AbstractDataSource<TT;>;"
|
|
.local p1, "dataSubscriber":Lcom/facebook/datasource/DataSubscriber;, "Lcom/facebook/datasource/DataSubscriber<TT;>;"
|
|
invoke-static {p1}, Lcom/facebook/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
invoke-static {p2}, Lcom/facebook/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-boolean v1, p0, Lcom/facebook/datasource/AbstractDataSource;->mIsClosed:Z
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
monitor-exit p0
|
|
|
|
:cond_0
|
|
:goto_0
|
|
return-void
|
|
|
|
:cond_1
|
|
iget-object v1, p0, Lcom/facebook/datasource/AbstractDataSource;->mDataSourceStatus:Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;
|
|
|
|
sget-object v2, Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;->IN_PROGRESS:Lcom/facebook/datasource/AbstractDataSource$DataSourceStatus;
|
|
|
|
if-ne v1, v2, :cond_2
|
|
|
|
iget-object v1, p0, Lcom/facebook/datasource/AbstractDataSource;->mSubscribers:Ljava/util/concurrent/ConcurrentLinkedQueue;
|
|
|
|
invoke-static {p1, p2}, Landroid/util/Pair;->create(Ljava/lang/Object;Ljava/lang/Object;)Landroid/util/Pair;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Ljava/util/concurrent/ConcurrentLinkedQueue;->add(Ljava/lang/Object;)Z
|
|
|
|
:cond_2
|
|
invoke-virtual {p0}, Lcom/facebook/datasource/AbstractDataSource;->hasResult()Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_3
|
|
|
|
invoke-virtual {p0}, Lcom/facebook/datasource/AbstractDataSource;->isFinished()Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_3
|
|
|
|
invoke-direct {p0}, Lcom/facebook/datasource/AbstractDataSource;->wasCancelled()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_4
|
|
|
|
:cond_3
|
|
const/4 v0, 0x1
|
|
|
|
.local v0, "shouldNotify":Z
|
|
:goto_1
|
|
monitor-exit p0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {p0}, Lcom/facebook/datasource/AbstractDataSource;->hasFailed()Z
|
|
|
|
move-result v1
|
|
|
|
invoke-direct {p0}, Lcom/facebook/datasource/AbstractDataSource;->wasCancelled()Z
|
|
|
|
move-result v2
|
|
|
|
invoke-direct {p0, p1, p2, v1, v2}, Lcom/facebook/datasource/AbstractDataSource;->notifyDataSubscriber(Lcom/facebook/datasource/DataSubscriber;Ljava/util/concurrent/Executor;ZZ)V
|
|
|
|
goto :goto_0
|
|
|
|
.end local v0 # "shouldNotify":Z
|
|
:cond_4
|
|
const/4 v0, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:catchall_0
|
|
move-exception v1
|
|
|
|
:try_start_1
|
|
monitor-exit p0
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
throw v1
|
|
.end method
|