apkfuckery/com.discord/smali/androidx/room/paging/LimitOffsetDataSource.smali
2019-12-06 04:29:40 +01:00

522 lines
16 KiB
Smali

.class public abstract Landroidx/room/paging/LimitOffsetDataSource;
.super Landroidx/paging/PositionalDataSource;
.source "LimitOffsetDataSource.java"
# annotations
.annotation build Landroidx/annotation/RestrictTo;
value = {
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">",
"Landroidx/paging/PositionalDataSource<",
"TT;>;"
}
.end annotation
# instance fields
.field public final mCountQuery:Ljava/lang/String;
.field public final mDb:Landroidx/room/RoomDatabase;
.field public final mInTransaction:Z
.field public final mLimitOffsetQuery:Ljava/lang/String;
.field public final mObserver:Landroidx/room/InvalidationTracker$Observer;
.field public final mSourceQuery:Landroidx/room/RoomSQLiteQuery;
# direct methods
.method public varargs constructor <init>(Landroidx/room/RoomDatabase;Landroidx/room/RoomSQLiteQuery;Z[Ljava/lang/String;)V
.locals 0
invoke-direct {p0}, Landroidx/paging/PositionalDataSource;-><init>()V
iput-object p1, p0, Landroidx/room/paging/LimitOffsetDataSource;->mDb:Landroidx/room/RoomDatabase;
iput-object p2, p0, Landroidx/room/paging/LimitOffsetDataSource;->mSourceQuery:Landroidx/room/RoomSQLiteQuery;
iput-boolean p3, p0, Landroidx/room/paging/LimitOffsetDataSource;->mInTransaction:Z
const-string p2, "SELECT COUNT(*) FROM ( "
invoke-static {p2}, Le/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p2
iget-object p3, p0, Landroidx/room/paging/LimitOffsetDataSource;->mSourceQuery:Landroidx/room/RoomSQLiteQuery;
invoke-virtual {p3}, Landroidx/room/RoomSQLiteQuery;->getSql()Ljava/lang/String;
move-result-object p3
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string p3, " )"
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p2
iput-object p2, p0, Landroidx/room/paging/LimitOffsetDataSource;->mCountQuery:Ljava/lang/String;
const-string p2, "SELECT * FROM ( "
invoke-static {p2}, Le/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p2
iget-object p3, p0, Landroidx/room/paging/LimitOffsetDataSource;->mSourceQuery:Landroidx/room/RoomSQLiteQuery;
invoke-virtual {p3}, Landroidx/room/RoomSQLiteQuery;->getSql()Ljava/lang/String;
move-result-object p3
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string p3, " ) LIMIT ? OFFSET ?"
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p2
iput-object p2, p0, Landroidx/room/paging/LimitOffsetDataSource;->mLimitOffsetQuery:Ljava/lang/String;
new-instance p2, Landroidx/room/paging/LimitOffsetDataSource$1;
invoke-direct {p2, p0, p4}, Landroidx/room/paging/LimitOffsetDataSource$1;-><init>(Landroidx/room/paging/LimitOffsetDataSource;[Ljava/lang/String;)V
iput-object p2, p0, Landroidx/room/paging/LimitOffsetDataSource;->mObserver:Landroidx/room/InvalidationTracker$Observer;
invoke-virtual {p1}, Landroidx/room/RoomDatabase;->getInvalidationTracker()Landroidx/room/InvalidationTracker;
move-result-object p1
iget-object p2, p0, Landroidx/room/paging/LimitOffsetDataSource;->mObserver:Landroidx/room/InvalidationTracker$Observer;
invoke-virtual {p1, p2}, Landroidx/room/InvalidationTracker;->addWeakObserver(Landroidx/room/InvalidationTracker$Observer;)V
return-void
.end method
.method public varargs constructor <init>(Landroidx/room/RoomDatabase;Landroidx/sqlite/db/SupportSQLiteQuery;Z[Ljava/lang/String;)V
.locals 0
invoke-static {p2}, Landroidx/room/RoomSQLiteQuery;->copyFrom(Landroidx/sqlite/db/SupportSQLiteQuery;)Landroidx/room/RoomSQLiteQuery;
move-result-object p2
invoke-direct {p0, p1, p2, p3, p4}, Landroidx/room/paging/LimitOffsetDataSource;-><init>(Landroidx/room/RoomDatabase;Landroidx/room/RoomSQLiteQuery;Z[Ljava/lang/String;)V
return-void
.end method
.method private getSQLiteQuery(II)Landroidx/room/RoomSQLiteQuery;
.locals 4
iget-object v0, p0, Landroidx/room/paging/LimitOffsetDataSource;->mLimitOffsetQuery:Ljava/lang/String;
iget-object v1, p0, Landroidx/room/paging/LimitOffsetDataSource;->mSourceQuery:Landroidx/room/RoomSQLiteQuery;
invoke-virtual {v1}, Landroidx/room/RoomSQLiteQuery;->getArgCount()I
move-result v1
add-int/lit8 v1, v1, 0x2
invoke-static {v0, v1}, Landroidx/room/RoomSQLiteQuery;->acquire(Ljava/lang/String;I)Landroidx/room/RoomSQLiteQuery;
move-result-object v0
iget-object v1, p0, Landroidx/room/paging/LimitOffsetDataSource;->mSourceQuery:Landroidx/room/RoomSQLiteQuery;
invoke-virtual {v0, v1}, Landroidx/room/RoomSQLiteQuery;->copyArgumentsFrom(Landroidx/room/RoomSQLiteQuery;)V
invoke-virtual {v0}, Landroidx/room/RoomSQLiteQuery;->getArgCount()I
move-result v1
add-int/lit8 v1, v1, -0x1
int-to-long v2, p2
invoke-virtual {v0, v1, v2, v3}, Landroidx/room/RoomSQLiteQuery;->bindLong(IJ)V
invoke-virtual {v0}, Landroidx/room/RoomSQLiteQuery;->getArgCount()I
move-result p2
int-to-long v1, p1
invoke-virtual {v0, p2, v1, v2}, Landroidx/room/RoomSQLiteQuery;->bindLong(IJ)V
return-object v0
.end method
# virtual methods
.method public abstract convertRows(Landroid/database/Cursor;)Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/database/Cursor;",
")",
"Ljava/util/List<",
"TT;>;"
}
.end annotation
.end method
.method public countItems()I
.locals 4
iget-object v0, p0, Landroidx/room/paging/LimitOffsetDataSource;->mCountQuery:Ljava/lang/String;
iget-object v1, p0, Landroidx/room/paging/LimitOffsetDataSource;->mSourceQuery:Landroidx/room/RoomSQLiteQuery;
invoke-virtual {v1}, Landroidx/room/RoomSQLiteQuery;->getArgCount()I
move-result v1
invoke-static {v0, v1}, Landroidx/room/RoomSQLiteQuery;->acquire(Ljava/lang/String;I)Landroidx/room/RoomSQLiteQuery;
move-result-object v0
iget-object v1, p0, Landroidx/room/paging/LimitOffsetDataSource;->mSourceQuery:Landroidx/room/RoomSQLiteQuery;
invoke-virtual {v0, v1}, Landroidx/room/RoomSQLiteQuery;->copyArgumentsFrom(Landroidx/room/RoomSQLiteQuery;)V
iget-object v1, p0, Landroidx/room/paging/LimitOffsetDataSource;->mDb:Landroidx/room/RoomDatabase;
invoke-virtual {v1, v0}, Landroidx/room/RoomDatabase;->query(Landroidx/sqlite/db/SupportSQLiteQuery;)Landroid/database/Cursor;
move-result-object v1
:try_start_0
invoke-interface {v1}, Landroid/database/Cursor;->moveToFirst()Z
move-result v2
const/4 v3, 0x0
if-eqz v2, :cond_0
invoke-interface {v1, v3}, Landroid/database/Cursor;->getInt(I)I
move-result v2
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
invoke-interface {v1}, Landroid/database/Cursor;->close()V
invoke-virtual {v0}, Landroidx/room/RoomSQLiteQuery;->release()V
return v2
:cond_0
invoke-interface {v1}, Landroid/database/Cursor;->close()V
invoke-virtual {v0}, Landroidx/room/RoomSQLiteQuery;->release()V
return v3
:catchall_0
move-exception v2
invoke-interface {v1}, Landroid/database/Cursor;->close()V
invoke-virtual {v0}, Landroidx/room/RoomSQLiteQuery;->release()V
throw v2
.end method
.method public isInvalid()Z
.locals 1
iget-object v0, p0, Landroidx/room/paging/LimitOffsetDataSource;->mDb:Landroidx/room/RoomDatabase;
invoke-virtual {v0}, Landroidx/room/RoomDatabase;->getInvalidationTracker()Landroidx/room/InvalidationTracker;
move-result-object v0
invoke-virtual {v0}, Landroidx/room/InvalidationTracker;->refreshVersionsSync()V
invoke-super {p0}, Landroidx/paging/PositionalDataSource;->isInvalid()Z
move-result v0
return v0
.end method
.method public loadInitial(Landroidx/paging/PositionalDataSource$LoadInitialParams;Landroidx/paging/PositionalDataSource$LoadInitialCallback;)V
.locals 5
.param p1 # Landroidx/paging/PositionalDataSource$LoadInitialParams;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Landroidx/paging/PositionalDataSource$LoadInitialCallback;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroidx/paging/PositionalDataSource$LoadInitialParams;",
"Landroidx/paging/PositionalDataSource$LoadInitialCallback<",
"TT;>;)V"
}
.end annotation
invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List;
move-result-object v0
iget-object v1, p0, Landroidx/room/paging/LimitOffsetDataSource;->mDb:Landroidx/room/RoomDatabase;
invoke-virtual {v1}, Landroidx/room/RoomDatabase;->beginTransaction()V
const/4 v1, 0x0
:try_start_0
invoke-virtual {p0}, Landroidx/room/paging/LimitOffsetDataSource;->countItems()I
move-result v2
if-eqz v2, :cond_0
invoke-static {p1, v2}, Landroidx/room/paging/LimitOffsetDataSource;->computeInitialLoadPosition(Landroidx/paging/PositionalDataSource$LoadInitialParams;I)I
move-result v0
invoke-static {p1, v0, v2}, Landroidx/room/paging/LimitOffsetDataSource;->computeInitialLoadSize(Landroidx/paging/PositionalDataSource$LoadInitialParams;II)I
move-result p1
invoke-direct {p0, v0, p1}, Landroidx/room/paging/LimitOffsetDataSource;->getSQLiteQuery(II)Landroidx/room/RoomSQLiteQuery;
move-result-object p1
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_1
:try_start_1
iget-object v3, p0, Landroidx/room/paging/LimitOffsetDataSource;->mDb:Landroidx/room/RoomDatabase;
invoke-virtual {v3, p1}, Landroidx/room/RoomDatabase;->query(Landroidx/sqlite/db/SupportSQLiteQuery;)Landroid/database/Cursor;
move-result-object v1
invoke-virtual {p0, v1}, Landroidx/room/paging/LimitOffsetDataSource;->convertRows(Landroid/database/Cursor;)Ljava/util/List;
move-result-object v3
iget-object v4, p0, Landroidx/room/paging/LimitOffsetDataSource;->mDb:Landroidx/room/RoomDatabase;
invoke-virtual {v4}, Landroidx/room/RoomDatabase;->setTransactionSuccessful()V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
goto :goto_0
:catchall_0
move-exception p2
goto :goto_1
:cond_0
const/4 p1, 0x0
move-object v3, v0
move-object p1, v1
const/4 v0, 0x0
:goto_0
if-eqz v1, :cond_1
invoke-interface {v1}, Landroid/database/Cursor;->close()V
:cond_1
iget-object v1, p0, Landroidx/room/paging/LimitOffsetDataSource;->mDb:Landroidx/room/RoomDatabase;
invoke-virtual {v1}, Landroidx/room/RoomDatabase;->endTransaction()V
if-eqz p1, :cond_2
invoke-virtual {p1}, Landroidx/room/RoomSQLiteQuery;->release()V
:cond_2
invoke-virtual {p2, v3, v0, v2}, Landroidx/paging/PositionalDataSource$LoadInitialCallback;->onResult(Ljava/util/List;II)V
return-void
:catchall_1
move-exception p2
move-object p1, v1
:goto_1
if-eqz v1, :cond_3
invoke-interface {v1}, Landroid/database/Cursor;->close()V
:cond_3
iget-object v0, p0, Landroidx/room/paging/LimitOffsetDataSource;->mDb:Landroidx/room/RoomDatabase;
invoke-virtual {v0}, Landroidx/room/RoomDatabase;->endTransaction()V
if-eqz p1, :cond_4
invoke-virtual {p1}, Landroidx/room/RoomSQLiteQuery;->release()V
:cond_4
throw p2
.end method
.method public loadRange(II)Ljava/util/List;
.locals 2
.annotation build Landroidx/annotation/NonNull;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"(II)",
"Ljava/util/List<",
"TT;>;"
}
.end annotation
invoke-direct {p0, p1, p2}, Landroidx/room/paging/LimitOffsetDataSource;->getSQLiteQuery(II)Landroidx/room/RoomSQLiteQuery;
move-result-object p1
iget-boolean p2, p0, Landroidx/room/paging/LimitOffsetDataSource;->mInTransaction:Z
if-eqz p2, :cond_2
iget-object p2, p0, Landroidx/room/paging/LimitOffsetDataSource;->mDb:Landroidx/room/RoomDatabase;
invoke-virtual {p2}, Landroidx/room/RoomDatabase;->beginTransaction()V
const/4 p2, 0x0
:try_start_0
iget-object v0, p0, Landroidx/room/paging/LimitOffsetDataSource;->mDb:Landroidx/room/RoomDatabase;
invoke-virtual {v0, p1}, Landroidx/room/RoomDatabase;->query(Landroidx/sqlite/db/SupportSQLiteQuery;)Landroid/database/Cursor;
move-result-object p2
invoke-virtual {p0, p2}, Landroidx/room/paging/LimitOffsetDataSource;->convertRows(Landroid/database/Cursor;)Ljava/util/List;
move-result-object v0
iget-object v1, p0, Landroidx/room/paging/LimitOffsetDataSource;->mDb:Landroidx/room/RoomDatabase;
invoke-virtual {v1}, Landroidx/room/RoomDatabase;->setTransactionSuccessful()V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-eqz p2, :cond_0
invoke-interface {p2}, Landroid/database/Cursor;->close()V
:cond_0
iget-object p2, p0, Landroidx/room/paging/LimitOffsetDataSource;->mDb:Landroidx/room/RoomDatabase;
invoke-virtual {p2}, Landroidx/room/RoomDatabase;->endTransaction()V
invoke-virtual {p1}, Landroidx/room/RoomSQLiteQuery;->release()V
return-object v0
:catchall_0
move-exception v0
if-eqz p2, :cond_1
invoke-interface {p2}, Landroid/database/Cursor;->close()V
:cond_1
iget-object p2, p0, Landroidx/room/paging/LimitOffsetDataSource;->mDb:Landroidx/room/RoomDatabase;
invoke-virtual {p2}, Landroidx/room/RoomDatabase;->endTransaction()V
invoke-virtual {p1}, Landroidx/room/RoomSQLiteQuery;->release()V
throw v0
:cond_2
iget-object p2, p0, Landroidx/room/paging/LimitOffsetDataSource;->mDb:Landroidx/room/RoomDatabase;
invoke-virtual {p2, p1}, Landroidx/room/RoomDatabase;->query(Landroidx/sqlite/db/SupportSQLiteQuery;)Landroid/database/Cursor;
move-result-object p2
:try_start_1
invoke-virtual {p0, p2}, Landroidx/room/paging/LimitOffsetDataSource;->convertRows(Landroid/database/Cursor;)Ljava/util/List;
move-result-object v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_1
invoke-interface {p2}, Landroid/database/Cursor;->close()V
invoke-virtual {p1}, Landroidx/room/RoomSQLiteQuery;->release()V
return-object v0
:catchall_1
move-exception v0
invoke-interface {p2}, Landroid/database/Cursor;->close()V
invoke-virtual {p1}, Landroidx/room/RoomSQLiteQuery;->release()V
throw v0
.end method
.method public loadRange(Landroidx/paging/PositionalDataSource$LoadRangeParams;Landroidx/paging/PositionalDataSource$LoadRangeCallback;)V
.locals 1
.param p1 # Landroidx/paging/PositionalDataSource$LoadRangeParams;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Landroidx/paging/PositionalDataSource$LoadRangeCallback;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroidx/paging/PositionalDataSource$LoadRangeParams;",
"Landroidx/paging/PositionalDataSource$LoadRangeCallback<",
"TT;>;)V"
}
.end annotation
iget v0, p1, Landroidx/paging/PositionalDataSource$LoadRangeParams;->startPosition:I
iget p1, p1, Landroidx/paging/PositionalDataSource$LoadRangeParams;->loadSize:I
invoke-virtual {p0, v0, p1}, Landroidx/room/paging/LimitOffsetDataSource;->loadRange(II)Ljava/util/List;
move-result-object p1
invoke-virtual {p2, p1}, Landroidx/paging/PositionalDataSource$LoadRangeCallback;->onResult(Ljava/util/List;)V
return-void
.end method