package androidx.work.impl;

import androidx.media3.exoplayer.offline.DownloadService;
import androidx.media3.exoplayer.rtsp.SessionDescription;
import androidx.media3.extractor.text.ttml.TtmlNode;
import androidx.room.RoomDatabase;
import androidx.room.k;
import com.google.android.gms.measurement.api.AppMeasurementSdk;
import defpackage.cr4;
import defpackage.fi7;
import defpackage.je9;
import defpackage.n41;
import defpackage.sp1;
import defpackage.xi9;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;

/* JADX INFO: loaded from: classes.dex */
class g extends k.b {
    public final /* synthetic */ WorkDatabase_Impl b;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public g(WorkDatabase_Impl workDatabase_Impl) {
        super(20);
        this.b = workDatabase_Impl;
    }

    @Override // androidx.room.k.b
    public final void a(je9 je9Var) {
        n41.z(je9Var, "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 )", "CREATE INDEX IF NOT EXISTS `index_Dependency_work_spec_id` ON `Dependency` (`work_spec_id`)", "CREATE INDEX IF NOT EXISTS `index_Dependency_prerequisite_id` ON `Dependency` (`prerequisite_id`)", "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 NOT NULL, `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, `last_enqueue_time` INTEGER NOT NULL DEFAULT -1, `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, `period_count` INTEGER NOT NULL DEFAULT 0, `generation` INTEGER NOT NULL DEFAULT 0, `next_schedule_time_override` INTEGER NOT NULL DEFAULT 9223372036854775807, `next_schedule_time_override_generation` INTEGER NOT NULL DEFAULT 0, `stop_reason` INTEGER NOT NULL DEFAULT -256, `required_network_type` INTEGER NOT NULL, `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 NOT NULL, PRIMARY KEY(`id`))");
        n41.z(je9Var, "CREATE INDEX IF NOT EXISTS `index_WorkSpec_schedule_requested_at` ON `WorkSpec` (`schedule_requested_at`)", "CREATE INDEX IF NOT EXISTS `index_WorkSpec_last_enqueue_time` ON `WorkSpec` (`last_enqueue_time`)", "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 )", "CREATE INDEX IF NOT EXISTS `index_WorkTag_work_spec_id` ON `WorkTag` (`work_spec_id`)");
        n41.z(je9Var, "CREATE TABLE IF NOT EXISTS `SystemIdInfo` (`work_spec_id` TEXT NOT NULL, `generation` INTEGER NOT NULL DEFAULT 0, `system_id` INTEGER NOT NULL, PRIMARY KEY(`work_spec_id`, `generation`), FOREIGN KEY(`work_spec_id`) REFERENCES `WorkSpec`(`id`) ON UPDATE CASCADE ON DELETE CASCADE )", "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 )", "CREATE INDEX IF NOT EXISTS `index_WorkName_work_spec_id` ON `WorkName` (`work_spec_id`)", "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 )");
        je9Var.execSQL("CREATE TABLE IF NOT EXISTS `Preference` (`key` TEXT NOT NULL, `long_value` INTEGER, PRIMARY KEY(`key`))");
        je9Var.execSQL("CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)");
        je9Var.execSQL("INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '7d73d21f1bd82c9e5268b6dcf9fde2cb')");
    }

    @Override // androidx.room.k.b
    public final void b(je9 je9Var) {
        n41.z(je9Var, "DROP TABLE IF EXISTS `Dependency`", "DROP TABLE IF EXISTS `WorkSpec`", "DROP TABLE IF EXISTS `WorkTag`", "DROP TABLE IF EXISTS `SystemIdInfo`");
        je9Var.execSQL("DROP TABLE IF EXISTS `WorkName`");
        je9Var.execSQL("DROP TABLE IF EXISTS `WorkProgress`");
        je9Var.execSQL("DROP TABLE IF EXISTS `Preference`");
        WorkDatabase_Impl workDatabase_Impl = this.b;
        if (((RoomDatabase) workDatabase_Impl).mCallbacks != null) {
            int size = ((RoomDatabase) workDatabase_Impl).mCallbacks.size();
            for (int i = 0; i < size; i++) {
                ((RoomDatabase.b) ((RoomDatabase) workDatabase_Impl).mCallbacks.get(i)).getClass();
            }
        }
    }

