.class public final Ls4/d;
.super Ld9/h;
.source ""

# interfaces
.implements Lh9/c;


# annotations
.annotation runtime Ld9/e;
    c = "com.floydwiz.gamingcenter.viewmodels.GameActivityVM$getTotalUsage$2"
    f = "GameActivityVM.kt"
    l = {}
    m = "invokeSuspend"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ld9/h;",
        "Lh9/c<",
        "Lq9/w;",
        "Lb9/d<",
        "-",
        "Ljava/lang/Long;",
        ">;",
        "Ljava/lang/Object;",
        ">;"
    }
.end annotation


# instance fields
.field public final synthetic v:Lo4/a;

.field public final synthetic w:Ls4/g;


# direct methods
.method public constructor <init>(Lo4/a;Ls4/g;Lb9/d;)V
    .registers 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lo4/a;",
            "Ls4/g;",
            "Lb9/d<",
            "-",
            "Ls4/d;",
            ">;)V"
        }
    .end annotation

    iput-object p1, p0, Ls4/d;->v:Lo4/a;

    iput-object p2, p0, Ls4/d;->w:Ls4/g;

    const/4 p1, 0x2

    invoke-direct {p0, p1, p3}, Ld9/h;-><init>(ILb9/d;)V

    return-void
.end method


# virtual methods
.method public final b(Ljava/lang/Object;Lb9/d;)Lb9/d;
    .registers 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/Object;",
            "Lb9/d<",
            "*>;)",
            "Lb9/d<",
            "Ly8/k;",
            ">;"
        }
    .end annotation

    new-instance p1, Ls4/d;

    iget-object v0, p0, Ls4/d;->v:Lo4/a;

    iget-object v1, p0, Ls4/d;->w:Ls4/g;

    invoke-direct {p1, v0, v1, p2}, Ls4/d;-><init>(Lo4/a;Ls4/g;Lb9/d;)V

    return-object p1
.end method

.method public e(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    .registers 5

    check-cast p1, Lq9/w;

    check-cast p2, Lb9/d;

    .line 1
    new-instance p1, Ls4/d;

    iget-object v0, p0, Ls4/d;->v:Lo4/a;

    iget-object v1, p0, Ls4/d;->w:Ls4/g;

    invoke-direct {p1, v0, v1, p2}, Ls4/d;-><init>(Lo4/a;Ls4/g;Lb9/d;)V

    .line 2
    sget-object p2, Ly8/k;->a:Ly8/k;

    invoke-virtual {p1, p2}, Ls4/d;->o(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

    return-object p1
.end method

.method public final o(Ljava/lang/Object;)Ljava/lang/Object;
    .registers 7

    invoke-static {p1}, Le/h;->h(Ljava/lang/Object;)V

    iget-object p1, p0, Ls4/d;->v:Lo4/a;

    iget-object v0, p0, Ls4/d;->w:Ls4/g;

    .line 1
    iget-object v0, v0, Ls4/g;->c:Ljava/lang/String;

    if-eqz v0, :cond_c

    goto :goto_e

    :cond_c
    const-string v0, ""

    .line 2
    :goto_e
    invoke-static {p1}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    const-string v1, "packageName"

    .line 3
    invoke-static {v0, v1}, Lx/e;->f(Ljava/lang/Object;Ljava/lang/String;)V

    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v2, "SELECT SUM("

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

    sget-object v2, Lo4/a$a;->t:Lo4/a$a;

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

    const-string v2, ") FROM PLAYTIME_RECORD WHERE "

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

    sget-object v2, Lo4/a$a;->r:Lo4/a$a;

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

    const-string v2, " = ?"

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

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

    move-result-object v1

    :try_start_38
    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteOpenHelper;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v2

    const/4 v3, 0x1

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

    const/4 v4, 0x0

    aput-object v0, v3, v4

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

    move-result-object v1

    invoke-interface {v1}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v2

    if-eqz v2, :cond_5d

    new-instance v2, Lm4/a;

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

    move-result-wide v3

    invoke-direct {v2, v0, v3, v4}, Lm4/a;-><init>(Ljava/lang/String;J)V
    :try_end_55
    .catch Ljava/lang/Exception; {:try_start_38 .. :try_end_55} :catch_63
    .catchall {:try_start_38 .. :try_end_55} :catchall_61

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteOpenHelper;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object p1

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

    goto :goto_6f

    :cond_5d
    :try_start_5d
    invoke-interface {v1}, Landroid/database/Cursor;->close()V
    :try_end_60
    .catch Ljava/lang/Exception; {:try_start_5d .. :try_end_60} :catch_63
    .catchall {:try_start_5d .. :try_end_60} :catchall_61

    goto :goto_67

    :catchall_61
    move-exception v0

    goto :goto_7c

    :catch_63
    move-exception v0

    :try_start_64
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_67
    .catchall {:try_start_64 .. :try_end_67} :catchall_61

    :goto_67
    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteOpenHelper;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object p1

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

    const/4 v2, 0x0

    :goto_6f
    if-nez v2, :cond_74

    const-wide/16 v0, 0x0

    goto :goto_76

    .line 4
    :cond_74
    iget-wide v0, v2, Lm4/a;->b:J

    .line 5
    :goto_76
    new-instance p1, Ljava/lang/Long;

    invoke-direct {p1, v0, v1}, Ljava/lang/Long;-><init>(J)V

    return-object p1

    .line 6
    :goto_7c
    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteOpenHelper;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object p1

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

    throw v0
.end method
