granularity level: instruction

		.class public final Lr/n;
.super Landroid/database/sqlite/SQLiteOpenHelper;
.source "SourceFile"


.field public static final c:Ljava/lang/String;
.field public static d:I
.field public static final e:Ljava/util/List;
.field public final a:I
.field public b:Z


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

	const-string v0, "INSERT INTO global_log_event_state VALUES ("
	invoke-static {v0}, Lc0/b;->b(Ljava/lang/String;)Ljava/lang/StringBuilder;
	move-result-object v0
	invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
	move-result-wide v1
	invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
	const-string v1, ")"
	invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
	move-result-object v0
	sput-object v0, Lr/n;->c:Ljava/lang/String;
	const/4 v0, 0x5
	sput v0, Lr/n;->d:I
	new-instance v1, Lr/l;
	const/4 v2, 0x0
	invoke-direct {v1, v2}, Lr/l;-><init>(I)V
	new-instance v3, Lr/l;
	const/4 v4, 0x1
	invoke-direct {v3, v4}, Lr/l;-><init>(I)V
	new-instance v5, Lr/l;
	const/4 v6, 0x2
	invoke-direct {v5, v6}, Lr/l;-><init>(I)V
	new-instance v7, Lr/l;
	const/4 v8, 0x3
	invoke-direct {v7, v8}, Lr/l;-><init>(I)V
	new-instance v9, Lr/l;
	const/4 v10, 0x4
	invoke-direct {v9, v10}, Lr/l;-><init>(I)V
	new-array v0, v0, [Lr/m;
	aput-object v1, v0, v2
	aput-object v3, v0, v4
	aput-object v5, v0, v6
	aput-object v7, v0, v8
	aput-object v9, v0, v10
	invoke-static {v0}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;
	move-result-object v0
	sput-object v0, Lr/n;->e:Ljava/util/List;
	return-void
.end method

.method public constructor <init>(ILandroid/content/Context;Ljava/lang/String;)V
	.locals 1

	const/4 v0, 0x0
	invoke-direct {p0, p2, p3, v0, p1}, Landroid/database/sqlite/SQLiteOpenHelper;-><init>(Landroid/content/Context;Ljava/lang/String;Landroid/database/sqlite/SQLiteDatabase$CursorFactory;I)V
	const/4 p2, 0x0
	iput-boolean p2, p0, Lr/n;->b:Z
	iput p1, p0, Lr/n;->a:I
	return-void
.end method

.method public static a(Landroid/database/sqlite/SQLiteDatabase;II)V
	.locals 3

	sget-object v0, Lr/n;->e:Ljava/util/List;
	invoke-interface {v0}, Ljava/util/List;->size()I
	move-result v1
	if-gt p2, v1, :cond_1
	:goto_0
	if-ge p1, p2, :cond_0
	sget-object v0, Lr/n;->e:Ljava/util/List;
	invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;
	move-result-object v0
	check-cast v0, Lr/m;
	check-cast v0, Lr/l;
	iget v0, v0, Lr/l;->a:I
	packed-switch v0, :pswitch_data_0
	goto :goto_1
	:pswitch_0
	const-string v0, "ALTER TABLE events ADD COLUMN inline BOOLEAN NOT NULL DEFAULT 1"
	invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	const-string v0, "DROP TABLE IF EXISTS event_payloads"
	invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	const-string v0, "CREATE TABLE event_payloads (sequence_num INTEGER NOT NULL, event_id INTEGER NOT NULL, bytes BLOB NOT NULL,FOREIGN KEY (event_id) REFERENCES events(_id) ON DELETE CASCADE,PRIMARY KEY (sequence_num, event_id))"
	invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	goto :goto_2
	:pswitch_1
	const-string v0, "ALTER TABLE events ADD COLUMN payload_encoding TEXT"
	invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	goto :goto_2
	:pswitch_2
	const-string v0, "ALTER TABLE transport_contexts ADD COLUMN extras BLOB"
	invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	const-string v0, "CREATE UNIQUE INDEX contexts_backend_priority_extras on transport_contexts(backend_name, priority, extras)"
	invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	const-string v0, "DROP INDEX contexts_backend_priority"
	invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	goto :goto_2
	:pswitch_3
	const-string v0, "CREATE TABLE events (_id INTEGER PRIMARY KEY, context_id INTEGER NOT NULL, transport_name TEXT NOT NULL, timestamp_ms INTEGER NOT NULL, uptime_ms INTEGER NOT NULL, payload BLOB NOT NULL, code INTEGER, num_attempts INTEGER NOT NULL,FOREIGN KEY (context_id) REFERENCES transport_contexts(_id) ON DELETE CASCADE)"
	invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	const-string v0, "CREATE TABLE event_metadata (_id INTEGER PRIMARY KEY, event_id INTEGER NOT NULL, name TEXT NOT NULL, value TEXT NOT NULL,FOREIGN KEY (event_id) REFERENCES events(_id) ON DELETE CASCADE)"
	invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	const-string v0, "CREATE TABLE transport_contexts (_id INTEGER PRIMARY KEY, backend_name TEXT NOT NULL, priority INTEGER NOT NULL, next_request_ms INTEGER NOT NULL)"
	invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	const-string v0, "CREATE INDEX events_backend_id on events(context_id)"
	invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	const-string v0, "CREATE UNIQUE INDEX contexts_backend_priority on transport_contexts(backend_name, priority)"
	invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	goto :goto_2
	:goto_1
	const-string v0, "DROP TABLE IF EXISTS log_event_dropped"
	invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	const-string v0, "DROP TABLE IF EXISTS global_log_event_state"
	invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	const-string v0, "CREATE TABLE log_event_dropped (log_source VARCHAR(45) NOT NULL,reason INTEGER NOT NULL,events_dropped_count BIGINT NOT NULL,PRIMARY KEY(log_source, reason))"
	invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	const-string v0, "CREATE TABLE global_log_event_state (last_metrics_upload_ms BIGINT PRIMARY KEY)"
	invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	sget-object v0, Lr/n;->c:Ljava/lang/String;
	invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	:goto_2
	add-int/lit8 p1, p1, 0x1
	goto :goto_0
	:cond_0
	return-void
	:cond_1
	new-instance p0, Ljava/lang/IllegalArgumentException;
	new-instance v1, Ljava/lang/StringBuilder;
	invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
	const-string v2, "Migration from "
	invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
	const-string p1, " to "
	invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
	const-string p1, " was requested, but cannot be performed. Only "
	invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-interface {v0}, Ljava/util/List;->size()I
	move-result p1
	invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
	const-string p1, " migrations are provided"
	invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
	move-result-object p1
	invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
	throw p0
	nop
	:pswitch_data_0
	.packed-switch 0x0
	:pswitch_3
	:pswitch_2
	:pswitch_1
	:pswitch_0
	.end packed-switch
.end method

.method public final onConfigure(Landroid/database/sqlite/SQLiteDatabase;)V
	.locals 3

	const/4 v0, 0x1
	iput-boolean v0, p0, Lr/n;->b:Z
	const/4 v1, 0x0
	new-array v1, v1, [Ljava/lang/String;
	const-string v2, "PRAGMA busy_timeout=0;"
	invoke-virtual {p1, v2, v1}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;
	move-result-object v1
	invoke-interface {v1}, Landroid/database/Cursor;->close()V
	invoke-virtual {p1, v0}, Landroid/database/sqlite/SQLiteDatabase;->setForeignKeyConstraintsEnabled(Z)V
	return-void
.end method

.method public final onCreate(Landroid/database/sqlite/SQLiteDatabase;)V
	.locals 2

	iget v0, p0, Lr/n;->a:I
	iget-boolean v1, p0, Lr/n;->b:Z
	if-nez v1, :cond_0
	invoke-virtual {p0, p1}, Lr/n;->onConfigure(Landroid/database/sqlite/SQLiteDatabase;)V
	:cond_0
	const/4 v1, 0x0
	invoke-static {p1, v1, v0}, Lr/n;->a(Landroid/database/sqlite/SQLiteDatabase;II)V
	return-void
.end method

.method public final onDowngrade(Landroid/database/sqlite/SQLiteDatabase;II)V
	.locals 0

	const-string p2, "DROP TABLE events"
	invoke-virtual {p1, p2}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	const-string p2, "DROP TABLE event_metadata"
	invoke-virtual {p1, p2}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	const-string p2, "DROP TABLE transport_contexts"
	invoke-virtual {p1, p2}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	const-string p2, "DROP TABLE IF EXISTS event_payloads"
	invoke-virtual {p1, p2}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	const-string p2, "DROP TABLE IF EXISTS log_event_dropped"
	invoke-virtual {p1, p2}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	const-string p2, "DROP TABLE IF EXISTS global_log_event_state"
	invoke-virtual {p1, p2}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
	iget-boolean p2, p0, Lr/n;->b:Z
	if-nez p2, :cond_0
	invoke-virtual {p0, p1}, Lr/n;->onConfigure(Landroid/database/sqlite/SQLiteDatabase;)V
	:cond_0
	const/4 p2, 0x0
	invoke-static {p1, p2, p3}, Lr/n;->a(Landroid/database/sqlite/SQLiteDatabase;II)V
	return-void
.end method

.method public final onOpen(Landroid/database/sqlite/SQLiteDatabase;)V
	.locals 1

	iget-boolean v0, p0, Lr/n;->b:Z
	if-nez v0, :cond_0
	invoke-virtual {p0, p1}, Lr/n;->onConfigure(Landroid/database/sqlite/SQLiteDatabase;)V
	:cond_0
	return-void
.end method

.method public final onUpgrade(Landroid/database/sqlite/SQLiteDatabase;II)V
	.locals 1

	iget-boolean v0, p0, Lr/n;->b:Z
	if-nez v0, :cond_0
	invoke-virtual {p0, p1}, Lr/n;->onConfigure(Landroid/database/sqlite/SQLiteDatabase;)V
	:cond_0
	invoke-static {p1, p2, p3}, Lr/n;->a(Landroid/database/sqlite/SQLiteDatabase;II)V
	return-void
.end method