package androidx.work.impl;

import androidx.room.d;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
import com.google.android.gms.measurement.api.AppMeasurementSdk;
import com.google.firebase.remoteconfig.RemoteConfigConstants;
import f5.r;
import f5.t;
import h5.e;
import h6.b;
import h6.c;
import h6.e;
import h6.f;
import h6.g;
import h6.h;
import h6.j;
import h6.k;
import h6.m;
import h6.n;
import h6.p;
import h6.q;
import h6.s;
import h6.v;
import h6.w;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;

/* loaded from: classes.dex */
public final class WorkDatabase_Impl extends WorkDatabase {

    /* renamed from: q, reason: collision with root package name */
    private volatile s f5900q;

    /* renamed from: r, reason: collision with root package name */
    private volatile b f5901r;

    /* renamed from: s, reason: collision with root package name */
    private volatile v f5902s;

    /* renamed from: t, reason: collision with root package name */
    private volatile j f5903t;

    /* renamed from: u, reason: collision with root package name */
    private volatile m f5904u;

    /* renamed from: v, reason: collision with root package name */
    private volatile p f5905v;

    /* renamed from: w, reason: collision with root package name */
    private volatile e f5906w;

    /* renamed from: x, reason: collision with root package name */
    private volatile g f5907x;

    /* loaded from: classes.dex */
    class a extends t.b {
        a(int i10) {
            super(i10);
        }

        @Override // f5.t.b
        public void a(SupportSQLiteDatabase supportSQLiteDatabase) {
            supportSQLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS `Dependency` (`work_spec_id` TEXT NOT NULL, `prerequisite_id` TEXT NOT NULL, PRIMARY KEY(`work_spec_id`, `prerequisite_id`), FOREIGN KEY(`work_spec_id`) REFERENCES `WorkSpec`(`id`) ON UPDATE CASCADE ON DELETE CASCADE , FOREIGN KEY(`prerequisite_id`) REFERENCES `WorkSpec`(`id`) ON UPDATE CASCADE ON DELETE CASCADE )");
            supportSQLiteDatabase.execSQL("CREATE INDEX IF NOT EXISTS `index_Dependency_work_spec_id` ON `Dependency` (`work_spec_id`)");
            supportSQLiteDatabase.execSQL("CREATE INDEX IF NOT EXISTS `index_Dependency_prerequisite_id` ON `Dependency` (`prerequisite_id`)");
            supportSQLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS `WorkSpec` (`id` TEXT NOT NULL, `state` INTEGER NOT NULL, `worker_class_name` TEXT NOT NULL, `input_merger_class_name` TEXT, `input` BLOB NOT NULL, `output` BLOB NOT NULL, `initial_delay` INTEGER NOT NULL, `interval_duration` INTEGER NOT NULL, `flex_duration` INTEGER NOT NULL, `run_attempt_count` INTEGER NOT NULL, `backoff_policy` INTEGER NOT NULL, `backoff_delay_duration` INTEGER NOT NULL, `period_start_time` INTEGER NOT NULL, `minimum_retention_duration` INTEGER NOT NULL, `schedule_requested_at` INTEGER NOT NULL, `run_in_foreground` INTEGER NOT NULL, `out_of_quota_policy` INTEGER NOT NULL, `required_network_type` INTEGER, `requires_charging` INTEGER NOT NULL, `requires_device_idle` INTEGER NOT NULL, `requires_battery_not_low` INTEGER NOT NULL, `requires_storage_not_low` INTEGER NOT NULL, `trigger_content_update_delay` INTEGER NOT NULL, `trigger_max_content_delay` INTEGER NOT NULL, `content_uri_triggers` BLOB, PRIMARY KEY(`id`))");
            supportSQLiteDatabase.execSQL("CREATE INDEX IF NOT EXISTS `index_WorkSpec_schedule_requested_at` ON `WorkSpec` (`schedule_requested_at`)");
            supportSQLiteDatabase.execSQL("CREATE INDEX IF NOT EXISTS `index_WorkSpec_period_start_time` ON `WorkSpec` (`period_start_time`)");
            supportSQLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS `WorkTag` (`tag` TEXT NOT NULL, `work_spec_id` TEXT NOT NULL, PRIMARY KEY(`tag`, `work_spec_id`), FOREIGN KEY(`work_spec_id`) REFERENCES `WorkSpec`(`id`) ON UPDATE CASCADE ON DELETE CASCADE )");
            supportSQLiteDatabase.execSQL("CREATE INDEX IF NOT EXISTS `index_WorkTag_work_spec_id` ON `WorkTag` (`work_spec_id`)");
            supportSQLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS `SystemIdInfo` (`work_spec_id` TEXT NOT NULL, `system_id` INTEGER NOT NULL, PRIMARY KEY(`work_spec_id`), FOREIGN KEY(`work_spec_id`) REFERENCES `WorkSpec`(`id`) ON UPDATE CASCADE ON DELETE CASCADE )");
            supportSQLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS `WorkName` (`name` TEXT NOT NULL, `work_spec_id` TEXT NOT NULL, PRIMARY KEY(`name`, `work_spec_id`), FOREIGN KEY(`work_spec_id`) REFERENCES `WorkSpec`(`id`) ON UPDATE CASCADE ON DELETE CASCADE )");
            supportSQLiteDatabase.execSQL("CREATE INDEX IF NOT EXISTS `index_WorkName_work_spec_id` ON `WorkName` (`work_spec_id`)");
            supportSQLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS `WorkProgress` (`work_spec_id` TEXT NOT NULL, `progress` BLOB NOT NULL, PRIMARY KEY(`work_spec_id`), FOREIGN KEY(`work_spec_id`) REFERENCES `WorkSpec`(`id`) ON UPDATE CASCADE ON DELETE CASCADE )");
            supportSQLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS `Preference` (`key` TEXT NOT NULL, `long_value` INTEGER, PRIMARY KEY(`key`))");
            supportSQLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)");
            supportSQLiteDatabase.execSQL("INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'c103703e120ae8cc73c9248622f3cd1e')");
        }

