package defpackage;

import android.content.Intent;
import androidx.work.impl.WorkDatabase_Impl;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.ListIterator;
import java.util.concurrent.locks.ReentrantLock;

/* renamed from: ᵿʿᵶ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C5481 extends AbstractC1741 {

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final /* synthetic */ WorkDatabase_Impl f20569;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C5481(WorkDatabase_Impl workDatabase_Impl) {
        super(24, "08b926448d86528e697981ddd30459f7", "149fd8ad55885d3fe3549a37a0163243");
        this.f20569 = workDatabase_Impl;
    }

    @Override // defpackage.AbstractC1741
    /* renamed from: ˇʼʤˎ */
    public final void mo4948(InterfaceC3042 interfaceC3042) {
        ᵭʝʜ.ᵪʩ(interfaceC3042, "PRAGMA foreign_keys = ON");
        C2429 c2429 = this.f20569.f965;
        if (c2429 == null) {
            c2429 = null;
        }
        C0744 c0744 = c2429.f9471;
        c0744.getClass();
        InterfaceC1171 interfaceC1171Mo1850 = interfaceC3042.mo1850("PRAGMA query_only");
        try {
            interfaceC1171Mo1850.mo3681();
            boolean zMo3677 = interfaceC1171Mo1850.mo3677();
            ᵛᵾˏ.ᵾᵬ(interfaceC1171Mo1850, (Throwable) null);
            if (!zMo3677) {
                ᵭʝʜ.ᵪʩ(interfaceC3042, "PRAGMA temp_store = MEMORY");
                ᵭʝʜ.ᵪʩ(interfaceC3042, "PRAGMA recursive_triggers = 1");
                ᵭʝʜ.ᵪʩ(interfaceC3042, "DROP TABLE IF EXISTS room_table_modification_log");
                if (c0744.f3575) {
                    ᵭʝʜ.ᵪʩ(interfaceC3042, "CREATE TEMP TABLE IF NOT EXISTS room_table_modification_log (table_id INTEGER PRIMARY KEY, invalidated INTEGER NOT NULL DEFAULT 0)");
                } else {
                    ᵭʝʜ.ᵪʩ(interfaceC3042, AbstractC0436.m2048("CREATE TEMP TABLE IF NOT EXISTS room_table_modification_log (table_id INTEGER PRIMARY KEY, invalidated INTEGER NOT NULL DEFAULT 0)", "TEMP", "", false));
                }
                C4699 c4699 = (C4699) c0744.f3579;
                ReentrantLock reentrantLock = (ReentrantLock) c4699.f17372;
                reentrantLock.lock();
                try {
                    c4699.f17373 = true;
                } finally {
                    reentrantLock.unlock();
                }
            }
            synchronized (c2429.f9476) {
                C1153 c1153 = c2429.f9475;
                if (c1153 != null) {
                    Intent intent = c2429.f9472;
                    if (intent == null) {
                        throw new IllegalStateException("Required value was null.");
                    }
                    if (c1153.f4924.compareAndSet(true, false)) {
                        c1153.f4927.bindService(intent, c1153.f4932, 1);
                        c1153.f4930.m6207(c1153.f4928);
                    }
                }
            }
        } finally {
        }
    }

    @Override // defpackage.AbstractC1741
    /* renamed from: ˏˋٴ */
    public final void mo4950() {
    }

    @Override // defpackage.AbstractC1741
    /* renamed from: ˏᵙ */
    public final void mo4951() {
    }

    @Override // defpackage.AbstractC1741
    /* renamed from: ᵝᵵᵺ */
    public final void mo4952(InterfaceC3042 interfaceC3042) {
        C3947 c3947 = ᵿᵧ.ˎˏʜʾ();
        InterfaceC1171 interfaceC1171Mo1850 = interfaceC3042.mo1850("SELECT name FROM sqlite_master WHERE type = 'trigger'");
        while (interfaceC1171Mo1850.mo3681()) {
            try {
                c3947.add(interfaceC1171Mo1850.mo3674(0));
            } finally {
            }
        }
        ᵛᵾˏ.ᵾᵬ(interfaceC1171Mo1850, (Throwable) null);
        ListIterator listIterator = ᵿᵧ.ˏᵙ(c3947).listIterator(0);
        while (true) {
            C4746 c4746 = (C4746) listIterator;
            if (!c4746.hasNext()) {
                return;
            }
            String str = (String) c4746.next();
            if (AbstractC0436.m2049(str, "room_fts_content_sync_", false)) {
                ᵭʝʜ.ᵪʩ(interfaceC3042, "DROP TRIGGER IF EXISTS ".concat(str));
            }
        }
    }

    @Override // defpackage.AbstractC1741
    /* renamed from: ᵥᵯˎ */
    public final void mo4953(InterfaceC3042 interfaceC3042) {
        ᵭʝʜ.ᵪʩ(interfaceC3042, "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 )");
        ᵭʝʜ.ᵪʩ(interfaceC3042, "CREATE INDEX IF NOT EXISTS `index_Dependency_work_spec_id` ON `Dependency` (`work_spec_id`)");
        ᵭʝʜ.ᵪʩ(interfaceC3042, "CREATE INDEX IF NOT EXISTS `index_Dependency_prerequisite_id` ON `Dependency` (`prerequisite_id`)");
        ᵭʝʜ.ᵪʩ(interfaceC3042, "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, `trace_tag` TEXT, `backoff_on_system_interruptions` INTEGER, `required_network_type` INTEGER NOT NULL, `required_network_request` BLOB NOT NULL DEFAULT x'', `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`))");
        ᵭʝʜ.ᵪʩ(interfaceC3042, "CREATE INDEX IF NOT EXISTS `index_WorkSpec_schedule_requested_at` ON `WorkSpec` (`schedule_requested_at`)");
        ᵭʝʜ.ᵪʩ(interfaceC3042, "CREATE INDEX IF NOT EXISTS `index_WorkSpec_last_enqueue_time` ON `WorkSpec` (`last_enqueue_time`)");
        ᵭʝʜ.ᵪʩ(interfaceC3042, "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 )");
        ᵭʝʜ.ᵪʩ(interfaceC3042, "CREATE INDEX IF NOT EXISTS `index_WorkTag_work_spec_id` ON `WorkTag` (`work_spec_id`)");
        ᵭʝʜ.ᵪʩ(interfaceC3042, "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 )");
        ᵭʝʜ.ᵪʩ(interfaceC3042, "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 )");
        ᵭʝʜ.ᵪʩ(interfaceC3042, "CREATE INDEX IF NOT EXISTS `index_WorkName_work_spec_id` ON `WorkName` (`work_spec_id`)");
        ᵭʝʜ.ᵪʩ(interfaceC3042, "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 )");
        ᵭʝʜ.ᵪʩ(interfaceC3042, "CREATE TABLE IF NOT EXISTS `Preference` (`key` TEXT NOT NULL, `long_value` INTEGER, PRIMARY KEY(`key`))");
        ᵭʝʜ.ᵪʩ(interfaceC3042, "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)");
        ᵭʝʜ.ᵪʩ(interfaceC3042, "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '08b926448d86528e697981ddd30459f7')");
    }

    @Override // defpackage.AbstractC1741
    /* renamed from: ᵴᵳ */
    public final void mo4954(InterfaceC3042 interfaceC3042) {
        ᵭʝʜ.ᵪʩ(interfaceC3042, "DROP TABLE IF EXISTS `Dependency`");
        ᵭʝʜ.ᵪʩ(interfaceC3042, "DROP TABLE IF EXISTS `WorkSpec`");
        ᵭʝʜ.ᵪʩ(interfaceC3042, "DROP TABLE IF EXISTS `WorkTag`");
        ᵭʝʜ.ᵪʩ(interfaceC3042, "DROP TABLE IF EXISTS `SystemIdInfo`");
        ᵭʝʜ.ᵪʩ(interfaceC3042, "DROP TABLE IF EXISTS `WorkName`");
        ᵭʝʜ.ᵪʩ(interfaceC3042, "DROP TABLE IF EXISTS `WorkProgress`");
        ᵭʝʜ.ᵪʩ(interfaceC3042, "DROP TABLE IF EXISTS `Preference`");
    }

    @Override // defpackage.AbstractC1741
    /* renamed from: ᵶᵷᵕ */
    public final C4413 mo4955(InterfaceC3042 interfaceC3042) {
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        linkedHashMap.put("work_spec_id", new C0697(1, 1, "work_spec_id", "TEXT", null, true));
        linkedHashMap.put("prerequisite_id", new C0697(2, 1, "prerequisite_id", "TEXT", null, true));
        LinkedHashSet linkedHashSet = new LinkedHashSet();
        linkedHashSet.add(new C0822("WorkSpec", "CASCADE", "CASCADE", Collections.singletonList("work_spec_id"), Collections.singletonList("id")));
        linkedHashSet.add(new C0822("WorkSpec", "CASCADE", "CASCADE", Collections.singletonList("prerequisite_id"), Collections.singletonList("id")));
        LinkedHashSet linkedHashSet2 = new LinkedHashSet();
        linkedHashSet2.add(new C0667("index_Dependency_work_spec_id", false, Collections.singletonList("work_spec_id"), Collections.singletonList("ASC")));
        linkedHashSet2.add(new C0667("index_Dependency_prerequisite_id", false, Collections.singletonList("prerequisite_id"), Collections.singletonList("ASC")));
        C5459 c5459 = new C5459("Dependency", linkedHashMap, linkedHashSet, linkedHashSet2);
        C5459 c54592 = ᵸᵡˋʧ.ˑᵱ(interfaceC3042, "Dependency");
        if (!c5459.equals(c54592)) {
            return new C4413("Dependency(androidx.work.impl.model.Dependency).\n Expected:\n" + c5459 + "\n Found:\n" + c54592, false);
        }
        LinkedHashMap linkedHashMap2 = new LinkedHashMap();
        linkedHashMap2.put("id", new C0697(1, 1, "id", "TEXT", null, true));
        linkedHashMap2.put("state", new C0697(0, 1, "state", "INTEGER", null, true));
        linkedHashMap2.put("worker_class_name", new C0697(0, 1, "worker_class_name", "TEXT", null, true));
        linkedHashMap2.put("input_merger_class_name", new C0697(0, 1, "input_merger_class_name", "TEXT", null, true));
        linkedHashMap2.put("input", new C0697(0, 1, "input", "BLOB", null, true));
        linkedHashMap2.put("output", new C0697(0, 1, "output", "BLOB", null, true));
        linkedHashMap2.put("initial_delay", new C0697(0, 1, "initial_delay", "INTEGER", null, true));
        linkedHashMap2.put("interval_duration", new C0697(0, 1, "interval_duration", "INTEGER", null, true));
        linkedHashMap2.put("flex_duration", new C0697(0, 1, "flex_duration", "INTEGER", null, true));
        linkedHashMap2.put("run_attempt_count", new C0697(0, 1, "run_attempt_count", "INTEGER", null, true));
        linkedHashMap2.put("backoff_policy", new C0697(0, 1, "backoff_policy", "INTEGER", null, true));
        linkedHashMap2.put("backoff_delay_duration", new C0697(0, 1, "backoff_delay_duration", "INTEGER", null, true));
        linkedHashMap2.put("last_enqueue_time", new C0697(0, 1, "last_enqueue_time", "INTEGER", "-1", true));
        linkedHashMap2.put("minimum_retention_duration", new C0697(0, 1, "minimum_retention_duration", "INTEGER", null, true));
        linkedHashMap2.put("schedule_requested_at", new C0697(0, 1, "schedule_requested_at", "INTEGER", null, true));
        linkedHashMap2.put("run_in_foreground", new C0697(0, 1, "run_in_foreground", "INTEGER", null, true));
        linkedHashMap2.put("out_of_quota_policy", new C0697(0, 1, "out_of_quota_policy", "INTEGER", null, true));
        linkedHashMap2.put("period_count", new C0697(0, 1, "period_count", "INTEGER", "0", true));
        linkedHashMap2.put("generation", new C0697(0, 1, "generation", "INTEGER", "0", true));
        linkedHashMap2.put("next_schedule_time_override", new C0697(0, 1, "next_schedule_time_override", "INTEGER", "9223372036854775807", true));
        linkedHashMap2.put("next_schedule_time_override_generation", new C0697(0, 1, "next_schedule_time_override_generation", "INTEGER", "0", true));
        linkedHashMap2.put("stop_reason", new C0697(0, 1, "stop_reason", "INTEGER", "-256", true));
        linkedHashMap2.put("trace_tag", new C0697(0, 1, "trace_tag", "TEXT", null, false));
        linkedHashMap2.put("backoff_on_system_interruptions", new C0697(0, 1, "backoff_on_system_interruptions", "INTEGER", null, false));
        linkedHashMap2.put("required_network_type", new C0697(0, 1, "required_network_type", "INTEGER", null, true));
        linkedHashMap2.put("required_network_request", new C0697(0, 1, "required_network_request", "BLOB", "x''", true));
        linkedHashMap2.put("requires_charging", new C0697(0, 1, "requires_charging", "INTEGER", null, true));
        linkedHashMap2.put("requires_device_idle", new C0697(0, 1, "requires_device_idle", "INTEGER", null, true));
        linkedHashMap2.put("requires_battery_not_low", new C0697(0, 1, "requires_battery_not_low", "INTEGER", null, true));
        linkedHashMap2.put("requires_storage_not_low", new C0697(0, 1, "requires_storage_not_low", "INTEGER", null, true));
        linkedHashMap2.put("trigger_content_update_delay", new C0697(0, 1, "trigger_content_update_delay", "INTEGER", null, true));
        linkedHashMap2.put("trigger_max_content_delay", new C0697(0, 1, "trigger_max_content_delay", "INTEGER", null, true));
        linkedHashMap2.put("content_uri_triggers", new C0697(0, 1, "content_uri_triggers", "BLOB", null, true));
        LinkedHashSet linkedHashSet3 = new LinkedHashSet();
        LinkedHashSet linkedHashSet4 = new LinkedHashSet();
        linkedHashSet4.add(new C0667("index_WorkSpec_schedule_requested_at", false, Collections.singletonList("schedule_requested_at"), Collections.singletonList("ASC")));
        linkedHashSet4.add(new C0667("index_WorkSpec_last_enqueue_time", false, Collections.singletonList("last_enqueue_time"), Collections.singletonList("ASC")));
        C5459 c54593 = new C5459("WorkSpec", linkedHashMap2, linkedHashSet3, linkedHashSet4);
        C5459 c54594 = ᵸᵡˋʧ.ˑᵱ(interfaceC3042, "WorkSpec");
        if (!c54593.equals(c54594)) {
            return new C4413("WorkSpec(androidx.work.impl.model.WorkSpec).\n Expected:\n" + c54593 + "\n Found:\n" + c54594, false);
        }
        LinkedHashMap linkedHashMap3 = new LinkedHashMap();
        linkedHashMap3.put("tag", new C0697(1, 1, "tag", "TEXT", null, true));
        linkedHashMap3.put("work_spec_id", new C0697(2, 1, "work_spec_id", "TEXT", null, true));
        LinkedHashSet linkedHashSet5 = new LinkedHashSet();
        linkedHashSet5.add(new C0822("WorkSpec", "CASCADE", "CASCADE", Collections.singletonList("work_spec_id"), Collections.singletonList("id")));
        LinkedHashSet linkedHashSet6 = new LinkedHashSet();
        linkedHashSet6.add(new C0667("index_WorkTag_work_spec_id", false, Collections.singletonList("work_spec_id"), Collections.singletonList("ASC")));
        C5459 c54595 = new C5459("WorkTag", linkedHashMap3, linkedHashSet5, linkedHashSet6);
        C5459 c54596 = ᵸᵡˋʧ.ˑᵱ(interfaceC3042, "WorkTag");
        if (!c54595.equals(c54596)) {
            return new C4413("WorkTag(androidx.work.impl.model.WorkTag).\n Expected:\n" + c54595 + "\n Found:\n" + c54596, false);
        }
        LinkedHashMap linkedHashMap4 = new LinkedHashMap();
        linkedHashMap4.put("work_spec_id", new C0697(1, 1, "work_spec_id", "TEXT", null, true));
        linkedHashMap4.put("generation", new C0697(2, 1, "generation", "INTEGER", "0", true));
        linkedHashMap4.put("system_id", new C0697(0, 1, "system_id", "INTEGER", null, true));
        LinkedHashSet linkedHashSet7 = new LinkedHashSet();
        linkedHashSet7.add(new C0822("WorkSpec", "CASCADE", "CASCADE", Collections.singletonList("work_spec_id"), Collections.singletonList("id")));
        C5459 c54597 = new C5459("SystemIdInfo", linkedHashMap4, linkedHashSet7, new LinkedHashSet());
        C5459 c54598 = ᵸᵡˋʧ.ˑᵱ(interfaceC3042, "SystemIdInfo");
        if (!c54597.equals(c54598)) {
            return new C4413("SystemIdInfo(androidx.work.impl.model.SystemIdInfo).\n Expected:\n" + c54597 + "\n Found:\n" + c54598, false);
        }
        LinkedHashMap linkedHashMap5 = new LinkedHashMap();
        linkedHashMap5.put("name", new C0697(1, 1, "name", "TEXT", null, true));
        linkedHashMap5.put("work_spec_id", new C0697(2, 1, "work_spec_id", "TEXT", null, true));
        LinkedHashSet linkedHashSet8 = new LinkedHashSet();
        linkedHashSet8.add(new C0822("WorkSpec", "CASCADE", "CASCADE", Collections.singletonList("work_spec_id"), Collections.singletonList("id")));
        LinkedHashSet linkedHashSet9 = new LinkedHashSet();
        linkedHashSet9.add(new C0667("index_WorkName_work_spec_id", false, Collections.singletonList("work_spec_id"), Collections.singletonList("ASC")));
        C5459 c54599 = new C5459("WorkName", linkedHashMap5, linkedHashSet8, linkedHashSet9);
        C5459 c545910 = ᵸᵡˋʧ.ˑᵱ(interfaceC3042, "WorkName");
        if (!c54599.equals(c545910)) {
            return new C4413("WorkName(androidx.work.impl.model.WorkName).\n Expected:\n" + c54599 + "\n Found:\n" + c545910, false);
        }
        LinkedHashMap linkedHashMap6 = new LinkedHashMap();
        linkedHashMap6.put("work_spec_id", new C0697(1, 1, "work_spec_id", "TEXT", null, true));
        linkedHashMap6.put("progress", new C0697(0, 1, "progress", "BLOB", null, true));
        LinkedHashSet linkedHashSet10 = new LinkedHashSet();
        linkedHashSet10.add(new C0822("WorkSpec", "CASCADE", "CASCADE", Collections.singletonList("work_spec_id"), Collections.singletonList("id")));
        C5459 c545911 = new C5459("WorkProgress", linkedHashMap6, linkedHashSet10, new LinkedHashSet());
        C5459 c545912 = ᵸᵡˋʧ.ˑᵱ(interfaceC3042, "WorkProgress");
        if (!c545911.equals(c545912)) {
            return new C4413("WorkProgress(androidx.work.impl.model.WorkProgress).\n Expected:\n" + c545911 + "\n Found:\n" + c545912, false);
        }
        LinkedHashMap linkedHashMap7 = new LinkedHashMap();
        linkedHashMap7.put("key", new C0697(1, 1, "key", "TEXT", null, true));
        linkedHashMap7.put("long_value", new C0697(0, 1, "long_value", "INTEGER", null, false));
        C5459 c545913 = new C5459("Preference", linkedHashMap7, new LinkedHashSet(), new LinkedHashSet());
        C5459 c545914 = ᵸᵡˋʧ.ˑᵱ(interfaceC3042, "Preference");
        if (c545913.equals(c545914)) {
            return new C4413(null, true);
        }
        return new C4413("Preference(androidx.work.impl.model.Preference).\n Expected:\n" + c545913 + "\n Found:\n" + c545914, false);
    }
}
