下载事件统计,添加该游戏已安装数

This commit is contained in:
huangzhuanghua
2016-10-28 11:23:42 +08:00
parent 54df9912eb
commit 11abd6d60f
4 changed files with 32 additions and 10 deletions

View File

@ -10,9 +10,11 @@ import android.widget.Toast;
import com.gh.common.constant.Constants;
import com.gh.common.util.FileUtils;
import com.gh.common.util.MD5Utils;
import com.gh.common.util.PackageUtils;
import com.gh.common.util.Utils;
import com.gh.gamecenter.entity.ApkEntity;
import com.gh.gamecenter.entity.GameEntity;
import com.gh.gamecenter.manager.PackageManager;
import java.io.File;
import java.util.ArrayList;
@ -226,6 +228,13 @@ public class DownloadManager {
downloadEntity.setGameId(gameEntity.getId());
downloadEntity.setEntrance(entrance);
downloadEntity.setLocation(location);
int installed = 0;
for (ApkEntity apk : gameEntity.getApk()) {
if (PackageManager.isInstalled(apk.getPackageName())) {
installed++;
}
}
downloadEntity.setInstalled(installed);
if (method.equals("更新")) {
downloadEntity.setUpdate(true);
} else if (method.equals("插件化")) {