package com.gh.common.provider

import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.download.DownloadManager
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IDownloadManagerProvider
import com.lightgame.download.DownloadEntity

@Route(path = RouteConsts.provider.downloadManager, name = "DownloadManager暴露服务")
class DownloadManagerProviderImpl : IDownloadManagerProvider {

    override fun getDownloadEntityByUrl(url: String): DownloadEntity? {
        return DownloadManager.getInstance().getDownloadEntityByUrl(url)
    }

    override fun resumeAllInvisiblePendingTask() {
        DownloadManager.getInstance().resumeAllInvisiblePendingTask()
    }

    override fun init(context: Context?) {
        // Do nothing
    }

}