package com.tencent.mm.plugin.appbrand.game.b;

import android.database.Cursor;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.fts.a.a.g;
import com.tencent.mm.plugin.fts.a.a.h;
import com.tencent.mm.plugin.fts.a.a.i;
import com.tencent.mm.plugin.fts.a.a.j;
import com.tencent.mm.plugin.fts.a.a.m;
import com.tencent.mm.plugin.fts.a.c;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;

class b$c extends h {
    final /* synthetic */ b hqZ;

    b$c(b bVar, i iVar) {
        this.hqZ = bVar;
        super(iVar);
    }

    public final String getName() {
        return "SearchMiniGameTask";
    }

    public final int getId() {
        return 30;
    }

    public final void a(j jVar) {
        AppMethodBeat.i(130070);
        jVar.mDz = g.aO(this.mEl.query, true);
        jVar.mEy = new ArrayList();
        HashSet hashSet = new HashSet();
        Cursor a = this.hqZ.hqX.a(jVar.mDz, c.mCh, this.mEl.mEs, true, true);
        while (a.moveToNext()) {
            try {
                m mVar = new m();
                mVar.k(a);
                if (!(hashSet.contains(Long.valueOf(mVar.mEB)) || this.mEl.mEu.contains(mVar.mDx))) {
                    mVar.bAo();
                    jVar.mEy.add(mVar);
                    hashSet.add(Long.valueOf(mVar.mEB));
                }
            } catch (Throwable th) {
                if (a != null) {
                    a.close();
                }
                AppMethodBeat.o(130070);
            }
        }
        if (a != null) {
            a.close();
        }
        if (Thread.interrupted()) {
            InterruptedException interruptedException = new InterruptedException();
            AppMethodBeat.o(130070);
            throw interruptedException;
        }
        if (this.mEl.mEv != null) {
            Collections.sort(jVar.mEy, this.mEl.mEv);
        }
        AppMethodBeat.o(130070);
    }
}
