SqliteJobQueue.smali

.class public Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;
.super Ljava/lang/Object;
.source "SourceFile"

# interfaces
.implements Lcom/path/android/jobqueue/JobQueue;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue$JobSerializer;,
        Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue$JavaSerializer;,
        Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue$InvalidJobException;
    }
.end annotation


# instance fields
.field public db:Landroid/database/sqlite/SQLiteDatabase;

.field public dbOpenHelper:Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;

.field public jobSerializer:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue$JobSerializer;

.field public nextJobDelayUntilQueryCache:Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;

.field public nextJobsQueryCache:Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;

.field public pendingCancelations:Ljava/util/Set;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Set<",
            "Ljava/lang/Long;",
            ">;"
        }
    .end annotation
.end field

.field public readyJobsQueryCache:Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;

.field private final sessionId:J

.field public sqlHelper:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;


# direct methods
.method public constructor <init>(Landroid/content/Context;JLjava/lang/String;Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue$JobSerializer;Z)V
    .registers 18

    move-object v0, p0

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    new-instance v1, Ljava/util/HashSet;

    invoke-direct {v1}, Ljava/util/HashSet;-><init>()V

    iput-object v1, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->pendingCancelations:Ljava/util/Set;

    move-wide v9, p2

    .line 3
    iput-wide v9, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sessionId:J

    .line 4
    new-instance v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;

    if-eqz p6, :cond_14

    const/4 v2, 0x0

    goto :goto_1b

    :cond_14
    const-string v2, "db_"

    move-object v3, p4

    .line 5
    invoke-static {v2, p4}, Landroidx/appcompat/e;->g(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    :goto_1b
    move-object v3, p1

    .line 6
    invoke-direct {v1, p1, v2}, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    iput-object v1, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->dbOpenHelper:Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;

    .line 7
    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteOpenHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v3

    iput-object v3, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->db:Landroid/database/sqlite/SQLiteDatabase;

    .line 8
    new-instance v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;

    sget-object v2, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->ID_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget-object v5, v2, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnName:Ljava/lang/String;

    const/16 v6, 0x9

    const/4 v8, 0x3

    const-string v4, "job_holder"

    const-string v7, "job_holder_tags"

    move-object v2, v1

    move-wide v9, p2

    invoke-direct/range {v2 .. v10}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;-><init>(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;IJ)V

    iput-object v1, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sqlHelper:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;

    move-object/from16 v1, p5

    .line 9
    iput-object v1, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->jobSerializer:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue$JobSerializer;

    .line 10
    new-instance v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;

    invoke-direct {v1}, Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;-><init>()V

    iput-object v1, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->readyJobsQueryCache:Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;

    .line 11
    new-instance v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;

    invoke-direct {v1}, Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;-><init>()V

    iput-object v1, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->nextJobsQueryCache:Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;

    .line 12
    new-instance v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;

    invoke-direct {v1}, Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;-><init>()V

    iput-object v1, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->nextJobDelayUntilQueryCache:Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;

    .line 13
    iget-object v1, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sqlHelper:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;

    const-wide/high16 v2, -0x8000000000000000L

    invoke-virtual {v1, v2, v3}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;->resetDelayTimesTo(J)V

    return-void
.end method

.method private bindTag(Landroid/database/sqlite/SQLiteStatement;JLjava/lang/String;)V
    .registers 6

    .line 1
    sget-object v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->TAGS_JOB_ID_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget v0, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnIndex:I

    add-int/lit8 v0, v0, 0x1

    invoke-virtual {p1, v0, p2, p3}, Landroid/database/sqlite/SQLiteProgram;->bindLong(IJ)V

    .line 2
    sget-object p2, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->TAGS_NAME_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget p2, p2, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnIndex:I

    add-int/lit8 p2, p2, 0x1

    invoke-virtual {p1, p2, p4}, Landroid/database/sqlite/SQLiteProgram;->bindString(ILjava/lang/String;)V

    return-void
.end method

.method private bindValues(Landroid/database/sqlite/SQLiteStatement;Lcom/path/android/jobqueue/JobHolder;)V
    .registers 6

    .line 1
    invoke-virtual {p2}, Lcom/path/android/jobqueue/JobHolder;->getId()Ljava/lang/Long;

    move-result-object v0

    if-eqz v0, :cond_17

    .line 2
    sget-object v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->ID_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget v0, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnIndex:I

    add-int/lit8 v0, v0, 0x1

    invoke-virtual {p2}, Lcom/path/android/jobqueue/JobHolder;->getId()Ljava/lang/Long;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Long;->longValue()J

    move-result-wide v1

    invoke-virtual {p1, v0, v1, v2}, Landroid/database/sqlite/SQLiteProgram;->bindLong(IJ)V

    .line 3
    :cond_17
    sget-object v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->PRIORITY_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget v0, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnIndex:I

    add-int/lit8 v0, v0, 0x1

    invoke-virtual {p2}, Lcom/path/android/jobqueue/JobHolder;->getPriority()I

    move-result v1

    int-to-long v1, v1

    invoke-virtual {p1, v0, v1, v2}, Landroid/database/sqlite/SQLiteProgram;->bindLong(IJ)V

    .line 4
    invoke-virtual {p2}, Lcom/path/android/jobqueue/JobHolder;->getGroupId()Ljava/lang/String;

    move-result-object v0

    if-eqz v0, :cond_38

    .line 5
    sget-object v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->GROUP_ID_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget v0, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnIndex:I

    add-int/lit8 v0, v0, 0x1

    invoke-virtual {p2}, Lcom/path/android/jobqueue/JobHolder;->getGroupId()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p1, v0, v1}, Landroid/database/sqlite/SQLiteProgram;->bindString(ILjava/lang/String;)V

    .line 6
    :cond_38
    sget-object v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->RUN_COUNT_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget v0, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnIndex:I

    add-int/lit8 v0, v0, 0x1

    invoke-virtual {p2}, Lcom/path/android/jobqueue/JobHolder;->getRunCount()I

    move-result v1

    int-to-long v1, v1

    invoke-virtual {p1, v0, v1, v2}, Landroid/database/sqlite/SQLiteProgram;->bindLong(IJ)V

    .line 7
    invoke-direct {p0, p2}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->getSerializeJob(Lcom/path/android/jobqueue/JobHolder;)[B

    move-result-object v0

    if-eqz v0, :cond_55

    .line 8
    sget-object v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->BASE_JOB_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget v1, v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnIndex:I

    add-int/lit8 v1, v1, 0x1

    invoke-virtual {p1, v1, v0}, Landroid/database/sqlite/SQLiteProgram;->bindBlob(I[B)V

    .line 9
    :cond_55
    sget-object v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->CREATED_NS_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget v0, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnIndex:I

    add-int/lit8 v0, v0, 0x1

    invoke-virtual {p2}, Lcom/path/android/jobqueue/JobHolder;->getCreatedNs()J

    move-result-wide v1

    invoke-virtual {p1, v0, v1, v2}, Landroid/database/sqlite/SQLiteProgram;->bindLong(IJ)V

    .line 10
    sget-object v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->DELAY_UNTIL_NS_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget v0, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnIndex:I

    add-int/lit8 v0, v0, 0x1

    invoke-virtual {p2}, Lcom/path/android/jobqueue/JobHolder;->getDelayUntilNs()J

    move-result-wide v1

    invoke-virtual {p1, v0, v1, v2}, Landroid/database/sqlite/SQLiteProgram;->bindLong(IJ)V

    .line 11
    sget-object v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->RUNNING_SESSION_ID_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget v0, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnIndex:I

    add-int/lit8 v0, v0, 0x1

    invoke-virtual {p2}, Lcom/path/android/jobqueue/JobHolder;->getRunningSessionId()J

    move-result-wide v1

    invoke-virtual {p1, v0, v1, v2}, Landroid/database/sqlite/SQLiteProgram;->bindLong(IJ)V

    .line 12
    sget-object v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->REQUIRES_NETWORK_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget v0, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnIndex:I

    add-int/lit8 v0, v0, 0x1

    invoke-virtual {p2}, Lcom/path/android/jobqueue/JobHolder;->requiresNetwork()Z

    move-result p2

    if-eqz p2, :cond_8b

    const-wide/16 v1, 0x1

    goto :goto_8d

    :cond_8b
    const-wide/16 v1, 0x0

    :goto_8d
    invoke-virtual {p1, v0, v1, v2}, Landroid/database/sqlite/SQLiteProgram;->bindLong(IJ)V

    return-void
.end method

.method private createJobHolderFromCursor(Landroid/database/Cursor;)Lcom/path/android/jobqueue/JobHolder;
    .registers 15
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue$InvalidJobException;
        }
    .end annotation

    .line 1
    sget-object v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->BASE_JOB_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget v0, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnIndex:I

    invoke-interface {p1, v0}, Landroid/database/Cursor;->getBlob(I)[B

    move-result-object v0

    invoke-direct {p0, v0}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->safeDeserialize([B)Lcom/path/android/jobqueue/Job;

    move-result-object v6

    if-eqz v6, :cond_51

    .line 2
    new-instance v0, Lcom/path/android/jobqueue/JobHolder;

    sget-object v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->ID_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget v1, v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnIndex:I

    invoke-interface {p1, v1}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v1

    invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v2

    sget-object v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->PRIORITY_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget v1, v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnIndex:I

    invoke-interface {p1, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v3

    sget-object v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->GROUP_ID_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget v1, v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnIndex:I

    invoke-interface {p1, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v4

    sget-object v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->RUN_COUNT_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget v1, v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnIndex:I

    invoke-interface {p1, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v5

    sget-object v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->CREATED_NS_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget v1, v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnIndex:I

    invoke-interface {p1, v1}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v7

    sget-object v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->DELAY_UNTIL_NS_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget v1, v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnIndex:I

    invoke-interface {p1, v1}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v9

    sget-object v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->RUNNING_SESSION_ID_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget v1, v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnIndex:I

    invoke-interface {p1, v1}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v11

    move-object v1, v0

    invoke-direct/range {v1 .. v12}, Lcom/path/android/jobqueue/JobHolder;-><init>(Ljava/lang/Long;ILjava/lang/String;ILcom/path/android/jobqueue/Job;JJJ)V

    return-object v0

    .line 3
    :cond_51
    new-instance p1, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue$InvalidJobException;

    const/4 v0, 0x0

    invoke-direct {p1, v0}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue$InvalidJobException;-><init>(Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue$1;)V

    throw p1
.end method

.method private createReadyJobWhereSql(ZLjava/util/Collection;Z)Ljava/lang/String;
    .registers 8
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(Z",
            "Ljava/util/Collection<",
            "Ljava/lang/String;",
            ">;Z)",
            "Ljava/lang/String;"
        }
    .end annotation

    .line 1
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    sget-object v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->RUNNING_SESSION_ID_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget-object v1, v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnName:Ljava/lang/String;

    const-string v2, " != ? "

    const-string v3, " AND "

    .line 2
    invoke-static {v0, v1, v2, v3}, Landroidx/concurrent/futures/a;->j(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 3
    sget-object v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->DELAY_UNTIL_NS_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget-object v1, v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnName:Ljava/lang/String;

    const-string v2, " <= ? "

    .line 4
    invoke-static {v0, v1, v2}, Landroid/support/v4/media/session/b;->d(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    if-nez p1, :cond_2a

    .line 5
    invoke-static {v0, v3}, Landroidx/appcompat/p;->d(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object p1

    .line 6
    sget-object v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->REQUIRES_NETWORK_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget-object v0, v0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnName:Ljava/lang/String;

    const-string v1, " != 1 "

    .line 7
    invoke-static {p1, v0, v1}, Landroid/support/v4/media/session/b;->d(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    :cond_2a
    const/4 p1, 0x0

    if-eqz p2, :cond_60

    .line 8
    invoke-interface {p2}, Ljava/util/Collection;->size()I

    move-result v1

    if-lez v1, :cond_60

    .line 9
    new-instance p1, Ljava/lang/StringBuilder;

    invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V

    sget-object v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->GROUP_ID_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget-object v2, v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnName:Ljava/lang/String;

    invoke-virtual {p1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v2, " IS NULL OR "

    invoke-virtual {p1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v1, v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnName:Ljava/lang/String;

    invoke-virtual {p1, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v1, " NOT IN(\'"

    invoke-virtual {p1, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v1, "\',\'"

    invoke-static {v1, p2}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;->joinStrings(Ljava/lang/String;Ljava/util/Collection;)Ljava/lang/String;

    move-result-object p2

    invoke-virtual {p1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string p2, "\')"

    invoke-virtual {p1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    :cond_60
    if-eqz p3, :cond_7c

    const-string p2, " GROUP BY "

    .line 10
    invoke-static {v0, p2}, Landroidx/appcompat/p;->d(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object p2

    .line 11
    sget-object p3, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->GROUP_ID_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget-object p3, p3, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnName:Ljava/lang/String;

    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 v0

    if-eqz p1, :cond_86

    const-string p2, " HAVING "

    .line 12
    invoke-static {v0, p2, p1}, Landroidx/biometric/i0;->c(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto :goto_86

    :cond_7c
    if-eqz p1, :cond_86

    const-string p2, " AND ( "

    const-string p3, " )"

    .line 13
    invoke-static {v0, p2, p1, p3}, Landroidx/appcompat/k;->c(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    :cond_86
    :goto_86
    return-object v0
.end method

.method private delete(Ljava/lang/Long;)V
    .registers 6

    .line 1
    iget-object v0, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->pendingCancelations:Ljava/util/Set;

    invoke-interface {v0, p1}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z

    .line 2
    iget-object v0, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sqlHelper:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;

    invoke-virtual {v0}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;->getDeleteStatement()Landroid/database/sqlite/SQLiteStatement;

    move-result-object v0

    .line 3
    monitor-enter v0

    .line 4
    :try_start_c
    invoke-virtual {v0}, Landroid/database/sqlite/SQLiteProgram;->clearBindings()V

    const/4 v1, 0x1

    .line 5
    invoke-virtual {p1}, Ljava/lang/Long;->longValue()J

    move-result-wide v2

    invoke-virtual {v0, v1, v2, v3}, Landroid/database/sqlite/SQLiteProgram;->bindLong(IJ)V

    .line 6
    invoke-virtual {v0}, Landroid/database/sqlite/SQLiteStatement;->execute()V

    .line 7
    monitor-exit v0

    return-void

    :catchall_1c
    move-exception p1

    monitor-exit v0
    :try_end_1e
    .catchall {:try_start_c .. :try_end_1e} :catchall_1c

    throw p1
.end method

.method private getSerializeJob(Lcom/path/android/jobqueue/JobHolder;)[B
    .registers 2

    invoke-virtual {p1}, Lcom/path/android/jobqueue/JobHolder;->getJob()Lcom/path/android/jobqueue/Job;

    move-result-object p1

    invoke-direct {p0, p1}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->safeSerialize(Ljava/lang/Object;)[B

    move-result-object p1

    return-object p1
.end method

.method private insertWithTags(Lcom/path/android/jobqueue/JobHolder;)J
    .registers 8

    .line 1
    iget-object v0, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sqlHelper:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;

    invoke-virtual {v0}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;->getInsertStatement()Landroid/database/sqlite/SQLiteStatement;

    move-result-object v0

    .line 2
    iget-object v1, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sqlHelper:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;

    invoke-virtual {v1}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;->getInsertTagsStatement()Landroid/database/sqlite/SQLiteStatement;

    move-result-object v1

    .line 3
    monitor-enter v0

    .line 4
    :try_start_d
    iget-object v2, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->db:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->beginTransaction()V
    :try_end_12
    .catchall {:try_start_d .. :try_end_12} :catchall_54

    .line 5
    :try_start_12
    invoke-virtual {v0}, Landroid/database/sqlite/SQLiteProgram;->clearBindings()V

    .line 6
    invoke-direct {p0, v0, p1}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->bindValues(Landroid/database/sqlite/SQLiteStatement;Lcom/path/android/jobqueue/JobHolder;)V

    .line 7
    invoke-virtual {v0}, Landroid/database/sqlite/SQLiteStatement;->executeInsert()J

    move-result-wide v2

    .line 8
    invoke-virtual {p1}, Lcom/path/android/jobqueue/JobHolder;->getTags()Ljava/util/Set;

    move-result-object v4

    invoke-interface {v4}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v4

    :goto_24
    invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

    move-result v5

    if-eqz v5, :cond_3a

    invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Ljava/lang/String;

    .line 9
    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteProgram;->clearBindings()V

    .line 10
    invoke-direct {p0, v1, v2, v3, v5}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->bindTag(Landroid/database/sqlite/SQLiteStatement;JLjava/lang/String;)V

    .line 11
    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteStatement;->executeInsert()J

    goto :goto_24

    .line 12
    :cond_3a
    iget-object v1, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->db:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteDatabase;->setTransactionSuccessful()V
    :try_end_3f
    .catchall {:try_start_12 .. :try_end_3f} :catchall_4d

    .line 13
    :try_start_3f
    iget-object v1, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->db:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 14
    monitor-exit v0
    :try_end_45
    .catchall {:try_start_3f .. :try_end_45} :catchall_54

    .line 15
    invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v0

    invoke-virtual {p1, v0}, Lcom/path/android/jobqueue/JobHolder;->setId(Ljava/lang/Long;)V

    return-wide v2

    :catchall_4d
    move-exception p1

    .line 16
    :try_start_4e
    iget-object v1, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->db:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    throw p1

    :catchall_54
    move-exception p1

    .line 17
    monitor-exit v0
    :try_end_56
    .catchall {:try_start_4e .. :try_end_56} :catchall_54

    throw p1
.end method

.method private safeDeserialize([B)Lcom/path/android/jobqueue/Job;
    .registers 4

    .line 1
    :try_start_0
    iget-object v0, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->jobSerializer:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue$JobSerializer;

    invoke-interface {v0, p1}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue$JobSerializer;->deserialize([B)Lcom/path/android/jobqueue/Job;

    move-result-object p1
    :try_end_6
    .catchall {:try_start_0 .. :try_end_6} :catchall_7

    return-object p1

    :catchall_7
    move-exception p1

    const/4 v0, 0x0

    new-array v0, v0, [Ljava/lang/Object;

    const-string v1, "error while deserializing job"

    .line 2
    invoke-static {p1, v1, v0}, Lcom/path/android/jobqueue/log/JqLog;->e(Ljava/lang/Throwable;Ljava/lang/String;[Ljava/lang/Object;)V

    const/4 p1, 0x0

    return-object p1
.end method

.method private safeSerialize(Ljava/lang/Object;)[B
    .registers 5

    .line 1
    :try_start_0
    iget-object v0, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->jobSerializer:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue$JobSerializer;

    invoke-interface {v0, p1}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue$JobSerializer;->serialize(Ljava/lang/Object;)[B

    move-result-object p1
    :try_end_6
    .catchall {:try_start_0 .. :try_end_6} :catchall_7

    return-object p1

    :catchall_7
    move-exception v0

    const/4 v1, 0x1

    new-array v1, v1, [Ljava/lang/Object;

    const/4 v2, 0x0

    .line 2
    invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object p1

    invoke-virtual {p1}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object p1

    aput-object p1, v1, v2

    const-string p1, "error while serializing object %s"

    invoke-static {v0, p1, v1}, Lcom/path/android/jobqueue/log/JqLog;->e(Ljava/lang/Throwable;Ljava/lang/String;[Ljava/lang/Object;)V

    const/4 p1, 0x0

    return-object p1
.end method

.method private setSessionIdOnJob(Lcom/path/android/jobqueue/JobHolder;)V
    .registers 7

    .line 1
    iget-object v0, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sqlHelper:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;

    invoke-virtual {v0}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;->getOnJobFetchedForRunningStatement()Landroid/database/sqlite/SQLiteStatement;

    move-result-object v0

    .line 2
    invoke-virtual {p1}, Lcom/path/android/jobqueue/JobHolder;->getRunCount()I

    move-result v1

    const/4 v2, 0x1

    add-int/2addr v1, v2

    invoke-virtual {p1, v1}, Lcom/path/android/jobqueue/JobHolder;->setRunCount(I)V

    .line 3
    iget-wide v3, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sessionId:J

    invoke-virtual {p1, v3, v4}, Lcom/path/android/jobqueue/JobHolder;->setRunningSessionId(J)V

    .line 4
    monitor-enter v0

    .line 5
    :try_start_15
    invoke-virtual {v0}, Landroid/database/sqlite/SQLiteProgram;->clearBindings()V

    .line 6
    invoke-virtual {p1}, Lcom/path/android/jobqueue/JobHolder;->getRunCount()I

    move-result v1

    int-to-long v3, v1

    invoke-virtual {v0, v2, v3, v4}, Landroid/database/sqlite/SQLiteProgram;->bindLong(IJ)V

    const/4 v1, 0x2

    .line 7
    iget-wide v2, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sessionId:J

    invoke-virtual {v0, v1, v2, v3}, Landroid/database/sqlite/SQLiteProgram;->bindLong(IJ)V

    const/4 v1, 0x3

    .line 8
    invoke-virtual {p1}, Lcom/path/android/jobqueue/JobHolder;->getId()Ljava/lang/Long;

    move-result-object p1

    invoke-virtual {p1}, Ljava/lang/Long;->longValue()J

    move-result-wide v2

    invoke-virtual {v0, v1, v2, v3}, Landroid/database/sqlite/SQLiteProgram;->bindLong(IJ)V

    .line 9
    invoke-virtual {v0}, Landroid/database/sqlite/SQLiteStatement;->execute()V

    .line 10
    monitor-exit v0

    return-void

    :catchall_37
    move-exception p1

    monitor-exit v0
    :try_end_39
    .catchall {:try_start_15 .. :try_end_39} :catchall_37

    throw p1
.end method


# virtual methods
.method public clear()V
    .registers 2

    .line 1
    iget-object v0, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sqlHelper:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;

    invoke-virtual {v0}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;->truncate()V

    .line 2
    iget-object v0, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->readyJobsQueryCache:Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;

    invoke-virtual {v0}, Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;->clear()V

    .line 3
    iget-object v0, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->nextJobsQueryCache:Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;

    invoke-virtual {v0}, Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;->clear()V

    return-void
.end method

.method public count()I
    .registers 5

    .line 1
    iget-object v0, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sqlHelper:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;

    invoke-virtual {v0}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;->getCountStatement()Landroid/database/sqlite/SQLiteStatement;

    move-result-object v0

    .line 2
    monitor-enter v0

    .line 3
    :try_start_7
    invoke-virtual {v0}, Landroid/database/sqlite/SQLiteProgram;->clearBindings()V

    const/4 v1, 0x1

    .line 4
    iget-wide v2, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sessionId:J

    invoke-virtual {v0, v1, v2, v3}, Landroid/database/sqlite/SQLiteProgram;->bindLong(IJ)V

    .line 5
    invoke-virtual {v0}, Landroid/database/sqlite/SQLiteStatement;->simpleQueryForLong()J

    move-result-wide v1

    long-to-int v2, v1

    monitor-exit v0

    return v2

    :catchall_17
    move-exception v1

    .line 6
    monitor-exit v0
    :try_end_19
    .catchall {:try_start_7 .. :try_end_19} :catchall_17

    throw v1
.end method

.method public countReadyJobs(ZLjava/util/Collection;)I
    .registers 11
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(Z",
            "Ljava/util/Collection<",
            "Ljava/lang/String;",
            ">;)I"
        }
    .end annotation

    .line 1
    iget-object v0, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->readyJobsQueryCache:Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;

    invoke-virtual {v0, p1, p2}, Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;->get(ZLjava/util/Collection;)Ljava/lang/String;

    move-result-object v0

    const/4 v1, 0x1

    if-nez v0, :cond_3c

    .line 2
    invoke-direct {p0, p1, p2, v1}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->createReadyJobWhereSql(ZLjava/util/Collection;Z)Ljava/lang/String;

    move-result-object v0

    const-string v2, "SELECT count(*) group_cnt, "

    .line 3
    invoke-static {v2}, Landroid/support/v4/media/c;->c(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    .line 4
    sget-object v3, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->GROUP_ID_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    iget-object v4, v3, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnName:Ljava/lang/String;

    const-string v5, " FROM "

    const-string v6, "job_holder"

    const-string v7, " WHERE "

    .line 5
    invoke-static {v2, v4, v5, v6, v7}, Landroidx/appcompat/b;->f(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 6
    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const-string v2, "SELECT SUM(case WHEN "

    .line 7
    invoke-static {v2}, Landroid/support/v4/media/c;->c(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    .line 8
    iget-object v3, v3, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;->columnName:Ljava/lang/String;

    const-string v4, " is null then group_cnt else 1 end) from ("

    const-string v5, ")"

    .line 9
    invoke-static {v2, v3, v4, v0, v5}, Landroidx/biometric/a0;->d(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 10
    iget-object v2, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->readyJobsQueryCache:Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;

    invoke-virtual {v2, v0, p1, p2}, Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;->set(Ljava/lang/String;ZLjava/util/Collection;)V

    .line 11
    :cond_3c
    iget-object p1, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->db:Landroid/database/sqlite/SQLiteDatabase;

    const/4 p2, 0x2

    new-array p2, p2, [Ljava/lang/String;

    iget-wide v2, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sessionId:J

    invoke-static {v2, v3}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v2

    const/4 v3, 0x0

    aput-object v2, p2, v3

    invoke-static {}, Ljava/lang/System;->nanoTime()J

    move-result-wide v4

    invoke-static {v4, v5}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v2

    aput-object v2, p2, v1

    invoke-virtual {p1, v0, p2}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object p1

    .line 12
    :try_start_58
    invoke-interface {p1}, Landroid/database/Cursor;->moveToNext()Z

    move-result p2
    :try_end_5c
    .catchall {:try_start_58 .. :try_end_5c} :catchall_6a

    if-nez p2, :cond_62

    .line 13
    invoke-interface {p1}, Landroid/database/Cursor;->close()V

    return v3

    .line 14
    :cond_62
    :try_start_62
    invoke-interface {p1, v3}, Landroid/database/Cursor;->getInt(I)I

    move-result p2
    :try_end_66
    .catchall {:try_start_62 .. :try_end_66} :catchall_6a

    .line 15
    invoke-interface {p1}, Landroid/database/Cursor;->close()V

    return p2

    :catchall_6a
    move-exception p2

    invoke-interface {p1}, Landroid/database/Cursor;->close()V

    throw p2
.end method

.method public findJobById(J)Lcom/path/android/jobqueue/JobHolder;
    .registers 6

    .line 1
    iget-object v0, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->db:Landroid/database/sqlite/SQLiteDatabase;

    iget-object v1, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sqlHelper:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;

    iget-object v1, v1, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;->FIND_BY_ID_QUERY:Ljava/lang/String;

    const/4 v2, 0x1

    new-array v2, v2, [Ljava/lang/String;

    invoke-static {p1, p2}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object p1

    const/4 p2, 0x0

    aput-object p1, v2, p2

    invoke-virtual {v0, v1, v2}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object p1

    const/4 v0, 0x0

    .line 2
    :try_start_15
    invoke-interface {p1}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v1
    :try_end_19
    .catch Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue$InvalidJobException; {:try_start_15 .. :try_end_19} :catch_29
    .catchall {:try_start_15 .. :try_end_19} :catchall_27

    if-nez v1, :cond_1f

    .line 3
    invoke-interface {p1}, Landroid/database/Cursor;->close()V

    return-object v0

    .line 4
    :cond_1f
    :try_start_1f
    invoke-direct {p0, p1}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->createJobHolderFromCursor(Landroid/database/Cursor;)Lcom/path/android/jobqueue/JobHolder;

    move-result-object p2
    :try_end_23
    .catch Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue$InvalidJobException; {:try_start_1f .. :try_end_23} :catch_29
    .catchall {:try_start_1f .. :try_end_23} :catchall_27

    .line 5
    invoke-interface {p1}, Landroid/database/Cursor;->close()V

    return-object p2

    :catchall_27
    move-exception p2

    goto :goto_35

    :catch_29
    move-exception v1

    :try_start_2a
    const-string v2, "invalid job on findJobById"

    new-array p2, p2, [Ljava/lang/Object;

    .line 6
    invoke-static {v1, v2, p2}, Lcom/path/android/jobqueue/log/JqLog;->e(Ljava/lang/Throwable;Ljava/lang/String;[Ljava/lang/Object;)V
    :try_end_31
    .catchall {:try_start_2a .. :try_end_31} :catchall_27

    .line 7
    invoke-interface {p1}, Landroid/database/Cursor;->close()V

    return-object v0

    :goto_35
    invoke-interface {p1}, Landroid/database/Cursor;->close()V

    throw p2
.end method

.method public varargs findJobsByTags(Lcom/path/android/jobqueue/TagConstraint;ZLjava/util/Collection;[Ljava/lang/String;)Ljava/util/Set;
    .registers 10
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/path/android/jobqueue/TagConstraint;",
            "Z",
            "Ljava/util/Collection<",
            "Ljava/lang/Long;",
            ">;[",
            "Ljava/lang/String;",
            ")",
            "Ljava/util/Set<",
            "Lcom/path/android/jobqueue/JobHolder;",
            ">;"
        }
    .end annotation

    if-eqz p4, :cond_97

    .line 1
    array-length v0, p4

    if-nez v0, :cond_7

    goto/16 :goto_97

    .line 2
    :cond_7
    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0}, Ljava/util/HashSet;-><init>()V

    const/4 v1, 0x0

    if-nez p3, :cond_11

    const/4 v2, 0x0

    goto :goto_15

    .line 3
    :cond_11
    invoke-interface {p3}, Ljava/util/Collection;->size()I

    move-result v2

    :goto_15
    if-eqz p2, :cond_1e

    .line 4
    iget-object v3, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->pendingCancelations:Ljava/util/Set;

    invoke-interface {v3}, Ljava/util/Set;->size()I

    move-result v3

    add-int/2addr v2, v3

    .line 5
    :cond_1e
    iget-object v3, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sqlHelper:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;

    array-length v4, p4

    invoke-virtual {v3, p1, v2, v4}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;->createFindByTagsQuery(Lcom/path/android/jobqueue/TagConstraint;II)Ljava/lang/String;

    move-result-object p1

    new-array v3, v1, [Ljava/lang/Object;

    .line 6
    invoke-static {p1, v3}, Lcom/path/android/jobqueue/log/JqLog;->d(Ljava/lang/String;[Ljava/lang/Object;)V

    if-nez v2, :cond_2d

    goto :goto_6f

    .line 7
    :cond_2d
    array-length v3, p4

    add-int/2addr v2, v3

    new-array v2, v2, [Ljava/lang/String;

    .line 8
    array-length v3, p4

    invoke-static {p4, v1, v2, v1, v3}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 9
    array-length p4, p4

    .line 10
    invoke-interface {p3}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object p3

    :goto_3a
    invoke-interface {p3}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_50

    invoke-interface {p3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/lang/Long;

    add-int/lit8 v4, p4, 0x1

    .line 11
    invoke-virtual {v3}, Ljava/lang/Long;->toString()Ljava/lang/String;

    move-result-object v3

    aput-object v3, v2, p4

    move p4, v4

    goto :goto_3a

    :cond_50
    if-eqz p2, :cond_6e

    .line 12
    iget-object p2, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->pendingCancelations:Ljava/util/Set;

    invoke-interface {p2}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object p2

    :goto_58
    invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z

    move-result p3

    if-eqz p3, :cond_6e

    invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object p3

    check-cast p3, Ljava/lang/Long;

    add-int/lit8 v3, p4, 0x1

    .line 13
    invoke-virtual {p3}, Ljava/lang/Long;->toString()Ljava/lang/String;

    move-result-object p3

    aput-object p3, v2, p4

    move p4, v3

    goto :goto_58

    :cond_6e
    move-object p4, v2

    .line 14
    :goto_6f
    iget-object p2, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->db:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p2, p1, p4}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object p1

    .line 15
    :goto_75
    :try_start_75
    invoke-interface {p1}, Landroid/database/Cursor;->moveToNext()Z

    move-result p2

    if-eqz p2, :cond_83

    .line 16
    invoke-direct {p0, p1}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->createJobHolderFromCursor(Landroid/database/Cursor;)Lcom/path/android/jobqueue/JobHolder;

    move-result-object p2

    invoke-virtual {v0, p2}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z
    :try_end_82
    .catch Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue$InvalidJobException; {:try_start_75 .. :try_end_82} :catch_89
    .catchall {:try_start_75 .. :try_end_82} :catchall_87

    goto :goto_75

    .line 17
    :cond_83
    :goto_83
    invoke-interface {p1}, Landroid/database/Cursor;->close()V

    goto :goto_92

    :catchall_87
    move-exception p2

    goto :goto_93

    :catch_89
    move-exception p2

    :try_start_8a
    const-string p3, "invalid job found by tags."

    new-array p4, v1, [Ljava/lang/Object;

    .line 18
    invoke-static {p2, p3, p4}, Lcom/path/android/jobqueue/log/JqLog;->e(Ljava/lang/Throwable;Ljava/lang/String;[Ljava/lang/Object;)V
    :try_end_91
    .catchall {:try_start_8a .. :try_end_91} :catchall_87

    goto :goto_83

    :goto_92
    return-object v0

    .line 19
    :goto_93
    invoke-interface {p1}, Landroid/database/Cursor;->close()V

    throw p2

    .line 20
    :cond_97
    :goto_97
    invoke-static {}, Ljava/util/Collections;->emptySet()Ljava/util/Set;

    move-result-object p1

    return-object p1
.end method

.method public getNextJobDelayUntilNs(ZLjava/util/Collection;)Ljava/lang/Long;
    .registers 7
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(Z",
            "Ljava/util/Collection<",
            "Ljava/lang/String;",
            ">;)",
            "Ljava/lang/Long;"
        }
    .end annotation

    const/4 v0, 0x0

    if-eqz p2, :cond_b

    .line 1
    invoke-interface {p2}, Ljava/util/Collection;->isEmpty()Z

    move-result v1

    if-nez v1, :cond_b

    const/4 v1, 0x1

    goto :goto_c

    :cond_b
    const/4 v1, 0x0

    :goto_c
    const/4 v2, 0x0

    if-nez v1, :cond_33

    if-eqz p1, :cond_18

    .line 2
    iget-object p1, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sqlHelper:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;

    invoke-virtual {p1}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;->getNextJobDelayedUntilWithNetworkStatement()Landroid/database/sqlite/SQLiteStatement;

    move-result-object p1

    goto :goto_1e

    :cond_18
    iget-object p1, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sqlHelper:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;

    invoke-virtual {p1}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;->getNextJobDelayedUntilWithoutNetworkStatement()Landroid/database/sqlite/SQLiteStatement;

    move-result-object p1

    :goto_1e
    move-object v1, p1

    .line 3
    monitor-enter v1

    .line 4
    :try_start_20
    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteProgram;->clearBindings()V

    .line 5
    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteStatement;->simpleQueryForLong()J

    move-result-wide p1

    invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object p1
    :try_end_2b
    .catch Landroid/database/sqlite/SQLiteDoneException; {:try_start_20 .. :try_end_2b} :catch_2f
    .catchall {:try_start_20 .. :try_end_2b} :catchall_2d

    :try_start_2b
    monitor-exit v1

    return-object p1

    :catchall_2d
    move-exception p1

    goto :goto_31

    .line 6
    :catch_2f
    monitor-exit v1

    return-object v2

    .line 7
    :goto_31
    monitor-exit v1
    :try_end_32
    .catchall {:try_start_2b .. :try_end_32} :catchall_2d

    throw p1

    .line 8
    :cond_33
    iget-object v1, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->nextJobDelayUntilQueryCache:Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;

    invoke-virtual {v1, p1, p2}, Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;->get(ZLjava/util/Collection;)Ljava/lang/String;

    move-result-object v1

    if-nez v1, :cond_46

    .line 9
    iget-object v1, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sqlHelper:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;

    invoke-virtual {v1, p1, p2}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;->createNextJobDelayUntilQuery(ZLjava/util/Collection;)Ljava/lang/String;

    move-result-object v1

    .line 10
    iget-object v3, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->nextJobDelayUntilQueryCache:Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;

    invoke-virtual {v3, v1, p1, p2}, Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;->set(Ljava/lang/String;ZLjava/util/Collection;)V

    .line 11
    :cond_46
    iget-object p1, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->db:Landroid/database/sqlite/SQLiteDatabase;

    new-array p2, v0, [Ljava/lang/String;

    invoke-virtual {p1, v1, p2}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object p1

    .line 12
    :try_start_4e
    invoke-interface {p1}, Landroid/database/Cursor;->moveToNext()Z

    move-result p2
    :try_end_52
    .catchall {:try_start_4e .. :try_end_52} :catchall_64

    if-nez p2, :cond_58

    .line 13
    invoke-interface {p1}, Landroid/database/Cursor;->close()V

    return-object v2

    .line 14
    :cond_58
    :try_start_58
    invoke-interface {p1, v0}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v0

    invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object p2
    :try_end_60
    .catchall {:try_start_58 .. :try_end_60} :catchall_64

    .line 15
    invoke-interface {p1}, Landroid/database/Cursor;->close()V

    return-object p2

    :catchall_64
    move-exception p2

    invoke-interface {p1}, Landroid/database/Cursor;->close()V

    throw p2
.end method

.method public insert(Lcom/path/android/jobqueue/JobHolder;)J
    .registers 5

    .line 1
    invoke-virtual {p1}, Lcom/path/android/jobqueue/JobHolder;->hasTags()Z

    move-result v0

    if-eqz v0, :cond_b

    .line 2
    invoke-direct {p0, p1}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->insertWithTags(Lcom/path/android/jobqueue/JobHolder;)J

    move-result-wide v0

    return-wide v0

    .line 3
    :cond_b
    iget-object v0, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sqlHelper:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;

    invoke-virtual {v0}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;->getInsertStatement()Landroid/database/sqlite/SQLiteStatement;

    move-result-object v0

    .line 4
    monitor-enter v0

    .line 5
    :try_start_12
    invoke-virtual {v0}, Landroid/database/sqlite/SQLiteProgram;->clearBindings()V

    .line 6
    invoke-direct {p0, v0, p1}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->bindValues(Landroid/database/sqlite/SQLiteStatement;Lcom/path/android/jobqueue/JobHolder;)V

    .line 7
    invoke-virtual {v0}, Landroid/database/sqlite/SQLiteStatement;->executeInsert()J

    move-result-wide v1

    .line 8
    monitor-exit v0
    :try_end_1d
    .catchall {:try_start_12 .. :try_end_1d} :catchall_25

    .line 9
    invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v0

    invoke-virtual {p1, v0}, Lcom/path/android/jobqueue/JobHolder;->setId(Ljava/lang/Long;)V

    return-wide v1

    :catchall_25
    move-exception p1

    .line 10
    :try_start_26
    monitor-exit v0
    :try_end_27
    .catchall {:try_start_26 .. :try_end_27} :catchall_25

    throw p1
.end method

.method public insertOrReplace(Lcom/path/android/jobqueue/JobHolder;)J
    .registers 5

    .line 1
    invoke-virtual {p1}, Lcom/path/android/jobqueue/JobHolder;->getId()Ljava/lang/Long;

    move-result-object v0

    if-nez v0, :cond_b

    .line 2
    invoke-virtual {p0, p1}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->insert(Lcom/path/android/jobqueue/JobHolder;)J

    move-result-wide v0

    return-wide v0

    :cond_b
    const-wide/high16 v0, -0x8000000000000000L

    .line 3
    invoke-virtual {p1, v0, v1}, Lcom/path/android/jobqueue/JobHolder;->setRunningSessionId(J)V

    .line 4
    iget-object v0, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sqlHelper:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;

    invoke-virtual {v0}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;->getInsertOrReplaceStatement()Landroid/database/sqlite/SQLiteStatement;

    move-result-object v0

    .line 5
    monitor-enter v0

    .line 6
    :try_start_17
    invoke-virtual {v0}, Landroid/database/sqlite/SQLiteProgram;->clearBindings()V

    .line 7
    invoke-direct {p0, v0, p1}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->bindValues(Landroid/database/sqlite/SQLiteStatement;Lcom/path/android/jobqueue/JobHolder;)V

    .line 8
    invoke-virtual {v0}, Landroid/database/sqlite/SQLiteStatement;->executeInsert()J

    move-result-wide v1

    .line 9
    monitor-exit v0
    :try_end_22
    .catchall {:try_start_17 .. :try_end_22} :catchall_2a

    .line 10
    invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v0

    invoke-virtual {p1, v0}, Lcom/path/android/jobqueue/JobHolder;->setId(Ljava/lang/Long;)V

    return-wide v1

    :catchall_2a
    move-exception p1

    .line 11
    :try_start_2b
    monitor-exit v0
    :try_end_2c
    .catchall {:try_start_2b .. :try_end_2c} :catchall_2a

    throw p1
.end method

.method public nextJobAndIncRunCount(ZLjava/util/Collection;)Lcom/path/android/jobqueue/JobHolder;
    .registers 13
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(Z",
            "Ljava/util/Collection<",
            "Ljava/lang/String;",
            ">;)",
            "Lcom/path/android/jobqueue/JobHolder;"
        }
    .end annotation

    .line 1
    iget-object v0, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->nextJobsQueryCache:Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;

    invoke-virtual {v0, p1, p2}, Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;->get(ZLjava/util/Collection;)Ljava/lang/String;

    move-result-object v0

    const/4 v1, 0x2

    const/4 v2, 0x1

    const/4 v3, 0x0

    if-nez v0, :cond_40

    .line 2
    invoke-direct {p0, p1, p2, v3}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->createReadyJobWhereSql(ZLjava/util/Collection;Z)Ljava/lang/String;

    move-result-object v0

    .line 3
    iget-object v4, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sqlHelper:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;

    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    const/4 v6, 0x3

    new-array v6, v6, [Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Order;

    new-instance v7, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Order;

    sget-object v8, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->PRIORITY_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    sget-object v9, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Order$Type;->DESC:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Order$Type;

    invoke-direct {v7, v8, v9}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Order;-><init>(Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Order$Type;)V

    aput-object v7, v6, v3

    new-instance v7, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Order;

    sget-object v8, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->CREATED_NS_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    sget-object v9, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Order$Type;->ASC:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Order$Type;

    invoke-direct {v7, v8, v9}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Order;-><init>(Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Order$Type;)V

    aput-object v7, v6, v2

    new-instance v7, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Order;

    sget-object v8, Lcom/path/android/jobqueue/persistentQueue/sqlite/DbOpenHelper;->ID_COLUMN:Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;

    invoke-direct {v7, v8, v9}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Order;-><init>(Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Property;Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Order$Type;)V

    aput-object v7, v6, v1

    invoke-virtual {v4, v0, v5, v6}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper;->createSelect(Ljava/lang/String;Ljava/lang/Integer;[Lcom/path/android/jobqueue/persistentQueue/sqlite/SqlHelper$Order;)Ljava/lang/String;

    move-result-object v0

    .line 4
    iget-object v4, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->nextJobsQueryCache:Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;

    invoke-virtual {v4, v0, p1, p2}, Lcom/path/android/jobqueue/persistentQueue/sqlite/QueryCache;->set(Ljava/lang/String;ZLjava/util/Collection;)V

    .line 5
    :cond_40
    iget-object p1, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->db:Landroid/database/sqlite/SQLiteDatabase;

    new-array p2, v1, [Ljava/lang/String;

    iget-wide v4, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->sessionId:J

    invoke-static {v4, v5}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v1

    aput-object v1, p2, v3

    invoke-static {}, Ljava/lang/System;->nanoTime()J

    move-result-wide v4

    invoke-static {v4, v5}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v1

    aput-object v1, p2, v2

    invoke-virtual {p1, v0, p2}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object p1

    const/4 p2, 0x0

    .line 6
    :try_start_5b
    invoke-interface {p1}, Landroid/database/Cursor;->moveToNext()Z

    move-result v0
    :try_end_5f
    .catch Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue$InvalidJobException; {:try_start_5b .. :try_end_5f} :catch_72
    .catchall {:try_start_5b .. :try_end_5f} :catchall_70

    if-nez v0, :cond_65

    .line 7
    invoke-interface {p1}, Landroid/database/Cursor;->close()V

    return-object p2

    .line 8
    :cond_65
    :try_start_65
    invoke-direct {p0, p1}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->createJobHolderFromCursor(Landroid/database/Cursor;)Lcom/path/android/jobqueue/JobHolder;

    move-result-object v0

    .line 9
    invoke-direct {p0, v0}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->setSessionIdOnJob(Lcom/path/android/jobqueue/JobHolder;)V
    :try_end_6c
    .catch Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue$InvalidJobException; {:try_start_65 .. :try_end_6c} :catch_72
    .catchall {:try_start_65 .. :try_end_6c} :catchall_70

    .line 10
    invoke-interface {p1}, Landroid/database/Cursor;->close()V

    return-object v0

    :catchall_70
    move-exception p2

    goto :goto_85

    .line 11
    :catch_72
    :try_start_72
    invoke-interface {p1, v3}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v0

    invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v0

    .line 12
    invoke-direct {p0, v0}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->delete(Ljava/lang/Long;)V

    .line 13
    invoke-virtual {p0, v2, p2}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->nextJobAndIncRunCount(ZLjava/util/Collection;)Lcom/path/android/jobqueue/JobHolder;

    move-result-object p2
    :try_end_81
    .catchall {:try_start_72 .. :try_end_81} :catchall_70

    .line 14
    invoke-interface {p1}, Landroid/database/Cursor;->close()V

    return-object p2

    :goto_85
    invoke-interface {p1}, Landroid/database/Cursor;->close()V

    throw p2
.end method

.method public onJobCancelled(Lcom/path/android/jobqueue/JobHolder;)V
    .registers 4

    .line 1
    iget-object v0, p0, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->pendingCancelations:Ljava/util/Set;

    invoke-virtual {p1}, Lcom/path/android/jobqueue/JobHolder;->getId()Ljava/lang/Long;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/Set;->add(Ljava/lang/Object;)Z

    .line 2
    invoke-direct {p0, p1}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->setSessionIdOnJob(Lcom/path/android/jobqueue/JobHolder;)V

    return-void
.end method

.method public remove(Lcom/path/android/jobqueue/JobHolder;)V
    .registers 3

    .line 1
    invoke-virtual {p1}, Lcom/path/android/jobqueue/JobHolder;->getId()Ljava/lang/Long;

    move-result-object v0

    if-nez v0, :cond_f

    const/4 p1, 0x0

    new-array p1, p1, [Ljava/lang/Object;

    const-string v0, "called remove with null job id."

    .line 2
    invoke-static {v0, p1}, Lcom/path/android/jobqueue/log/JqLog;->e(Ljava/lang/String;[Ljava/lang/Object;)V

    return-void

    .line 3
    :cond_f
    invoke-virtual {p1}, Lcom/path/android/jobqueue/JobHolder;->getId()Ljava/lang/Long;

    move-result-object p1

    invoke-direct {p0, p1}, Lcom/path/android/jobqueue/persistentQueue/sqlite/SqliteJobQueue;->delete(Ljava/lang/Long;)V

    return-void
.end method