package defpackage;

import android.database.Cursor;
import androidx.work.d;
import androidx.work.impl.WorkDatabase_Impl;
import defpackage.hsa;
import defpackage.lta;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.Callable;

/* JADX INFO: loaded from: classes.dex */
class iua implements Callable<List<lta.c>> {
    public final /* synthetic */ p58 a;
    public final /* synthetic */ tua b;

    public iua(tua tuaVar, p58 p58Var) {
        this.b = tuaVar;
        this.a = p58Var;
    }

    @Override // java.util.concurrent.Callable
    public final List<lta.c> call() {
        tua tuaVar = this.b;
        WorkDatabase_Impl workDatabase_Impl = tuaVar.a;
        workDatabase_Impl.beginTransaction();
        try {
            Cursor cursorB = sp1.b(workDatabase_Impl, this.a, true);
            try {
                HashMap map = new HashMap();
                HashMap map2 = new HashMap();
                while (cursorB.moveToNext()) {
                    String string = cursorB.getString(0);
                    if (((ArrayList) map.get(string)) == null) {
                        map.put(string, new ArrayList());
                    }
                    String string2 = cursorB.getString(0);
                    if (((ArrayList) map2.get(string2)) == null) {
                        map2.put(string2, new ArrayList());
                    }
                }
                cursorB.moveToPosition(-1);
                tuaVar.ac(map);
                tuaVar.ab(map2);
                ArrayList arrayList = new ArrayList(cursorB.getCount());
                while (cursorB.moveToNext()) {
                    byte[] blob = null;
                    String string3 = cursorB.isNull(0) ? null : cursorB.getString(0);
                    hsa.c cVarE = bva.e(cursorB.getInt(1));
                    d dVarA = d.a(cursorB.isNull(2) ? null : cursorB.getBlob(2));
                    int i = cursorB.getInt(3);
                    int i2 = cursorB.getInt(4);
                    long j = cursorB.getLong(13);
                    long j2 = cursorB.getLong(14);
                    long j3 = cursorB.getLong(15);
                    f60 f60VarB = bva.b(cursorB.getInt(16));
                    long j4 = cursorB.getLong(17);
                    long j5 = cursorB.getLong(18);
                    int i3 = cursorB.getInt(19);
                    long j6 = cursorB.getLong(20);
                    int i4 = cursorB.getInt(21);
                    fn6 fn6VarC = bva.c(cursorB.getInt(5));
                    boolean z = cursorB.getInt(6) != 0;
                    boolean z2 = cursorB.getInt(7) != 0;
                    boolean z3 = cursorB.getInt(8) != 0;
                    boolean z4 = cursorB.getInt(9) != 0;
                    long j7 = cursorB.getLong(10);
                    long j8 = cursorB.getLong(11);
                    if (!cursorB.isNull(12)) {
                        blob = cursorB.getBlob(12);
                    }
                    ed1 ed1Var = new ed1(fn6VarC, z, z2, z3, z4, j7, j8, bva.a(blob));
                    ArrayList arrayList2 = (ArrayList) map.get(cursorB.getString(0));
                    if (arrayList2 == null) {
                        arrayList2 = new ArrayList();
                    }
                    ArrayList arrayList3 = (ArrayList) map2.get(cursorB.getString(0));
                    if (arrayList3 == null) {
                        arrayList3 = new ArrayList();
                    }
                    arrayList.add(new lta.c(string3, cVarE, dVarA, j, j2, j3, ed1Var, i, f60VarB, j4, j5, i3, i2, j6, i4, arrayList2, arrayList3));
                }
                workDatabase_Impl.setTransactionSuccessful();
                cursorB.close();
                return arrayList;
            } catch (Throwable th) {
                cursorB.close();
                throw th;
            }
        } finally {
            workDatabase_Impl.endTransaction();
        }
    }

    public final void finalize() {
        this.a.release();
    }
}
