模拟器游戏下载记录使用本地数据库保存
This commit is contained in:
@ -576,10 +576,16 @@ public class DownloadItemUtils {
|
||||
});
|
||||
}
|
||||
} else if (str.equals(context.getString(R.string.install))) {
|
||||
EmulatorGameEntity emulatorGameEntity = EmulatorGameManager.findGameByName(gameEntity.getName());
|
||||
boolean isInstalled = PackageUtils.isInstalled(context, apk.getPackageName());
|
||||
if (emulatorGameEntity != null && EmulatorGameManager.isEmulatorGame(apk.getFormat()) && !isInstalled) {
|
||||
EmulatorDownloadManager.getInstance().showDownloadDialog(context, gameEntity);
|
||||
return;
|
||||
}
|
||||
install(context, gameEntity, position, adapter);
|
||||
} else if (str.equals(context.getString(R.string.launch))) {
|
||||
//启动模拟器游戏
|
||||
if (EmulatorGameManager.formats.contains(gameEntity.getApk().get(0).getFormat())) {
|
||||
if (EmulatorGameManager.isEmulatorGame(gameEntity.getApk().get(0).getFormat())) {
|
||||
EmulatorGameEntity emulatorGameEntity = EmulatorGameManager.findGameByName(gameEntity.getName());
|
||||
if (emulatorGameEntity != null) {
|
||||
File file = new File(emulatorGameEntity.getFilePath());
|
||||
@ -587,9 +593,7 @@ public class DownloadItemUtils {
|
||||
download(context, gameEntity, downloadBtn, entrance, location, false, traceEvent);
|
||||
return;
|
||||
}
|
||||
EmulatorDownloadManager.getInstance().showDownloadDialog(context, gameEntity, () -> {
|
||||
ToastUtils.INSTANCE.showToast("启动模拟器游戏-" + emulatorGameEntity.getGameName());
|
||||
});
|
||||
ToastUtils.INSTANCE.showToast("启动模拟器游戏-" + emulatorGameEntity.getGameName());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user