完善安装引导显示逻辑

This commit is contained in:
leafwai
2021-08-31 17:11:13 +08:00
parent c196d5cdf5
commit d574b09dfa
2 changed files with 27 additions and 7 deletions

View File

@ -19,6 +19,7 @@ import com.gh.gamecenter.entity.SettingsEntity;
import com.gh.gamecenter.manager.PackagesManager;
import com.lightgame.download.DownloadEntity;
import com.lightgame.download.DownloadStatus;
import com.lightgame.utils.Utils;
import java.util.ArrayList;
import java.util.List;
@ -272,4 +273,18 @@ public class GameUtils {
return null;
}
public static boolean checkDownloadStatus(Context context, GameEntity gameEntity, DownloadStatus downloadStatus){
DownloadEntity downloadEntity;
for (ApkEntity apkEntity : gameEntity.getApk()) {
// filter by packageName
downloadEntity = DownloadManager.getInstance(context).getDownloadEntityByUrl(apkEntity.getUrl());
if (downloadEntity != null) {
if (downloadEntity.getStatus().equals(downloadStatus)){
return true;
}
}
}
return false;
}
}