fix: 广告系统-新增广告游戏的过滤条件 https://jira.shanqu.cc/browse/GHZSCY-8006
This commit is contained in:
@ -9,15 +9,17 @@ import com.gh.common.filter.RegionSettingHelper
|
||||
import com.gh.common.util.GameUtils
|
||||
import com.gh.common.util.PackageHelper
|
||||
import com.gh.common.util.PackageUtils
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.entity.InstalledPackagesAction
|
||||
import com.gh.gamecenter.common.exposure.meta.MetaUtil
|
||||
import com.gh.gamecenter.common.loghub.LoghubUtils
|
||||
import com.gh.gamecenter.common.retrofit.BiResponse
|
||||
import com.gh.gamecenter.common.retrofit.EmptyResponse
|
||||
import com.gh.gamecenter.common.retrofit.ObservableUtil
|
||||
import com.gh.gamecenter.common.retrofit.Response
|
||||
import com.gh.gamecenter.common.utils.secondOrNull
|
||||
import com.gh.gamecenter.common.utils.toArrayList
|
||||
import com.gh.gamecenter.common.utils.toRequestBody
|
||||
import com.gh.gamecenter.common.utils.tryCatchInRelease
|
||||
import com.gh.gamecenter.core.runOnIoThread
|
||||
import com.gh.gamecenter.core.utils.SPUtils
|
||||
@ -41,10 +43,12 @@ import io.reactivex.SingleObserver
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import okhttp3.ResponseBody
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.json.JSONException
|
||||
import org.json.JSONObject
|
||||
import java.util.*
|
||||
import kotlin.collections.HashSet
|
||||
|
||||
/**
|
||||
* 该类存储的是已安装的所有游戏(助手后台已收录的)和所有更新(包括插件化)数据
|
||||
@ -624,7 +628,20 @@ object PackageRepository {
|
||||
pkgSet.add(iterator.next())
|
||||
}
|
||||
|
||||
postInstalledPackageList(pkgSet)
|
||||
|
||||
PackagesManager.initInstallPkgSet(pkgSet)
|
||||
}
|
||||
|
||||
private fun postInstalledPackageList(pkgSet: HashSet<String>) {
|
||||
val requestBody = InstalledPackagesAction(
|
||||
action = "launch",
|
||||
packages = pkgSet.toList()
|
||||
).toRequestBody()
|
||||
|
||||
RetrofitManager.getInstance().newApi.postInstalledPackages(HaloApp.getInstance().gid, requestBody)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(EmptyResponse<ResponseBody>())
|
||||
}
|
||||
|
||||
}
|
||||
@ -3521,4 +3521,11 @@ public interface ApiService {
|
||||
@Headers({"Content-Type: application/json", "Accept: application/json"})
|
||||
@POST("suggestions")
|
||||
Single<ResponseBody> uploadAcceleratorErrorLog(@Body RequestBody toRequestBody);
|
||||
|
||||
/**
|
||||
* 上传设备已安装的游戏
|
||||
*/
|
||||
@POST("/devices/{device_id}/installed_games")
|
||||
Single<ResponseBody> postInstalledPackages(@Path("device_id") String deviceId, @Body RequestBody body);
|
||||
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
package com.gh.gamecenter.common.entity
|
||||
|
||||
import android.os.Parcelable
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
class InstalledPackagesAction(
|
||||
val action: String,
|
||||
val packages: List<String>,
|
||||
): Parcelable
|
||||
Reference in New Issue
Block a user