package com.tencent.mm.plugin.backup.d;

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.backup.b.f;
import com.tencent.mm.plugin.backup.c.b;
import com.tencent.mm.plugin.backup.c.b$3;
import com.tencent.mm.plugin.backup.c.b.4;
import com.tencent.mm.plugin.backup.h.d;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.al;
import com.tencent.mm.sdk.platformtools.bo;
import java.util.Iterator;
import java.util.LinkedList;

public class a$2 implements Runnable {
    final /* synthetic */ a jta;

    public a$2(a aVar) {
        this.jta = aVar;
    }

    public final void run() {
        AppMethodBeat.i(17222);
        ab.i("MicroMsg.BackupMoveChooseServer", "start calculateChooseConvSize");
        this.jta.jsS = new b();
        b bVar = this.jta.jsS;
        LinkedList aSW = this.jta.aSW();
        a aVar = this.jta;
        long j = b.aSZ().aSu().jrc;
        long anU = bo.anU();
        String str = (String) d.aUr().aUs().Ry().get(2, null);
        int i = 0;
        Iterator it = aSW.iterator();
        while (it.hasNext()) {
            f.b bVar2 = (f.b) it.next();
            if (bVar2.jri < 0) {
                if (bVar.a(bVar2, str, j)) {
                    break;
                }
                i++;
                if (!(bVar.jrv || aVar == null)) {
                    al.d(new b$3(bVar, aVar, aSW, bVar2.aSE(), i));
                }
            } else {
                i++;
            }
        }
        ab.i("MicroMsg.BackupCalculator", "calculChooseConvSize all, userSize:%d", new Object[]{Integer.valueOf(aSW.size())});
        if (!(bVar.jrv || aVar == null)) {
            al.d(new 4(bVar, aVar, aSW));
        }
        ab.d("MicroMsg.BackupCalculator", "calculChooseConvSize loading time[%d]", new Object[]{Long.valueOf(bo.gb(anU))});
        AppMethodBeat.o(17222);
    }
}