        @Override // f5.t.b
        public void b(SupportSQLiteDatabase supportSQLiteDatabase) {
            supportSQLiteDatabase.execSQL("DROP TABLE IF EXISTS `Dependency`");
            supportSQLiteDatabase.execSQL("DROP TABLE IF EXISTS `WorkSpec`");
            supportSQLiteDatabase.execSQL("DROP TABLE IF EXISTS `WorkTag`");
            supportSQLiteDatabase.execSQL("DROP TABLE IF EXISTS `SystemIdInfo`");
            supportSQLiteDatabase.execSQL("DROP TABLE IF EXISTS `WorkName`");
            supportSQLiteDatabase.execSQL("DROP TABLE IF EXISTS `WorkProgress`");
            supportSQLiteDatabase.execSQL("DROP TABLE IF EXISTS `Preference`");
            if (((r) WorkDatabase_Impl.this).f17845h != null) {
                int size = ((r) WorkDatabase_Impl.this).f17845h.size();
                for (int i10 = 0; i10 < size; i10++) {
                    ((r.b) ((r) WorkDatabase_Impl.this).f17845h.get(i10)).b(supportSQLiteDatabase);
                }
            }
        }

        /* JADX INFO: Access modifiers changed from: protected */
        @Override // f5.t.b
        public void c(SupportSQLiteDatabase supportSQLiteDatabase) {
            if (((r) WorkDatabase_Impl.this).f17845h != null) {
                int size = ((r) WorkDatabase_Impl.this).f17845h.size();
                for (int i10 = 0; i10 < size; i10++) {
                    ((r.b) ((r) WorkDatabase_Impl.this).f17845h.get(i10)).a(supportSQLiteDatabase);
                }
            }
        }

        @Override // f5.t.b
        public void d(SupportSQLiteDatabase supportSQLiteDatabase) {
            ((r) WorkDatabase_Impl.this).f17838a = supportSQLiteDatabase;
            supportSQLiteDatabase.execSQL("PRAGMA foreign_keys = ON");
            WorkDatabase_Impl.this.w(supportSQLiteDatabase);
            if (((r) WorkDatabase_Impl.this).f17845h != null) {
                int size = ((r) WorkDatabase_Impl.this).f17845h.size();
                for (int i10 = 0; i10 < size; i10++) {
                    ((r.b) ((r) WorkDatabase_Impl.this).f17845h.get(i10)).c(supportSQLiteDatabase);
                }
            }
        }

        @Override // f5.t.b
        public void e(SupportSQLiteDatabase supportSQLiteDatabase) {
        }

        @Override // f5.t.b
        public void f(SupportSQLiteDatabase supportSQLiteDatabase) {
            h5.b.a(supportSQLiteDatabase);
        }

