package Z1;

import A6.k;
import A6.m;
import F5.C0115b;
import android.content.Context;

/* JADX INFO: loaded from: classes.dex */
public final class h implements Y1.b, AutoCloseable {

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final Context f7412q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final String f7413r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public final B7.a f7414s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public final k f7415t;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public boolean f7416u;

    public h(Context context, String str, B7.a aVar) {
        P6.g.e(aVar, "callback");
        this.f7412q = context;
        this.f7413r = str;
        this.f7414s = aVar;
        this.f7415t = new k(new C0115b(5, this));
    }

    @Override // Y1.b
    public final Y1.a c0() {
        return ((g) this.f7415t.getValue()).a(true);
    }

    @Override // java.io.Closeable, java.lang.AutoCloseable
    public final void close() {
        if (this.f7415t.f451r != m.f456a) {
            ((g) this.f7415t.getValue()).close();
        }
    }

    @Override // Y1.b
    public final String getDatabaseName() {
        return this.f7413r;
    }

    @Override // Y1.b
    public final void setWriteAheadLoggingEnabled(boolean z8) {
        if (this.f7415t.f451r != m.f456a) {
            ((g) this.f7415t.getValue()).setWriteAheadLoggingEnabled(z8);
        }
        this.f7416u = z8;
    }
}
