package com.ss.android.ugc.aweme.watch.history.database;

import X.0BT;
import X.0BV;
import X.0BW;
import X.0BY;
import X.0Fe;
import X.0Fh;
import X.0Fk;
import X.0Fn;
import X.0Fo;
import X.0Fw;
import X.0G9;
import X.0GA;
import X.1DC;
import X.C1473Rif;
import X.C1499Rj5;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;

public final class WatchHistoryDatabase_Impl extends WatchHistoryDatabase {
    public volatile C1499Rj5 LJIILIIL;

    static {
        Covode.recordClassIndex(124088);
    }

    public final 0Fw LIZ() {
        return new 0Fw(this, new HashMap(0), new HashMap(0), new String[]{"Watch_History"});
    }

    public final C1499Rj5 LJIIIIZZ() {
        C1499Rj5 rj5;
        MethodCollector.i(1063);
        if (this.LJIILIIL != null) {
            C1499Rj5 rj52 = this.LJIILIIL;
            MethodCollector.o(1063);
            return rj52;
        }
        synchronized (this) {
            try {
                if (this.LJIILIIL == null) {
                    this.LJIILIIL = new C1473Rif(this);
                }
                rj5 = this.LJIILIIL;
            } finally {
                MethodCollector.o(1063);
            }
        }
        return rj5;
    }

    public final 0BY LIZIZ(0Fe r5) {
        1DC r3 = new 1DC(r5, new 0G9() {
            static {
                Covode.recordClassIndex(124089);
            }

            public final void LIZ() {
                if (WatchHistoryDatabase_Impl.this.LJI != null) {
                    int size = WatchHistoryDatabase_Impl.this.LJI.size();
                    for (int i = 0; i < size; i++) {
                        WatchHistoryDatabase_Impl.this.LJI.get(i);
                    }
                }
            }

            public final void LJFF(0BT r1) {
                0Fh.LIZ(r1);
            }

            public final void LIZIZ(0BT r2) {
                r2.LIZJ("CREATE TABLE IF NOT EXISTS `Watch_History` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `sec_uid` TEXT NOT NULL, `aid` TEXT NOT NULL, `timestamp` INTEGER NOT NULL)");
                r2.LIZJ("CREATE UNIQUE INDEX IF NOT EXISTS `index_Watch_History_sec_uid_aid` ON `Watch_History` (`sec_uid`, `aid`)");
                r2.LIZJ("CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)");
                r2.LIZJ("INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '68bf0d5b0daaf2ef794d56e8f8ed1d86')");
            }

            public final void LIZ(0BT r4) {
                r4.LIZJ("DROP TABLE IF EXISTS `Watch_History`");
                if (WatchHistoryDatabase_Impl.this.LJI != null) {
                    int size = WatchHistoryDatabase_Impl.this.LJI.size();
                    for (int i = 0; i < size; i++) {
                        WatchHistoryDatabase_Impl.this.LJI.get(i);
                    }
                }
            }

            public final void LIZJ(0BT r4) {
                WatchHistoryDatabase_Impl.this.LIZ = r4;
                WatchHistoryDatabase_Impl.this.LIZ(r4);
                if (WatchHistoryDatabase_Impl.this.LJI != null) {
                    int size = WatchHistoryDatabase_Impl.this.LJI.size();
                    for (int i = 0; i < size; i++) {
                        WatchHistoryDatabase_Impl.this.LJI.get(i);
                    }
                }
            }

            public final 0GA LJ(0BT r12) {
                HashMap hashMap = new HashMap(4);
                hashMap.put("id", new 0Fk("id", "INTEGER", true, 1, (String) null, 1));
                hashMap.put("sec_uid", new 0Fk("sec_uid", "TEXT", true, 0, (String) null, 1));
                hashMap.put("aid", new 0Fk("aid", "TEXT", true, 0, (String) null, 1));
                hashMap.put("timestamp", new 0Fk("timestamp", "INTEGER", true, 0, (String) null, 1));
                HashSet hashSet = new HashSet(0);
                HashSet hashSet2 = new HashSet(1);
                hashSet2.add(new 0Fn("index_Watch_History_sec_uid_aid", true, Arrays.asList(new String[]{"sec_uid", "aid"})));
                0Fo r4 = new 0Fo("Watch_History", hashMap, hashSet, hashSet2);
                0Fo LIZ = 0Fo.LIZ(r12, "Watch_History");
                if (r4.equals(LIZ)) {
                    return new 0GA(true, (String) null);
                }
                return new 0GA(false, "Watch_History(com.ss.android.ugc.aweme.watch.history.database.WatchRecord).\n Expected:\n" + r4 + "\n Found:\n" + LIZ);
            }
        }, "68bf0d5b0daaf2ef794d56e8f8ed1d86", "164f549d9a64ec20fd8ba4faefcbe0c6");
        0BV LIZ = 0BW.LIZ(r5.LIZIZ);
        LIZ.LIZIZ = r5.LIZJ;
        LIZ.LIZJ = r3;
        return r5.LIZ.LIZ(LIZ.LIZ());
    }
}
