下载事件统计,添加该游戏已安装数
This commit is contained in:
@ -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("插件化")) {
|
||||
|
||||
Reference in New Issue
Block a user