    @Override // androidx.room.k.b
    public final void c(je9 je9Var) {
        WorkDatabase_Impl workDatabase_Impl = this.b;
        if (((RoomDatabase) workDatabase_Impl).mCallbacks != null) {
            int size = ((RoomDatabase) workDatabase_Impl).mCallbacks.size();
            for (int i = 0; i < size; i++) {
                ((RoomDatabase.b) ((RoomDatabase) workDatabase_Impl).mCallbacks.get(i)).getClass();
                cr4.g(je9Var, "db");
            }
        }
    }

    @Override // androidx.room.k.b
    public final void d(je9 je9Var) {
        WorkDatabase_Impl workDatabase_Impl = this.b;
        ((RoomDatabase) workDatabase_Impl).mDatabase = je9Var;
        je9Var.execSQL("PRAGMA foreign_keys = ON");
        workDatabase_Impl.internalInitInvalidationTracker(je9Var);
        if (((RoomDatabase) workDatabase_Impl).mCallbacks != null) {
            int size = ((RoomDatabase) workDatabase_Impl).mCallbacks.size();
            for (int i = 0; i < size; i++) {
                ((RoomDatabase.b) ((RoomDatabase) workDatabase_Impl).mCallbacks.get(i)).a(je9Var);
            }
        }
    }

    @Override // androidx.room.k.b
    public final void e(je9 je9Var) {
    }

    @Override // androidx.room.k.b
    public final void f(je9 je9Var) throws IOException {
        sp1.a(je9Var);
    }

