package com.tencent.mm.plugin.qqmail.b;

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.kernel.g;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.bo;
import java.util.ArrayList;

public final class z {
    ArrayList<aa> puX = new ArrayList();
    ab puY = ac.ccD();
    y puZ = null;
    boolean pva = false;
    ab$f pvb = new 1(this);
    ab$e pvc = new 2(this);

    public z() {
        AppMethodBeat.i(68033);
        AppMethodBeat.o(68033);
    }

    public final void a(aa aaVar) {
        AppMethodBeat.i(68034);
        if (g.RN().QY()) {
            if (this.puZ == null) {
                this.puZ = new y();
            }
            y yVar = this.puZ;
            String str = aaVar.ptN;
            if (bo.isNullOrNil(str)) {
                ab.w("MicroMsg.ShareMailInfoMgr", "add info fail, info is null");
            } else {
                w wVar = new w();
                wVar.ptN = str;
                yVar.puW.oof.add(wVar);
                yVar.save();
            }
            this.puX.add(aaVar);
            ab.d("MicroMsg.ShareMailQueue", "add a new job, queue.size: %d", new Object[]{Integer.valueOf(this.puX.size())});
            if (!this.pva) {
                ab.d("MicroMsg.ShareMailQueue", "start execute");
                if (this.puX.size() > 0) {
                    this.pva = true;
                    b((aa) this.puX.remove(0));
                    this.puY.a(this.pvb, this.pvc);
                }
            }
            AppMethodBeat.o(68034);
            return;
        }
        AppMethodBeat.o(68034);
    }

    /* Access modifiers changed, original: final */
    public final void b(aa aaVar) {
        AppMethodBeat.i(68035);
        this.puY.clearData();
        this.puY.cEV = aaVar.cEV;
        this.puY.ptN = aaVar.ptN;
        this.puY.pur = aaVar.pur;
        this.puY.pus = aaVar.pus;
        this.puY.pve = aaVar.pve;
        this.puY.X(aaVar.pvf);
        this.puY.Y(aaVar.pvg);
        this.puY.Z(aaVar.pvh);
        AppMethodBeat.o(68035);
    }
}
