package com.tencent.mm.az;

import android.util.SparseArray;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.messenger.foundation.a.a.g;
import com.tencent.mm.plugin.messenger.foundation.a.a.j.b;
import java.util.ArrayList;
import java.util.LinkedList;

public final class a implements g {
    SparseArray<LinkedList<com.tencent.mm.plugin.messenger.foundation.a.a.g.a>> fLo = new SparseArray();

    public a() {
        AppMethodBeat.i(984);
        AppMethodBeat.o(984);
    }

    public final void a(b bVar) {
        AppMethodBeat.i(985);
        if (com.tencent.mm.kernel.g.RO().eJo == null || com.tencent.mm.kernel.g.RO().eJo.ftA == null) {
            AppMethodBeat.o(985);
            return;
        }
        ArrayList arrayList = new ArrayList(1);
        arrayList.add(bVar);
        b bVar2 = new b(arrayList);
        com.tencent.mm.kernel.g.RQ();
        bVar2.a(com.tencent.mm.kernel.g.RO().eJo.ftA, new 1(this, bVar));
        AppMethodBeat.o(985);
    }

    public final void a(int i, com.tencent.mm.plugin.messenger.foundation.a.a.g.a aVar) {
        AppMethodBeat.i(986);
        if (this.fLo.indexOfKey(i) < 0) {
            this.fLo.put(i, new LinkedList());
        }
        ((LinkedList) this.fLo.get(i)).add(aVar);
        AppMethodBeat.o(986);
    }

    public final void b(int i, com.tencent.mm.plugin.messenger.foundation.a.a.g.a aVar) {
        AppMethodBeat.i(987);
        if (this.fLo.indexOfKey(i) >= 0) {
            ((LinkedList) this.fLo.get(i)).remove(aVar);
        }
        AppMethodBeat.o(987);
    }
}