        /* JADX INFO: Access modifiers changed from: protected */
        @Override // f5.t.b
        public t.c g(SupportSQLiteDatabase supportSQLiteDatabase) {
            HashMap hashMap = new HashMap(2);
            hashMap.put("work_spec_id", new e.a("work_spec_id", "TEXT", true, 1, null, 1));
            hashMap.put("prerequisite_id", new e.a("prerequisite_id", "TEXT", true, 2, null, 1));
            HashSet hashSet = new HashSet(2);
            hashSet.add(new e.c("WorkSpec", "CASCADE", "CASCADE", Arrays.asList("work_spec_id"), Arrays.asList("id")));
            hashSet.add(new e.c("WorkSpec", "CASCADE", "CASCADE", Arrays.asList("prerequisite_id"), Arrays.asList("id")));
            HashSet hashSet2 = new HashSet(2);
            hashSet2.add(new e.C0454e("index_Dependency_work_spec_id", false, Arrays.asList("work_spec_id")));
            hashSet2.add(new e.C0454e("index_Dependency_prerequisite_id", false, Arrays.asList("prerequisite_id")));
            h5.e eVar = new h5.e("Dependency", hashMap, hashSet, hashSet2);
            h5.e a10 = h5.e.a(supportSQLiteDatabase, "Dependency");
            if (!eVar.equals(a10)) {
                return new t.c(false, "Dependency(androidx.work.impl.model.Dependency).\n Expected:\n" + eVar + "\n Found:\n" + a10);
            }
            HashMap hashMap2 = new HashMap(25);
            hashMap2.put("id", new e.a("id", "TEXT", true, 1, null, 1));
            hashMap2.put(RemoteConfigConstants.ResponseFieldKey.STATE, new e.a(RemoteConfigConstants.ResponseFieldKey.STATE, "INTEGER", true, 0, null, 1));
            hashMap2.put("worker_class_name", new e.a("worker_class_name", "TEXT", true, 0, null, 1));
            hashMap2.put("input_merger_class_name", new e.a("input_merger_class_name", "TEXT", false, 0, null, 1));
            hashMap2.put("input", new e.a("input", "BLOB", true, 0, null, 1));
            hashMap2.put("output", new e.a("output", "BLOB", true, 0, null, 1));
            hashMap2.put("initial_delay", new e.a("initial_delay", "INTEGER", true, 0, null, 1));
            hashMap2.put("interval_duration", new e.a("interval_duration", "INTEGER", true, 0, null, 1));
            hashMap2.put("flex_duration", new e.a("flex_duration", "INTEGER", true, 0, null, 1));
            hashMap2.put("run_attempt_count", new e.a("run_attempt_count", "INTEGER", true, 0, null, 1));
            hashMap2.put("backoff_policy", new e.a("backoff_policy", "INTEGER", true, 0, null, 1));
            hashMap2.put("backoff_delay_duration", new e.a("backoff_delay_duration", "INTEGER", true, 0, null, 1));
            hashMap2.put("period_start_time", new e.a("period_start_time", "INTEGER", true, 0, null, 1));
            hashMap2.put("minimum_retention_duration", new e.a("minimum_retention_duration", "INTEGER", true, 0, null, 1));
            hashMap2.put("schedule_requested_at", new e.a("schedule_requested_at", "INTEGER", true, 0, null, 1));
            hashMap2.put("run_in_foreground", new e.a("run_in_foreground", "INTEGER", true, 0, null, 1));
            hashMap2.put("out_of_quota_policy", new e.a("out_of_quota_policy", "INTEGER", true, 0, null, 1));
            hashMap2.put("required_network_type", new e.a("required_network_type", "INTEGER", false, 0, null, 1));
            hashMap2.put("requires_charging", new e.a("requires_charging", "INTEGER", true, 0, null, 1));
            hashMap2.put("requires_device_idle", new e.a("requires_device_idle", "INTEGER", true, 0, null, 1));
            hashMap2.put("requires_battery_not_low", new e.a("requires_battery_not_low", "INTEGER", true, 0, null, 1));
            hashMap2.put("requires_storage_not_low", new e.a("requires_storage_not_low", "INTEGER", true, 0, null, 1));
            hashMap2.put("trigger_content_update_delay", new e.a("trigger_content_update_delay", "INTEGER", true, 0, null, 1));
            hashMap2.put("trigger_max_content_delay", new e.a("trigger_max_content_delay", "INTEGER", true, 0, null, 1));
            hashMap2.put("content_uri_triggers", new e.a("content_uri_triggers", "BLOB", false, 0, null, 1));
            HashSet hashSet3 = new HashSet(0);
            HashSet hashSet4 = new HashSet(2);
            hashSet4.add(new e.C0454e("index_WorkSpec_schedule_requested_at", false, Arrays.asList("schedule_requested_at")));
            hashSet4.add(new e.C0454e("index_WorkSpec_period_start_time", false, Arrays.asList("period_start_time")));
            h5.e eVar2 = new h5.e("WorkSpec", hashMap2, hashSet3, hashSet4);
            h5.e a11 = h5.e.a(supportSQLiteDatabase, "WorkSpec");
            if (!eVar2.equals(a11)) {
                return new t.c(false, "WorkSpec(androidx.work.impl.model.WorkSpec).\n Expected:\n" + eVar2 + "\n Found:\n" + a11);
            }
            HashMap hashMap3 = new HashMap(2);
            hashMap3.put("tag", new e.a("tag", "TEXT", true, 1, null, 1));
            hashMap3.put("work_spec_id", new e.a("work_spec_id", "TEXT", true, 2, null, 1));
            HashSet hashSet5 = new HashSet(1);
            hashSet5.add(new e.c("WorkSpec", "CASCADE", "CASCADE", Arrays.asList("work_spec_id"), Arrays.asList("id")));
            HashSet hashSet6 = new HashSet(1);
            hashSet6.add(new e.C0454e("index_WorkTag_work_spec_id", false, Arrays.asList("work_spec_id")));
            h5.e eVar3 = new h5.e("WorkTag", hashMap3, hashSet5, hashSet6);
            h5.e a12 = h5.e.a(supportSQLiteDatabase, "WorkTag");
            if (!eVar3.equals(a12)) {
                return new t.c(false, "WorkTag(androidx.work.impl.model.WorkTag).\n Expected:\n" + eVar3 + "\n Found:\n" + a12);
            }
            HashMap hashMap4 = new HashMap(2);
            hashMap4.put("work_spec_id", new e.a("work_spec_id", "TEXT", true, 1, null, 1));
            hashMap4.put("system_id", new e.a("system_id", "INTEGER", true, 0, null, 1));
            HashSet hashSet7 = new HashSet(1);
            hashSet7.add(new e.c("WorkSpec", "CASCADE", "CASCADE", Arrays.asList("work_spec_id"), Arrays.asList("id")));
            h5.e eVar4 = new h5.e("SystemIdInfo", hashMap4, hashSet7, new HashSet(0));
            h5.e a13 = h5.e.a(supportSQLiteDatabase, "SystemIdInfo");
            if (!eVar4.equals(a13)) {
                return new t.c(false, "SystemIdInfo(androidx.work.impl.model.SystemIdInfo).\n Expected:\n" + eVar4 + "\n Found:\n" + a13);
            }
            HashMap hashMap5 = new HashMap(2);
            hashMap5.put(AppMeasurementSdk.ConditionalUserProperty.NAME, new e.a(AppMeasurementSdk.ConditionalUserProperty.NAME, "TEXT", true, 1, null, 1));
            hashMap5.put("work_spec_id", new e.a("work_spec_id", "TEXT", true, 2, null, 1));
            HashSet hashSet8 = new HashSet(1);
            hashSet8.add(new e.c("WorkSpec", "CASCADE", "CASCADE", Arrays.asList("work_spec_id"), Arrays.asList("id")));
            HashSet hashSet9 = new HashSet(1);
            hashSet9.add(new e.C0454e("index_WorkName_work_spec_id", false, Arrays.asList("work_spec_id")));
            h5.e eVar5 = new h5.e("WorkName", hashMap5, hashSet8, hashSet9);
            h5.e a14 = h5.e.a(supportSQLiteDatabase, "WorkName");
            if (!eVar5.equals(a14)) {
                return new t.c(false, "WorkName(androidx.work.impl.model.WorkName).\n Expected:\n" + eVar5 + "\n Found:\n" + a14);
            }
            HashMap hashMap6 = new HashMap(2);
            hashMap6.put("work_spec_id", new e.a("work_spec_id", "TEXT", true, 1, null, 1));
            hashMap6.put("progress", new e.a("progress", "BLOB", true, 0, null, 1));
            HashSet hashSet10 = new HashSet(1);
            hashSet10.add(new e.c("WorkSpec", "CASCADE", "CASCADE", Arrays.asList("work_spec_id"), Arrays.asList("id")));
            h5.e eVar6 = new h5.e("WorkProgress", hashMap6, hashSet10, new HashSet(0));
            h5.e a15 = h5.e.a(supportSQLiteDatabase, "WorkProgress");
            if (!eVar6.equals(a15)) {
                return new t.c(false, "WorkProgress(androidx.work.impl.model.WorkProgress).\n Expected:\n" + eVar6 + "\n Found:\n" + a15);
            }
            HashMap hashMap7 = new HashMap(2);
            hashMap7.put("key", new e.a("key", "TEXT", true, 1, null, 1));
            hashMap7.put("long_value", new e.a("long_value", "INTEGER", false, 0, null, 1));
            h5.e eVar7 = new h5.e("Preference", hashMap7, new HashSet(0), new HashSet(0));
            h5.e a16 = h5.e.a(supportSQLiteDatabase, "Preference");
            if (eVar7.equals(a16)) {
                return new t.c(true, null);
            }
            return new t.c(false, "Preference(androidx.work.impl.model.Preference).\n Expected:\n" + eVar7 + "\n Found:\n" + a16);
        }
    }

    @Override // androidx.work.impl.WorkDatabase
    public b F() {
        b bVar;
        if (this.f5901r != null) {
            return this.f5901r;
        }
        synchronized (this) {
            if (this.f5901r == null) {
                this.f5901r = new c(this);
            }
            bVar = this.f5901r;
        }
        return bVar;
    }

    @Override // androidx.work.impl.WorkDatabase
    public h6.e J() {
        h6.e eVar;
        if (this.f5906w != null) {
            return this.f5906w;
        }
        synchronized (this) {
            if (this.f5906w == null) {
                this.f5906w = new f(this);
            }
            eVar = this.f5906w;
        }
        return eVar;
    }

    @Override // androidx.work.impl.WorkDatabase
    public g K() {
        g gVar;
        if (this.f5907x != null) {
            return this.f5907x;
        }
        synchronized (this) {
            if (this.f5907x == null) {
                this.f5907x = new h(this);
            }
            gVar = this.f5907x;
        }
        return gVar;
    }

    @Override // androidx.work.impl.WorkDatabase
    public j L() {
        j jVar;
        if (this.f5903t != null) {
            return this.f5903t;
        }
        synchronized (this) {
            if (this.f5903t == null) {
                this.f5903t = new k(this);
            }
            jVar = this.f5903t;
        }
        return jVar;
    }

    @Override // androidx.work.impl.WorkDatabase
    public m M() {
        m mVar;
        if (this.f5904u != null) {
            return this.f5904u;
        }
        synchronized (this) {
            if (this.f5904u == null) {
                this.f5904u = new n(this);
            }
            mVar = this.f5904u;
        }
        return mVar;
    }

    @Override // androidx.work.impl.WorkDatabase
    public p N() {
        p pVar;
        if (this.f5905v != null) {
            return this.f5905v;
        }
        synchronized (this) {
            if (this.f5905v == null) {
                this.f5905v = new q(this);
            }
            pVar = this.f5905v;
        }
        return pVar;
    }

    @Override // androidx.work.impl.WorkDatabase
    public s O() {
        s sVar;
        if (this.f5900q != null) {
            return this.f5900q;
        }
        synchronized (this) {
            if (this.f5900q == null) {
                this.f5900q = new h6.t(this);
            }
            sVar = this.f5900q;
        }
        return sVar;
    }

    @Override // androidx.work.impl.WorkDatabase
    public v P() {
        v vVar;
        if (this.f5902s != null) {
            return this.f5902s;
        }
        synchronized (this) {
            if (this.f5902s == null) {
                this.f5902s = new w(this);
            }
            vVar = this.f5902s;
        }
        return vVar;
    }

    @Override // f5.r
    protected d g() {
        return new d(this, new HashMap(0), new HashMap(0), "Dependency", "WorkSpec", "WorkTag", "SystemIdInfo", "WorkName", "WorkProgress", "Preference");
    }

    @Override // f5.r
    protected SupportSQLiteOpenHelper h(f5.g gVar) {
        return gVar.f17812c.create(SupportSQLiteOpenHelper.Configuration.a(gVar.f17810a).c(gVar.f17811b).b(new t(gVar, new a(12), "c103703e120ae8cc73c9248622f3cd1e", "49f946663a8deb7054212b8adda248c6")).a());
    }
}
