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

import android.content.ComponentName;
import android.content.ServiceConnection;
import android.os.IBinder;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.cdndownloader.a.a.a;
import com.tencent.mm.plugin.cdndownloader.ipc.CDNTaskInfo;
import com.tencent.mm.sdk.platformtools.ab;

class a$2 implements ServiceConnection {
    final /* synthetic */ a ktp;

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

    public final void onServiceConnected(ComponentName componentName, IBinder iBinder) {
        AppMethodBeat.i(892);
        ab.i("MicroMsg.CDNDownloadClient", "onServiceConnected");
        a.a(this.ktp, a.s(iBinder));
        a.f(this.ktp);
        a.g(this.ktp);
        try {
            synchronized (a.alU()) {
                a.alU().notifyAll();
            }
            AppMethodBeat.o(892);
        } catch (Exception e) {
            AppMethodBeat.o(892);
        } catch (Throwable th) {
            while (true) {
                AppMethodBeat.o(892);
            }
        }
    }

    public final void onServiceDisconnected(ComponentName componentName) {
        AppMethodBeat.i(893);
        ab.i("MicroMsg.CDNDownloadClient", "onServiceDisconnected");
        if (a.c(this.ktp).size() != 0) {
            for (CDNTaskInfo cDNTaskInfo : a.c(this.ktp)) {
                cDNTaskInfo.ktw = true;
            }
        }
        AppMethodBeat.o(893);
    }
}
