[fix]
[HttpHeaderInterceptor降频 去掉Delegates.observable]
This commit is contained in:
yangyakun
2025-07-09 18:59:02 +08:00
parent 443f1cafe1
commit fc24043cef
2 changed files with 28 additions and 23 deletions

View File

@@ -75,17 +75,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>(), IMoGoCloudListener {
@Volatile
private var gotToken = false
private var httpDnsSimpleLocation by Delegates.observable(getDefaultSimpleLocation()) { _, oldValue, newValue ->
if (gotToken && oldValue.cityCode != newValue.cityCode) {
if (handler.hasMessages(1)) {
handler.removeMessages(1)
}
val msg = Message.obtain()
msg.what = 1
msg.obj = Pair(oldValue.cityCode, newValue.cityCode)
handler.sendMessageDelayed(msg, 1000L * 10)
}
}
private var httpDnsSimpleLocation = getDefaultSimpleLocation()
override fun callCreateOnMainThread() = true
@@ -190,8 +180,8 @@ class HttpDnsStartUp : AndroidStartup<Boolean>(), IMoGoCloudListener {
val envConfig = CallerDevaToolsManager.getEnvConfig()
if (envConfig != null) {
// 更新
httpDnsSimpleLocation =
SimpleLocation(envConfig.cityCode, envConfig.lat, envConfig.lon)
checkCityCode(envConfig.cityCode)
httpDnsSimpleLocation = SimpleLocation(envConfig.cityCode, envConfig.lat, envConfig.lon)
return httpDnsSimpleLocation
}
val mogoLocation: MogoLocation =
@@ -202,13 +192,16 @@ class HttpDnsStartUp : AndroidStartup<Boolean>(), IMoGoCloudListener {
mogoLocation.cityCode.isNullOrEmpty() &&
!CallerMapUIServiceManager.getGDLocationServer()?.lastCityCode.isNullOrEmpty()
) {
val cityCode = (CallerMapUIServiceManager.getGDLocationServer()?.lastCityCode
?: "010")
checkCityCode(cityCode)
SimpleLocation(
CallerMapUIServiceManager.getGDLocationServer()?.lastCityCode
?: "010",
cityCode,
mogoLocation.latitude,
mogoLocation.longitude
)
} else {
checkCityCode(mogoLocation.cityCode)
SimpleLocation(
mogoLocation.cityCode,
mogoLocation.latitude,
@@ -222,6 +215,18 @@ class HttpDnsStartUp : AndroidStartup<Boolean>(), IMoGoCloudListener {
initAiCloudSDK()
}
private fun checkCityCode(cityCode: String) {
if (gotToken && cityCode != httpDnsSimpleLocation.cityCode) {
if (handler.hasMessages(1)) {
handler.removeMessages(1)
}
val msg = Message.obtain()
msg.what = 1
msg.obj = Pair(httpDnsSimpleLocation.cityCode, cityCode)
handler.sendMessageDelayed(msg, 1000L * 10)
}
}
@ChainLog(
linkChainLog = CHAIN_TYPE_STATUS,
linkCode = CHAIN_SOURCE_CLOUD,

View File

@@ -64,21 +64,21 @@ bytex.ASM_API=ASM7
LOGLIB_VERSION=1.10.18
######## MogoAiCloudSDK Version ########
# 网络请求LOGLIB_VERSION
MOGO_NETWORK_VERSION=1.4.7.58
MOGO_NETWORK_VERSION=1.4.7.65
# 鉴权
MOGO_PASSPORT_VERSION=1.4.7.63
MOGO_PASSPORT_VERSION=1.4.7.65
# 长链接
MOGO_SOCKET_VERSION=1.4.7.58
MOGO_SOCKET_VERSION=1.4.7.65
# 数据采集
MOGO_REALTIME_VERSION=1.4.7.58
MOGO_REALTIME_VERSION=1.4.7.65
# 直播推流
MOGO_LIVE_VERSION=1.4.7.58
MOGO_LIVE_VERSION=1.4.7.65
# 直播拉流
MOGO_TRAFFICLIVE_VERSION=1.4.7.58
MOGO_TRAFFICLIVE_VERSION=1.4.7.65
# 定位服务
MOGO_LOCATION_VERSION=1.4.7.58
MOGO_LOCATION_VERSION=1.4.7.65
# 远程通讯模块
MOGO_TELEMATIC_VERSION=1.4.7.58
MOGO_TELEMATIC_VERSION=1.4.7.65
# 动态换肤SDK
MOGO_SKIN_VERSION=1.4.7.50
######## MogoAiCloudSDK Version ########