    @Override // androidx.room.k.b
    public final k.c g(je9 je9Var) throws IOException {
        HashMap map = new HashMap(2);
        map.put("work_spec_id", new xi9.a(1, "work_spec_id", "TEXT", null, true, 1));
        HashSet hashSetN = fi7.n(map, "prerequisite_id", new xi9.a(2, "prerequisite_id", "TEXT", null, true, 1), 2);
        hashSetN.add(new xi9.d("WorkSpec", "CASCADE", "CASCADE", Arrays.asList("work_spec_id"), Arrays.asList(TtmlNode.ATTR_ID)));
        hashSetN.add(new xi9.d("WorkSpec", "CASCADE", "CASCADE", Arrays.asList("prerequisite_id"), Arrays.asList(TtmlNode.ATTR_ID)));
        HashSet hashSet = new HashSet(2);
        hashSet.add(new xi9.f("index_Dependency_work_spec_id", false, Arrays.asList("work_spec_id"), Arrays.asList("ASC")));
        hashSet.add(new xi9.f("index_Dependency_prerequisite_id", false, Arrays.asList("prerequisite_id"), Arrays.asList("ASC")));
        xi9 xi9Var = new xi9("Dependency", map, hashSetN, hashSet);
        xi9 xi9VarA = xi9.a(je9Var, "Dependency");
        if (!xi9Var.equals(xi9VarA)) {
            return new k.c(false, fi7.g("Dependency(androidx.work.impl.model.Dependency).\n Expected:\n", xi9Var, "\n Found:\n", xi9VarA));
        }
        HashMap map2 = new HashMap(30);
        map2.put(TtmlNode.ATTR_ID, new xi9.a(1, TtmlNode.ATTR_ID, "TEXT", null, true, 1));
        map2.put("state", new xi9.a(0, "state", "INTEGER", null, true, 1));
        map2.put("worker_class_name", new xi9.a(0, "worker_class_name", "TEXT", null, true, 1));
        map2.put("input_merger_class_name", new xi9.a(0, "input_merger_class_name", "TEXT", null, true, 1));
        map2.put("input", new xi9.a(0, "input", "BLOB", null, true, 1));
        map2.put("output", new xi9.a(0, "output", "BLOB", null, true, 1));
        map2.put("initial_delay", new xi9.a(0, "initial_delay", "INTEGER", null, true, 1));
        map2.put("interval_duration", new xi9.a(0, "interval_duration", "INTEGER", null, true, 1));
        map2.put("flex_duration", new xi9.a(0, "flex_duration", "INTEGER", null, true, 1));
        map2.put("run_attempt_count", new xi9.a(0, "run_attempt_count", "INTEGER", null, true, 1));
        map2.put("backoff_policy", new xi9.a(0, "backoff_policy", "INTEGER", null, true, 1));
        map2.put("backoff_delay_duration", new xi9.a(0, "backoff_delay_duration", "INTEGER", null, true, 1));
        map2.put("last_enqueue_time", new xi9.a(0, "last_enqueue_time", "INTEGER", "-1", true, 1));
        map2.put("minimum_retention_duration", new xi9.a(0, "minimum_retention_duration", "INTEGER", null, true, 1));
        map2.put("schedule_requested_at", new xi9.a(0, "schedule_requested_at", "INTEGER", null, true, 1));
        map2.put("run_in_foreground", new xi9.a(0, "run_in_foreground", "INTEGER", null, true, 1));
        map2.put("out_of_quota_policy", new xi9.a(0, "out_of_quota_policy", "INTEGER", null, true, 1));
        map2.put("period_count", new xi9.a(0, "period_count", "INTEGER", SessionDescription.SUPPORTED_SDP_VERSION, true, 1));
        map2.put("generation", new xi9.a(0, "generation", "INTEGER", SessionDescription.SUPPORTED_SDP_VERSION, true, 1));
        map2.put("next_schedule_time_override", new xi9.a(0, "next_schedule_time_override", "INTEGER", "9223372036854775807", true, 1));
        map2.put("next_schedule_time_override_generation", new xi9.a(0, "next_schedule_time_override_generation", "INTEGER", SessionDescription.SUPPORTED_SDP_VERSION, true, 1));
        map2.put(DownloadService.KEY_STOP_REASON, new xi9.a(0, DownloadService.KEY_STOP_REASON, "INTEGER", "-256", true, 1));
        map2.put("required_network_type", new xi9.a(0, "required_network_type", "INTEGER", null, true, 1));
        map2.put("requires_charging", new xi9.a(0, "requires_charging", "INTEGER", null, true, 1));
        map2.put("requires_device_idle", new xi9.a(0, "requires_device_idle", "INTEGER", null, true, 1));
        map2.put("requires_battery_not_low", new xi9.a(0, "requires_battery_not_low", "INTEGER", null, true, 1));
        map2.put("requires_storage_not_low", new xi9.a(0, "requires_storage_not_low", "INTEGER", null, true, 1));
        map2.put("trigger_content_update_delay", new xi9.a(0, "trigger_content_update_delay", "INTEGER", null, true, 1));
        map2.put("trigger_max_content_delay", new xi9.a(0, "trigger_max_content_delay", "INTEGER", null, true, 1));
        HashSet hashSetN2 = fi7.n(map2, "content_uri_triggers", new xi9.a(0, "content_uri_triggers", "BLOB", null, true, 1), 0);
        HashSet hashSet2 = new HashSet(2);
        hashSet2.add(new xi9.f("index_WorkSpec_schedule_requested_at", false, Arrays.asList("schedule_requested_at"), Arrays.asList("ASC")));
        hashSet2.add(new xi9.f("index_WorkSpec_last_enqueue_time", false, Arrays.asList("last_enqueue_time"), Arrays.asList("ASC")));
        xi9 xi9Var2 = new xi9("WorkSpec", map2, hashSetN2, hashSet2);
        xi9 xi9VarA2 = xi9.a(je9Var, "WorkSpec");
        if (!xi9Var2.equals(xi9VarA2)) {
            return new k.c(false, fi7.g("WorkSpec(androidx.work.impl.model.WorkSpec).\n Expected:\n", xi9Var2, "\n Found:\n", xi9VarA2));
        }
        HashMap map3 = new HashMap(2);
        map3.put("tag", new xi9.a(1, "tag", "TEXT", null, true, 1));
        HashSet hashSetN3 = fi7.n(map3, "work_spec_id", new xi9.a(2, "work_spec_id", "TEXT", null, true, 1), 1);
        hashSetN3.add(new xi9.d("WorkSpec", "CASCADE", "CASCADE", Arrays.asList("work_spec_id"), Arrays.asList(TtmlNode.ATTR_ID)));
        HashSet hashSet3 = new HashSet(1);
        hashSet3.add(new xi9.f("index_WorkTag_work_spec_id", false, Arrays.asList("work_spec_id"), Arrays.asList("ASC")));
        xi9 xi9Var3 = new xi9("WorkTag", map3, hashSetN3, hashSet3);
        xi9 xi9VarA3 = xi9.a(je9Var, "WorkTag");
        if (!xi9Var3.equals(xi9VarA3)) {
            return new k.c(false, fi7.g("WorkTag(androidx.work.impl.model.WorkTag).\n Expected:\n", xi9Var3, "\n Found:\n", xi9VarA3));
        }
        HashMap map4 = new HashMap(3);
        map4.put("work_spec_id", new xi9.a(1, "work_spec_id", "TEXT", null, true, 1));
        map4.put("generation", new xi9.a(2, "generation", "INTEGER", SessionDescription.SUPPORTED_SDP_VERSION, true, 1));
        HashSet hashSetN4 = fi7.n(map4, "system_id", new xi9.a(0, "system_id", "INTEGER", null, true, 1), 1);
        hashSetN4.add(new xi9.d("WorkSpec", "CASCADE", "CASCADE", Arrays.asList("work_spec_id"), Arrays.asList(TtmlNode.ATTR_ID)));
        xi9 xi9Var4 = new xi9("SystemIdInfo", map4, hashSetN4, new HashSet(0));
        xi9 xi9VarA4 = xi9.a(je9Var, "SystemIdInfo");
        if (!xi9Var4.equals(xi9VarA4)) {
            return new k.c(false, fi7.g("SystemIdInfo(androidx.work.impl.model.SystemIdInfo).\n Expected:\n", xi9Var4, "\n Found:\n", xi9VarA4));
        }
        HashMap map5 = new HashMap(2);
        map5.put(AppMeasurementSdk.ConditionalUserProperty.NAME, new xi9.a(1, AppMeasurementSdk.ConditionalUserProperty.NAME, "TEXT", null, true, 1));
        HashSet hashSetN5 = fi7.n(map5, "work_spec_id", new xi9.a(2, "work_spec_id", "TEXT", null, true, 1), 1);
        hashSetN5.add(new xi9.d("WorkSpec", "CASCADE", "CASCADE", Arrays.asList("work_spec_id"), Arrays.asList(TtmlNode.ATTR_ID)));
        HashSet hashSet4 = new HashSet(1);
        hashSet4.add(new xi9.f("index_WorkName_work_spec_id", false, Arrays.asList("work_spec_id"), Arrays.asList("ASC")));
        xi9 xi9Var5 = new xi9("WorkName", map5, hashSetN5, hashSet4);
        xi9 xi9VarA5 = xi9.a(je9Var, "WorkName");
        if (!xi9Var5.equals(xi9VarA5)) {
            return new k.c(false, fi7.g("WorkName(androidx.work.impl.model.WorkName).\n Expected:\n", xi9Var5, "\n Found:\n", xi9VarA5));
        }
        HashMap map6 = new HashMap(2);
        map6.put("work_spec_id", new xi9.a(1, "work_spec_id", "TEXT", null, true, 1));
        HashSet hashSetN6 = fi7.n(map6, "progress", new xi9.a(0, "progress", "BLOB", null, true, 1), 1);
        hashSetN6.add(new xi9.d("WorkSpec", "CASCADE", "CASCADE", Arrays.asList("work_spec_id"), Arrays.asList(TtmlNode.ATTR_ID)));
        xi9 xi9Var6 = new xi9("WorkProgress", map6, hashSetN6, new HashSet(0));
        xi9 xi9VarA6 = xi9.a(je9Var, "WorkProgress");
        if (!xi9Var6.equals(xi9VarA6)) {
            return new k.c(false, fi7.g("WorkProgress(androidx.work.impl.model.WorkProgress).\n Expected:\n", xi9Var6, "\n Found:\n", xi9VarA6));
        }
        HashMap map7 = new HashMap(2);
        map7.put("key", new xi9.a(1, "key", "TEXT", null, true, 1));
        xi9 xi9Var7 = new xi9("Preference", map7, fi7.n(map7, "long_value", new xi9.a(0, "long_value", "INTEGER", null, false, 1), 0), new HashSet(0));
        xi9 xi9VarA7 = xi9.a(je9Var, "Preference");
        return !xi9Var7.equals(xi9VarA7) ? new k.c(false, fi7.g("Preference(androidx.work.impl.model.Preference).\n Expected:\n", xi9Var7, "\n Found:\n", xi9VarA7)) : new k.c(true, null);
    }
}
