fix:修复一体化,畅玩游戏启动判断
This commit is contained in:
@ -220,7 +220,7 @@ class DefaultJsApi(
|
||||
runOnUiThread {
|
||||
// 若畅玩列表中安装了,优先启动畅玩游戏
|
||||
if (VHelper.isInstalled(packageName)) {
|
||||
if (!VHelper.showDialogIfVSpaceIsNeeded(context, "", "", "", "")) {
|
||||
VHelper.validateVSpaceBeforeAction(context, packageName, null) {
|
||||
VHelper.launch(context, packageName)
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -16,7 +16,7 @@ class ValidateVSpaceHandler : DownloadChainHandler() {
|
||||
}
|
||||
|
||||
if (asVGame) {
|
||||
VHelper.validateVSpaceBeforeAction(context, gameEntity) {
|
||||
VHelper.validateVSpaceBeforeAction(context,gameEntity.getUniquePackageName(), gameEntity) {
|
||||
closure.invoke()
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -282,7 +282,7 @@ object GameActivityDownloadHelper {
|
||||
location: String,
|
||||
traceEvent: ExposureEvent
|
||||
) {
|
||||
VHelper.validateVSpaceBeforeAction(context, gameEntity) {
|
||||
VHelper.validateVSpaceBeforeAction(context,gameEntity.getUniquePackageName(), gameEntity) {
|
||||
GamePermissionDialogFragment.show((context as AppCompatActivity), gameEntity, gameEntity.info) {
|
||||
CertificationDialog.showCertificationDialog(context, gameEntity) {
|
||||
DialogUtils.checkDownload(
|
||||
|
||||
@ -559,8 +559,8 @@ object VHelper {
|
||||
/**
|
||||
* 在执行 callback 前先检查组件是否已安装,是否可下载
|
||||
*/
|
||||
fun validateVSpaceBeforeAction(context: Context, gameEntity: GameEntity?, callback: () -> Unit) {
|
||||
if (isLegacyInstalled(gameEntity?.getUniquePackageName())) {
|
||||
fun validateVSpaceBeforeAction(context: Context, packageName: String?, gameEntity: GameEntity?, callback: () -> Unit) {
|
||||
if (isLegacyInstalled(packageName)) {
|
||||
oldCwValidateVSpaceBeforeAction(context, gameEntity, callback)
|
||||
} else {
|
||||
newCwValidateVspaceBeforeAction(context, gameEntity, callback)
|
||||
@ -680,6 +680,9 @@ object VHelper {
|
||||
callback.invoke()
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否需要安装32位组件,64位直接callback
|
||||
*/
|
||||
private fun newCwValidateVspaceBeforeAction(context: Context, gameEntity: GameEntity?, callback: () -> Unit) {
|
||||
val bit = gameEntity?.gameBit ?: ""
|
||||
if (bit == "32") {
|
||||
@ -1191,7 +1194,7 @@ object VHelper {
|
||||
logLaunchButtonClicked(packageName, gameId, gameName, gameType, location)
|
||||
}
|
||||
|
||||
validateVSpaceBeforeAction(context, GameEntity().apply {
|
||||
validateVSpaceBeforeAction(context,packageName, GameEntity().apply {
|
||||
id = gameId
|
||||
name = gameName
|
||||
downloadStatus = Constants.V_GAME
|
||||
|
||||
Reference in New Issue
Block a user