granularity level: instruction

		.class public final Lr/k;
.super Ljava/lang/Object;
.source "SourceFile"
.implements Lr/d;
.implements Ls/c;
.implements Lr/c;


.field public static final f:Li/b;
.field public final a:Lr/n;
.field public final b:Lt/a;
.field public final c:Lt/a;
.field public final d:Lr/a;
.field public final e:Lk1/a;


.method public static constructor <clinit>()V
	.locals 2

	new-instance v0, Li/b;
	const-string v1, "proto"
	invoke-direct {v0, v1}, Li/b;-><init>(Ljava/lang/String;)V
	sput-object v0, Lr/k;->f:Li/b;
	return-void
.end method

.method public constructor <init>(Lt/a;Lt/a;Lr/a;Lr/n;Lk1/a;)V
	.locals 0

	invoke-direct {p0}, Ljava/lang/Object;-><init>()V
	iput-object p4, p0, Lr/k;->a:Lr/n;
	iput-object p1, p0, Lr/k;->b:Lt/a;
	iput-object p2, p0, Lr/k;->c:Lt/a;
	iput-object p3, p0, Lr/k;->d:Lr/a;
	iput-object p5, p0, Lr/k;->e:Lk1/a;
	return-void
.end method

.method public static b(Landroid/database/sqlite/SQLiteDatabase;Ll/l;)Ljava/lang/Long;
	.locals 13

	new-instance v0, Ljava/lang/StringBuilder;
	const-string v1, "backend_name = ? and priority = ?"
	invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
	new-instance v1, Ljava/util/ArrayList;
	const/4 v2, 0x2
	new-array v2, v2, [Ljava/lang/String;
	iget-object v3, p1, Ll/l;->a:Ljava/lang/String;
	const/4 v4, 0x0
	aput-object v3, v2, v4
	iget-object v3, p1, Ll/l;->c:Li/c;
	invoke-static {v3}, Lu/a;->a(Li/c;)I
	move-result v3
	invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
	move-result-object v3
	const/4 v5, 0x1
	aput-object v3, v2, v5
	invoke-static {v2}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;
	move-result-object v2
	invoke-direct {v1, v2}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
	iget-object v2, p1, Ll/l;->b:[B
	if-eqz v2, :cond_0
	const-string v2, " and extras = ?"
	invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	iget-object p1, p1, Ll/l;->b:[B
	invoke-static {p1, v4}, Landroid/util/Base64;->encodeToString([BI)Ljava/lang/String;
	move-result-object p1
	invoke-virtual {v1, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
	goto :goto_0
	:cond_0
	const-string p1, " and extras is null"
	invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	:goto_0
	const-string p1, "_id"
	filled-new-array {p1}, [Ljava/lang/String;
	move-result-object v7
	invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
	move-result-object v8
	new-array p1, v4, [Ljava/lang/String;
	invoke-virtual {v1, p1}, Ljava/util/ArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
	move-result-object p1
	move-object v9, p1
	check-cast v9, [Ljava/lang/String;
	const/4 v10, 0x0
	const/4 v11, 0x0
	const/4 v12, 0x0
	const-string v6, "transport_contexts"
	move-object v5, p0
	invoke-virtual/range {v5 .. v12}, Landroid/database/sqlite/SQLiteDatabase;->query(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
	move-result-object p0
	new-instance p1, Lj/c;
	const/16 v0, 0xa
	invoke-direct {p1, v0}, Lj/c;-><init>(I)V
	invoke-static {p0, p1}, Lr/k;->g(Landroid/database/Cursor;Lr/i;)Ljava/lang/Object;
	move-result-object p0
	check-cast p0, Ljava/lang/Long;
	return-object p0
.end method

.method public static f(Ljava/lang/Iterable;)Ljava/lang/String;
	.locals 3

	new-instance v0, Ljava/lang/StringBuilder;
	const-string v1, "("
	invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
	invoke-interface {p0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
	move-result-object p0
	:goto_0
	:cond_0
	invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
	move-result v1
	if-eqz v1, :cond_1
	invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
	move-result-object v1
	check-cast v1, Lr/b;
	iget-wide v1, v1, Lr/b;->a:J
	invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
	invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
	move-result v1
	if-eqz v1, :cond_0
	const/16 v1, 0x2c
	invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
	goto :goto_0
	:cond_1
	const/16 p0, 0x29
	invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
	invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
	move-result-object p0
	return-object p0
.end method

.method public static g(Landroid/database/Cursor;Lr/i;)Ljava/lang/Object;
	.locals 0

	:try_start_0
	invoke-interface {p1, p0}, Lr/i;->apply(Ljava/lang/Object;)Ljava/lang/Object;
	move-result-object p1
	:try_end_0
	.catchall {:try_start_0 .. :try_end_0} :catchall_0
	invoke-interface {p0}, Landroid/database/Cursor;->close()V
	return-object p1
	:catchall_0
	move-exception p1
	invoke-interface {p0}, Landroid/database/Cursor;->close()V
	throw p1
.end method

.method public final a()Landroid/database/sqlite/SQLiteDatabase;
	.locals 10

	iget-object v0, p0, Lr/k;->a:Lr/n;
	invoke-static {v0}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;
	new-instance v1, Lj/c;
	const/4 v2, 0x3
	invoke-direct {v1, v2}, Lj/c;-><init>(I)V
	iget-object v2, p0, Lr/k;->c:Lt/a;
	check-cast v2, Lt/b;
	invoke-virtual {v2}, Lt/b;->a()J
	move-result-wide v2
	:goto_0
	:try_start_0
	invoke-virtual {v0}, Landroid/database/sqlite/SQLiteOpenHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;
	move-result-object v0
	:try_end_0
	.catch Landroid/database/sqlite/SQLiteDatabaseLockedException; {:try_start_0 .. :try_end_0} :catch_0
	goto :goto_1
	:catch_0
	move-exception v4
	iget-object v5, p0, Lr/k;->c:Lt/a;
	check-cast v5, Lt/b;
	invoke-virtual {v5}, Lt/b;->a()J
	move-result-wide v5
	iget-object v7, p0, Lr/k;->d:Lr/a;
	iget v7, v7, Lr/a;->c:I
	int-to-long v7, v7
	add-long/2addr v7, v2
	cmp-long v9, v5, v7
	if-ltz v9, :cond_0
	invoke-virtual {v1, v4}, Lj/c;->apply(Ljava/lang/Object;)Ljava/lang/Object;
	move-result-object v0
	:goto_1
	check-cast v0, Landroid/database/sqlite/SQLiteDatabase;
	return-object v0
	:cond_0
	const-wide/16 v4, 0x32
	invoke-static {v4, v5}, Landroid/os/SystemClock;->sleep(J)V
	goto :goto_0
.end method

.method public final c(Lr/i;)Ljava/lang/Object;
	.locals 1

	invoke-virtual {p0}, Lr/k;->a()Landroid/database/sqlite/SQLiteDatabase;
	move-result-object v0
	invoke-virtual {v0}, Landroid/database/sqlite/SQLiteDatabase;->beginTransaction()V
	:try_start_0
	invoke-interface {p1, v0}, Lr/i;->apply(Ljava/lang/Object;)Ljava/lang/Object;
	move-result-object p1
	invoke-virtual {v0}, Landroid/database/sqlite/SQLiteDatabase;->setTransactionSuccessful()V
	:try_end_0
	.catchall {:try_start_0 .. :try_end_0} :catchall_0
	invoke-virtual {v0}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V
	return-object p1
	:catchall_0
	move-exception p1
	invoke-virtual {v0}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V
	throw p1
.end method

.method public final close()V
	.locals 1

	iget-object v0, p0, Lr/k;->a:Lr/n;
	invoke-virtual {v0}, Landroid/database/sqlite/SQLiteOpenHelper;->close()V
	return-void
.end method

.method public final d(Landroid/database/sqlite/SQLiteDatabase;Ll/l;I)Ljava/util/ArrayList;
	.locals 19

	new-instance v0, Ljava/util/ArrayList;
	invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
	invoke-static/range {p1 .. p2}, Lr/k;->b(Landroid/database/sqlite/SQLiteDatabase;Ll/l;)Ljava/lang/Long;
	move-result-object v1
	if-nez v1, :cond_0
	return-object v0
	:cond_0
	const-string v2, "_id"
	const-string v3, "transport_name"
	const-string v4, "timestamp_ms"
	const-string v5, "uptime_ms"
	const-string v6, "payload_encoding"
	const-string v7, "payload"
	const-string v8, "code"
	const-string v9, "inline"
	filled-new-array/range {v2 .. v9}, [Ljava/lang/String;
	move-result-object v12
	const/4 v2, 0x1
	new-array v14, v2, [Ljava/lang/String;
	const/4 v2, 0x0
	invoke-virtual {v1}, Ljava/lang/Long;->toString()Ljava/lang/String;
	move-result-object v1
	aput-object v1, v14, v2
	const/4 v15, 0x0
	const/16 v16, 0x0
	const/16 v17, 0x0
	invoke-static/range {p3 .. p3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
	move-result-object v18
	const-string v11, "events"
	const-string v13, "context_id = ?"
	move-object/from16 v10, p1
	invoke-virtual/range {v10 .. v18}, Landroid/database/sqlite/SQLiteDatabase;->query(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
	move-result-object v1
	new-instance v2, Lp/b;
	const/4 v3, 0x2
	move-object/from16 v4, p0
	move-object/from16 v5, p2
	invoke-direct {v2, v4, v0, v5, v3}, Lp/b;-><init>(Lr/k;Ljava/lang/Object;Ll/l;I)V
	invoke-static {v1, v2}, Lr/k;->g(Landroid/database/Cursor;Lr/i;)Ljava/lang/Object;
	return-object v0
.end method

.method public final e(Ls/b;)Ljava/lang/Object;
	.locals 10

	invoke-virtual {p0}, Lr/k;->a()Landroid/database/sqlite/SQLiteDatabase;
	move-result-object v0
	new-instance v1, Lj/c;
	const/4 v2, 0x5
	invoke-direct {v1, v2}, Lj/c;-><init>(I)V
	iget-object v2, p0, Lr/k;->c:Lt/a;
	check-cast v2, Lt/b;
	invoke-virtual {v2}, Lt/b;->a()J
	move-result-wide v2
	:goto_0
	:try_start_0
	invoke-virtual {v0}, Landroid/database/sqlite/SQLiteDatabase;->beginTransaction()V
	:try_end_0
	.catch Landroid/database/sqlite/SQLiteDatabaseLockedException; {:try_start_0 .. :try_end_0} :catch_0
	goto :goto_1
	:catch_0
	move-exception v4
	iget-object v5, p0, Lr/k;->c:Lt/a;
	check-cast v5, Lt/b;
	invoke-virtual {v5}, Lt/b;->a()J
	move-result-wide v5
	iget-object v7, p0, Lr/k;->d:Lr/a;
	iget v7, v7, Lr/a;->c:I
	int-to-long v7, v7
	add-long/2addr v7, v2
	cmp-long v9, v5, v7
	if-ltz v9, :cond_0
	invoke-virtual {v1, v4}, Lj/c;->apply(Ljava/lang/Object;)Ljava/lang/Object;
	:goto_1
	:try_start_1
	invoke-interface {p1}, Ls/b;->d()Ljava/lang/Object;
	move-result-object p1
	invoke-virtual {v0}, Landroid/database/sqlite/SQLiteDatabase;->setTransactionSuccessful()V
	:try_end_1
	.catchall {:try_start_1 .. :try_end_1} :catchall_0
	invoke-virtual {v0}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V
	return-object p1
	:catchall_0
	move-exception p1
	invoke-virtual {v0}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V
	throw p1
	:cond_0
	const-wide/16 v4, 0x32
	invoke-static {v4, v5}, Landroid/os/SystemClock;->sleep(J)V
	goto :goto_0
.end method