[2.13.0-arch-opt] fix bug of track and loc reason, wait for map version ,plus remove aicloud sdk httpdns,which update version to fix passport . and plus found the line id problem because of code opt

This commit is contained in:
zhongchao
2023-03-01 18:07:21 +08:00
parent 5560e0b293
commit 66b321a2a9
11 changed files with 214 additions and 359 deletions

View File

@@ -4,12 +4,11 @@ import android.content.Context
import com.mogo.aicloud.services.locationinfo.MogoLocationInfoServices
import com.mogo.aicloud.services.socket.IMogoLifecycleListener
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
import com.mogo.cloud.httpdns.MogoHttpDnsConfig
import com.mogo.cloud.httpdns.bean.HttpDnsSimpleLocation
import com.mogo.cloud.httpdns.listener.IHttpDnsCurrentLocation
import com.mogo.cloud.passport.IMoGoTokenCallback
import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.cloud.passport.location.ICurrentLocation
import com.mogo.cloud.passport.location.SimpleLocation
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.constants.SharedPrefsConstants
import com.mogo.commons.debug.DebugConfig
@@ -85,10 +84,10 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
private fun preparePassportEnvironment() {
// 设置网络环境HTTP_DNS_ENV_QA、HTTP_DNS_ENV_RELEASE、HTTP_DNS_ENV_DEV
when (DebugConfig.getNetMode()) {
DebugConfig.NET_MODE_DEV -> clientConfig.netMode = MogoHttpDnsConfig.HTTP_DNS_ENV_DEV
DebugConfig.NET_MODE_QA -> clientConfig.netMode = MogoHttpDnsConfig.HTTP_DNS_ENV_QA
DebugConfig.NET_MODE_DEMO -> clientConfig.netMode = MogoHttpDnsConfig.HTTP_DNS_ENV_DEMO
else -> clientConfig.netMode = MogoHttpDnsConfig.HTTP_DNS_ENV_RELEASE
DebugConfig.NET_MODE_DEV -> clientConfig.netMode = MoGoAiCloudClientConfig.HTTP_DNS_ENV_DEV
DebugConfig.NET_MODE_QA -> clientConfig.netMode = MoGoAiCloudClientConfig.HTTP_DNS_ENV_QA
DebugConfig.NET_MODE_DEMO -> clientConfig.netMode = MoGoAiCloudClientConfig.HTTP_DNS_ENV_DEMO
else -> clientConfig.netMode = MoGoAiCloudClientConfig.HTTP_DNS_ENV_RELEASE
}
// 设置是否是第三APP登录
clientConfig.isThirdLogin =
@@ -126,13 +125,13 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
//设置长链接的secretKey 通过SHA1和包名找中台服务生成后续包名分渠道,需要做对应操作
clientConfig.secretKey = "YMj2VFDFxJ3Q4gNoZceJ"
clientConfig.iHttpDnsCurrentLocation = object : IHttpDnsCurrentLocation {
override fun getCurrentLocation(): HttpDnsSimpleLocation {
clientConfig.iHttpCurrentLocation = object : ICurrentLocation {
override fun getCurrentLocation(): SimpleLocation {
val envConfig = CallerDevaToolsManager.getEnvConfig()
if (envConfig != null) {
// 更新
httpDnsSimpleLocation =
HttpDnsSimpleLocation(envConfig.cityCode, envConfig.lat, envConfig.lon)
SimpleLocation(envConfig.cityCode, envConfig.lat, envConfig.lon)
return httpDnsSimpleLocation
}
val mogoLocation: MogoLocation? = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
@@ -142,14 +141,14 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
mogoLocation.cityCode.isNullOrEmpty() &&
!CallerMapUIServiceManager.getGDLocationServer(context!!)?.lastCityCode.isNullOrEmpty()
) {
HttpDnsSimpleLocation(
SimpleLocation(
CallerMapUIServiceManager.getGDLocationServer(context!!)?.lastCityCode
?: "010",
mogoLocation.latitude,
mogoLocation.longitude
)
} else {
HttpDnsSimpleLocation(
SimpleLocation(
mogoLocation.cityCode,
mogoLocation.latitude,
mogoLocation.longitude
@@ -328,7 +327,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
MogoAiCloudSocketManager.getInstance(context).reConnect()
}
private fun getDefaultSimpleLocation(): HttpDnsSimpleLocation {
private fun getDefaultSimpleLocation(): SimpleLocation {
val ciyCode =
SharedPrefsMgr.getInstance(
AbsMogoApplication.getApp()
@@ -345,11 +344,11 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
)
.getString(SharedPrefsConstants.LOCATION_LONGITUDE)
return try {
HttpDnsSimpleLocation(
SimpleLocation(
ciyCode, latitude.toDouble(), longitude.toDouble()
)
} catch (e: NumberFormatException) {
HttpDnsSimpleLocation("010", 1.0, 1.0)
SimpleLocation("010", 1.0, 1.0)
}
}