[code_opt_3.3.0]merge 3.2.0
This commit is contained in:
@@ -38,6 +38,7 @@ import com.mogo.eagle.core.function.chat.facade.socket.SocketConnectManager
|
||||
import com.mogo.eagle.core.function.chat.facade.voice.VoiceControlFacade
|
||||
import com.mogo.eagle.core.utilcode.kotlin.safeCancel
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.Utils
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.android.asCoroutineDispatcher
|
||||
@@ -191,7 +192,9 @@ object MoGoChatFacade: IMoGoChatFacade {
|
||||
val openId = (temp["localUserId"] as? Double ?: return@launch).toInt().toString()
|
||||
Logger.d(ChatConsts.TAG, "handleMessage --- openId:$openId")
|
||||
//初始化房间
|
||||
GMEApi.init(context(), openId = openId, cb = gmeCallback)
|
||||
withContext(ThreadUtils.getIoPool().asCoroutineDispatcher()) {
|
||||
GMEApi.init(context(), openId = openId, cb = gmeCallback)
|
||||
}
|
||||
}
|
||||
else ->
|
||||
Logger.d(ChatConsts.TAG, "handleMessage --- $t")
|
||||
|
||||
@@ -96,12 +96,12 @@ class TeleMsgHandler : IMsgHandler {
|
||||
AppConfigInfo.iPCMacAddress = carConfig.macAddress
|
||||
AppConfigInfo.dockerVersion = carConfig.dockVersion
|
||||
listener?.connectDevice(!carConfig.dockVersion.contains("2.3.0"))
|
||||
CallerDevaToolsManager.getBindingCarInfo(carConfig.macAddress, MoGoAiCloudClientConfig.getInstance().sn)
|
||||
invokeNettyConnResult(
|
||||
"司机屏发送给乘客屏配置信息为:${
|
||||
TextFormat.printer().escapingNonAscii(false).printToString(carConfig)
|
||||
}"
|
||||
)
|
||||
CallerDevaToolsManager.getBindingCarInfo(carConfig.macAddress, MoGoAiCloudClientConfig.getInstance().sn)
|
||||
}
|
||||
// SN
|
||||
10 -> {
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.mogo.eagle.core.function.datacenter.obu.drawer.*
|
||||
import com.mogo.eagle.core.function.datacenter.obu.utils.TrafficDataConvertUtilsNew
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
import com.mogo.eagle.core.utilcode.util.ConvertUtils
|
||||
import com.mogo.support.obu.ObuScene
|
||||
import com.zhidao.support.obu.constants.MogoObuShowConstants
|
||||
import kotlin.math.roundToInt
|
||||
@@ -135,8 +136,10 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
||||
)
|
||||
ttsContent = String.format(
|
||||
ttsContent,
|
||||
Math.round(rsiWarningData.warningMsgList[0].distance).toString(),
|
||||
Math.round(rsiWarningData.warningMsgList[0].eventRadius).toString()
|
||||
ConvertUtils.intToChinese(
|
||||
rsiWarningData.warningMsgList[0].distance.roundToInt()),
|
||||
ConvertUtils.intToChinese(
|
||||
rsiWarningData.warningMsgList[0].eventRadius.roundToInt())
|
||||
)
|
||||
}
|
||||
|
||||
@@ -224,7 +227,8 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
||||
)
|
||||
ttsContent = String.format(
|
||||
ttsContent,
|
||||
Math.round(rsiWarningData.warningMsgList[0].distance).toString()
|
||||
ConvertUtils.intToChinese(
|
||||
rsiWarningData.warningMsgList[0].distance.roundToInt())
|
||||
)
|
||||
}
|
||||
|
||||
@@ -240,8 +244,10 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
||||
)
|
||||
ttsContent = String.format(
|
||||
ttsContent,
|
||||
Math.round(rsiWarningData.warningMsgList[0].distance).toString(),
|
||||
Math.round(rsiWarningData.warningMsgList[0].eventRadius).toString()
|
||||
ConvertUtils.intToChinese(
|
||||
rsiWarningData.warningMsgList[0].distance.roundToInt()),
|
||||
ConvertUtils.intToChinese(
|
||||
rsiWarningData.warningMsgList[0].eventRadius.roundToInt())
|
||||
)
|
||||
}
|
||||
|
||||
@@ -255,7 +261,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
||||
)
|
||||
ttsContent = String.format(
|
||||
EventTypeEnumNew.getWarningTts(appId),
|
||||
mLimitSpeed
|
||||
ConvertUtils.intToChinese(mLimitSpeed)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.mogo.eagle.core.function.datacenter.obu.utils.TrafficDataConvertUtils
|
||||
import com.mogo.eagle.core.utilcode.download.Config
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
import com.mogo.eagle.core.utilcode.util.ConvertUtils
|
||||
import com.mogo.eagle.core.utilcode.util.FileUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.support.obu.ObuBase
|
||||
@@ -410,8 +411,10 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
)
|
||||
ttsContent = String.format(
|
||||
ttsContent,
|
||||
Math.round(data.warningMsgList[0].distance).toString(),
|
||||
Math.round(data.warningMsgList[0].eventRadius).toString()
|
||||
ConvertUtils.intToChinese(
|
||||
data.warningMsgList[0].distance.roundToInt()),
|
||||
ConvertUtils.intToChinese(
|
||||
data.warningMsgList[0].eventRadius.roundToInt())
|
||||
)
|
||||
}
|
||||
|
||||
@@ -506,7 +509,8 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
)
|
||||
ttsContent = String.format(
|
||||
ttsContent,
|
||||
Math.round(data.warningMsgList[0].distance).toString()
|
||||
ConvertUtils.intToChinese(
|
||||
data.warningMsgList[0].distance.roundToInt())
|
||||
)
|
||||
}
|
||||
|
||||
@@ -522,8 +526,10 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
)
|
||||
ttsContent = String.format(
|
||||
ttsContent,
|
||||
Math.round(data.warningMsgList[0].distance).toString(),
|
||||
Math.round(data.warningMsgList[0].eventRadius).toString()
|
||||
ConvertUtils.intToChinese(
|
||||
data.warningMsgList[0].distance.roundToInt()),
|
||||
ConvertUtils.intToChinese(
|
||||
data.warningMsgList[0].eventRadius.roundToInt())
|
||||
)
|
||||
}
|
||||
|
||||
@@ -539,7 +545,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
)
|
||||
ttsContent = String.format(
|
||||
EventTypeEnumNew.getWarningTts(appId),
|
||||
mLimitSpeed
|
||||
ConvertUtils.intToChinese(mLimitSpeed)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import com.zhjt.mogo_core_function_devatools.apm.*
|
||||
import com.mogo.eagle.core.function.api.upgrade.*
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseManager
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import com.zhjt.mogo_core_function_devatools.binding.BindingCarManager.Companion.bindingCarManager
|
||||
import com.zhjt.mogo_core_function_devatools.binding.*
|
||||
import com.zhjt.mogo_core_function_devatools.env.EnvChangeManager
|
||||
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigCenter.Companion.bizConfigCenter
|
||||
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigImpl
|
||||
@@ -90,7 +90,7 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
//升级(鹰眼/工控)与监控服务
|
||||
iPCReportManager.initServer()
|
||||
moFangManager.init(mContext!!)
|
||||
bindingCarManager.init(mContext!!)
|
||||
BindingCarManager.init(mContext!!)
|
||||
apmEnvProvider.init(if(DebugConfig.isDebug()) "0" else "1", "${ DebugConfig.getNetMode() }", mDockerVersion ?: "")
|
||||
BadCaseManager.init()
|
||||
}
|
||||
@@ -313,29 +313,29 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
}
|
||||
|
||||
override fun modifyCarInfo(callBack: (ModifyBindingcarInfo) -> Unit) {
|
||||
bindingCarManager.modifyCarInfo(callBack)
|
||||
BindingCarManager.modifyCarInfo(callBack)
|
||||
}
|
||||
|
||||
override fun getBindingCarInfo(macAddress: String, widevineIDWithMd5: String) {
|
||||
bindingCarManager.getBindingCarInfo(macAddress, widevineIDWithMd5)
|
||||
BindingCarManager.getBindingCarInfo(macAddress, widevineIDWithMd5)
|
||||
}
|
||||
|
||||
override fun upgradeConfirm(images: List<String>, padSn: String, releaseId: String) {
|
||||
bindingCarManager.upgradeConfirm(images, padSn, releaseId)
|
||||
BindingCarManager.upgradeConfirm(images, padSn, releaseId)
|
||||
}
|
||||
|
||||
override fun queryContainers(padSn: String, dockerVersion: String) {
|
||||
bindingCarManager.queryContainers(padSn, dockerVersion)
|
||||
BindingCarManager.queryContainers(padSn, dockerVersion)
|
||||
}
|
||||
|
||||
override fun queryAppUpgrade() {
|
||||
bindingCarManager.queryAppUpgrade()
|
||||
BindingCarManager.queryAppUpgrade()
|
||||
}
|
||||
|
||||
override fun apmEnvProvider(): IApmEnvProvider = apmEnvProvider
|
||||
|
||||
override fun queryObuUpgrade(obuVersionName: String) {
|
||||
bindingCarManager.queryObuUpgrade(obuVersionName)
|
||||
BindingCarManager.queryObuUpgrade(obuVersionName)
|
||||
}
|
||||
|
||||
override fun upgradeProvider(): IMoGoUpgradeProvider? {
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.zhjt.mogo_core_function_devatools.binding
|
||||
|
||||
import android.annotation.*
|
||||
import android.content.Context
|
||||
import android.text.TextUtils
|
||||
import android.util.*
|
||||
import com.elegant.utils.UiThreadHandler
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.constants.SharedPrefsConstants
|
||||
@@ -16,6 +18,7 @@ import com.mogo.eagle.core.function.call.obu.CallerObuApiManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isDriver
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isPassenger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.zhjt.mogo_core_function_devatools.upgrade.IPCUpgradeManager.Companion.ipcUpgradeManager
|
||||
@@ -26,21 +29,19 @@ import mogo.telematics.pad.MessagePad
|
||||
/**
|
||||
* 车辆绑定
|
||||
*/
|
||||
class BindingCarManager : IMoGoAutopilotCarConfigListener {
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
object BindingCarManager : IMoGoAutopilotCarConfigListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "BindingCarManager"
|
||||
|
||||
val bindingCarManager by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
BindingCarManager()
|
||||
}
|
||||
}
|
||||
private const val TAG = "BindingCarManager"
|
||||
|
||||
private var mContext: Context? = null
|
||||
|
||||
@Volatile
|
||||
private var mAddress: String? = null
|
||||
|
||||
@Volatile
|
||||
private var mObuVersion: String? = null
|
||||
|
||||
@Volatile
|
||||
private var mWidevineIDWithMd5 //google 数字版权
|
||||
: String? = null
|
||||
@@ -60,11 +61,10 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
|
||||
}
|
||||
|
||||
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
|
||||
CallerLogger.d("${SceneConstant.M_BINDING}${TAG}", "onAutopilotCarConfig ----------> ")
|
||||
if (carConfigResp != null && !TextUtils.isEmpty(carConfigResp.macAddress)) {
|
||||
CallerLogger.d("${SceneConstant.M_BINDING}${TAG}",
|
||||
"onAutopilotCarConfig carConfigResp.macAddress = ${carConfigResp.macAddress} "
|
||||
)
|
||||
Logger.d("${SceneConstant.M_BINDING}${TAG}", "onAutopilotCarConfig ----------> ")
|
||||
if (!TextUtils.isEmpty(carConfigResp.macAddress)) {
|
||||
Logger.d("${SceneConstant.M_BINDING}${TAG}",
|
||||
"onAutopilotCarConfig carConfigResp.macAddress = ${carConfigResp.macAddress} ")
|
||||
getBindingCarInfo(carConfigResp.macAddress, MoGoAiCloudClientConfig.getInstance().sn)
|
||||
}
|
||||
}
|
||||
@@ -75,12 +75,27 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
|
||||
* @param macAddress
|
||||
*/
|
||||
fun getBindingCarInfo(macAddress: String, widevineIDWithMd5: String) {
|
||||
Log.d("UPGRADE", "-- getBindingCarInfo -- 1 -- : [mac: $macAddress, md5: $widevineIDWithMd5]")
|
||||
var flag = false
|
||||
if (!TextUtils.isEmpty(macAddress) && TextUtils.isEmpty(mAddress)) {
|
||||
Log.d("UPGRADE", "-- getBindingCarInfo -- 2 -- : [mac: $macAddress, md5: $widevineIDWithMd5]")
|
||||
flag = true
|
||||
}
|
||||
if (!TextUtils.isEmpty(macAddress) && !TextUtils.equals(macAddress, mAddress)) {
|
||||
mAddress = macAddress
|
||||
}
|
||||
if (flag) {
|
||||
Log.d("UPGRADE", "-- getBindingCarInfo -- 3 -- : [mac: $macAddress, md5: $widevineIDWithMd5]")
|
||||
queryAppUpgrade()
|
||||
val obuVersion = mObuVersion
|
||||
if (obuVersion != null && !TextUtils.isEmpty(obuVersion)) {
|
||||
queryObuUpgrade(obuVersion)
|
||||
}
|
||||
}
|
||||
CallerLogger.d("${SceneConstant.M_BINDING}${TAG}",
|
||||
"getBindingcarInfo macAddress = $macAddress--widevineIDWithMd5 = $widevineIDWithMd5 ---screenType = $screenType"
|
||||
)
|
||||
SharedPrefsMgr.getInstance(mContext!!).putString(SharedPrefsConstants.APP_MAC, macAddress)
|
||||
|
||||
mAddress = macAddress
|
||||
mWidevineIDWithMd5 = widevineIDWithMd5
|
||||
if (screenType == 1) { //司机屏
|
||||
driverScreen(macAddress, widevineIDWithMd5)
|
||||
@@ -167,13 +182,20 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
|
||||
* 查询app是否需要升级
|
||||
*/
|
||||
fun queryAppUpgrade() {
|
||||
CallerLogger.d("${SceneConstant.M_BINDING}${TAG}" + "queryAppUpgrade---role.toString() = ${role.toString()} ---mAddress = $mAddress ---spMac = ${SharedPrefsMgr.getInstance(mContext!!)
|
||||
.getString(SharedPrefsConstants.APP_MAC)}")
|
||||
(if (!mAddress.isNullOrEmpty()) mAddress else SharedPrefsMgr.getInstance(mContext!!)
|
||||
.getString(SharedPrefsConstants.APP_MAC))?.let {
|
||||
CallerLogger.d("${SceneConstant.M_BINDING}${TAG}", "queryAppUpgrade---mAddress = $mAddress")
|
||||
Log.d("UPGRADE", "---- 1 ----")
|
||||
var macAddress = mAddress
|
||||
if (TextUtils.isEmpty(macAddress)) {
|
||||
Log.d("UPGRADE", "---- 2 ----")
|
||||
macAddress = SharedPrefsMgr.getInstance(mContext!!)
|
||||
.getString(SharedPrefsConstants.APP_MAC)
|
||||
}
|
||||
if (macAddress != null && !TextUtils.isEmpty(macAddress)) {
|
||||
if (!TextUtils.equals(macAddress, mAddress)) {
|
||||
mAddress = macAddress
|
||||
}
|
||||
Log.d("UPGRADE", "---- 3 ----[mac: $macAddress]")
|
||||
UpgradeAppNetWorkManager.instance
|
||||
?.getAppUpgradeInfo(mContext, it, role.toString() + "")
|
||||
?.getAppUpgradeInfo(mContext, macAddress, role.toString() + "")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,12 +204,12 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
|
||||
* obu的升级,只需要司机屏连接
|
||||
*/
|
||||
fun queryObuUpgrade(obuVersionName: String) {
|
||||
mObuVersion = obuVersionName
|
||||
CallerLogger.d("${SceneConstant.M_OBU}${MogoObuConst.TAG_UPGRADE_OBU}", "screenType = $screenType ----role = $role")
|
||||
if (screenType == 1) {
|
||||
CallerLogger.d("${SceneConstant.M_OBU}${MogoObuConst.TAG_UPGRADE_OBU}","queryObuUpgrade isConnected = ${CallerObuApiManager.isConnected()} --- mAddress = $mAddress")
|
||||
ObuUpgradeAppNetWorkManager.instance?.getObuUpgradeInfo(mContext, if(!mAddress.isNullOrEmpty()) mAddress else SharedPrefsMgr.getInstance(mContext!!).getString(SharedPrefsConstants.APP_MAC), obuVersionName)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package com.zhjt.mogo_core_function_devatools.tts
|
||||
|
||||
import android.content.Context
|
||||
import com.elegant.utils.storage.SharedPrefsMgr
|
||||
import android.util.Log
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.eagle.core.function.api.cloud.IMoGoCloudListener
|
||||
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.zhjt.mogo_core_function_devatools.trace.TraceManager
|
||||
|
||||
class TtsManager : IMoGoCloudListener {
|
||||
|
||||
@@ -21,16 +20,14 @@ class TtsManager : IMoGoCloudListener {
|
||||
}
|
||||
|
||||
fun initTts(context: Context) {
|
||||
val sn = SharedPrefsMgr.getInstance(context).getString("sn")
|
||||
if (sn.isNullOrEmpty()) {
|
||||
CallerCloudListenerManager.addListener(TraceManager.TAG, this)
|
||||
}
|
||||
CallerCloudListenerManager.addListener(TAG, this)
|
||||
AIAssist.getInstance(context)
|
||||
}
|
||||
|
||||
override fun tokenGot(token: String, sn: String) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
Log.d(TAG, "网络获取到sn为:${sn},准备重新初始化Tts")
|
||||
ThreadUtils.runOnUiThread({
|
||||
AIAssist.getInstance(AbsMogoApplication.getApp()).initTtsAgain(sn)
|
||||
}
|
||||
}, ThreadUtils.MODE.QUEUE)
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,15 @@ package com.zhjt.mogo_core_function_devatools.upgrade
|
||||
|
||||
import android.content.*
|
||||
import android.util.*
|
||||
import android.widget.Toast
|
||||
import com.mogo.cloud.passport.*
|
||||
import com.mogo.commons.constants.*
|
||||
import com.mogo.commons.utils.*
|
||||
import com.mogo.eagle.core.data.config.*
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.*
|
||||
import com.mogo.eagle.core.function.api.devatools.download.DownloadType.APK
|
||||
import com.mogo.eagle.core.function.api.devatools.download.DownloadType.PATCH
|
||||
import com.mogo.eagle.core.function.call.devatools.*
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager.upgradeProvider
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showUpgradeDialog
|
||||
import com.mogo.eagle.core.function.call.patch.CallerPatchManager.addPatchInfo
|
||||
@@ -14,7 +18,7 @@ import com.mogo.eagle.core.function.call.patch.CallerPatchManager.isPatchAccept
|
||||
import com.mogo.eagle.core.network.*
|
||||
import com.mogo.eagle.core.network.utils.*
|
||||
import com.mogo.eagle.core.utilcode.download.Config
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
@@ -22,6 +26,7 @@ import com.mogo.eagle.core.utilcode.util.FileUtils
|
||||
import kotlinx.coroutines.*
|
||||
import okhttp3.*
|
||||
import java.util.TreeMap
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
@@ -36,16 +41,23 @@ class UpgradeAppNetWorkManager private constructor() {
|
||||
|
||||
private val provider by lazy { upgradeProvider() }
|
||||
|
||||
@Volatile
|
||||
private var upgradeJob: Job? = null
|
||||
|
||||
// 标识静默升级是否已触发下载,如果为true, 直接返回,防止重复下载
|
||||
@Volatile
|
||||
private var mDownloadRequested = false
|
||||
|
||||
/**
|
||||
* 获取app升级信息
|
||||
*/
|
||||
fun getAppUpgradeInfo(context: Context?, mac: String, screenType: String) { // String sn = "X20202203105S688HZ";
|
||||
fun getAppUpgradeInfo(context: Context?, mac: String, screenType: String) {
|
||||
upgradeJob?.safeCancel()
|
||||
scope.launch {
|
||||
val sn = MoGoAiCloudClientConfig.getInstance().sn //null
|
||||
val macAddress = mac //"48:b0:2d:4d:31:7f"
|
||||
val type = screenType //"10"
|
||||
SharedPrefsMgr.getInstance(context!!).putString(SharedPrefsConstants.HOST_ADDRESS, HostConst.getHost())
|
||||
|
||||
try {
|
||||
val records = provider?.getUpgradeRecords()?.also {
|
||||
MogoAnalyticUtils.track("AppUpgradeRecord", TreeMap<String, Any>().also { itx ->
|
||||
@@ -59,7 +71,7 @@ class UpgradeAppNetWorkManager private constructor() {
|
||||
Log.d(TAG, "getAppUpgradeInfo: -> records:" + records?.entries?.joinToString(",") { itx -> "key:${itx.key} -> value:[${itx.value.joinToString(",") { "${it.first},${it.second}" } }]"})
|
||||
val versionCode = AppUtils.getAppVersionCode()
|
||||
val versionName = AppUtils.getAppVersionName()
|
||||
d(SceneConstant.M_BINDING + TAG, "getAppUpgradeInfo mac = $macAddress---type = $type---sn = $sn---versionCode =$versionCode---versionName =$versionName")
|
||||
Log.d(SceneConstant.M_BINDING + TAG, "getAppUpgradeInfo mac = $macAddress---type = $type---sn = $sn---versionCode =$versionCode---versionName =$versionName")
|
||||
val request = UpgradeAppRequest(sn, macAddress, type, versionName, "1")
|
||||
val requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request))
|
||||
provider?.recordUpgradeRecord(sn ?: "", macAddress, type, FunctionBuildConfig.isSupportPatchUpgrade)
|
||||
@@ -80,13 +92,20 @@ class UpgradeAppNetWorkManager private constructor() {
|
||||
provider?.recordUpgradeRequestFailed(t.message ?: "更新接口请求失败")
|
||||
deleteApkFile()
|
||||
}
|
||||
delay(TimeUnit.HOURS.toMillis(1))
|
||||
if (mDownloadRequested) {
|
||||
mDownloadRequested = false
|
||||
}
|
||||
getAppUpgradeInfo(context, mac, screenType)
|
||||
}.also {
|
||||
upgradeJob = it
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun doUpgrade(info: UpgradeAppInfo) {
|
||||
if (info.result != null) {
|
||||
val versionCode = AppUtils.getAppVersionCode()
|
||||
d(SceneConstant.M_BINDING + TAG, "UpgradeAppInfo url = " + info.result.appUrl + "----code = " + info.result.versionCode + "--versionCode =" + versionCode + "--info.result = " + info.result)
|
||||
Log.d(SceneConstant.M_BINDING + TAG, "UpgradeAppInfo url = " + info.result.appUrl + "----code = " + info.result.versionCode + "--versionCode =" + versionCode + "--info.result = " + info.result)
|
||||
if (info.result.versionCode > versionCode) {
|
||||
val patchInfo = info.result.patchInfo
|
||||
var downloadUrl: String = info.result.appUrl
|
||||
@@ -122,14 +141,38 @@ class UpgradeAppNetWorkManager private constructor() {
|
||||
Log.d("ApkInstaller", "走全量升级 --- 1 ----")
|
||||
provider?.recordUpgradeRecord(info.result.versionName, null, 0)
|
||||
}
|
||||
withContext(Dispatchers.Main) {
|
||||
showUpgradeDialog(downloadUrl.substring(downloadUrl.lastIndexOf("/") + 1), downloadUrl, info.result.installTitle, info.result.installContent, info.result.installType)
|
||||
if (ApkInstaller.isInstallAppStore(Utils.getApp())) {
|
||||
if (mDownloadRequested) {
|
||||
return
|
||||
}
|
||||
mDownloadRequested = true
|
||||
try {
|
||||
withContext(Dispatchers.Main) {
|
||||
Toast.makeText(Utils.getApp(), "检测到新版本[${info.result.versionName}]并且当前设备支持静默升级,开始下载新版本...", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
Log.d("ApkInstaller", "EB5设备,直接走静默,不弹窗...")
|
||||
CallerDevaToolsManager.downLoadPackage(if (isGoFullUpgrade) APK else PATCH, downloadUrl.substring(downloadUrl.lastIndexOf("/") + 1), downloadUrl)
|
||||
} else {
|
||||
var activity = AppStateManager.currentActivity()
|
||||
while (activity == null) {
|
||||
delay(2000)
|
||||
activity = AppStateManager.currentActivity()
|
||||
if (activity != null) {
|
||||
break
|
||||
}
|
||||
}
|
||||
activity?.lifeCycleScope?.launchWhenResumed {
|
||||
showUpgradeDialog(downloadUrl.substring(downloadUrl.lastIndexOf("/") + 1), downloadUrl, info.result.installTitle, info.result.installContent, info.result.installType)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
deleteApkFile()
|
||||
}
|
||||
} else {
|
||||
d(SceneConstant.M_BINDING + TAG, "UpgradeAppInfo onNext info == null")
|
||||
Log.d(SceneConstant.M_BINDING + TAG, "UpgradeAppInfo onNext info == null")
|
||||
deleteApkFile()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
private val operation: Int = 1
|
||||
private val operationReturn: Int = 10
|
||||
private val operationStop: Int = 11
|
||||
private val operationDoorSwitchFail: Int = 13 //车门开启、关闭失败
|
||||
private val notice: Int = 2
|
||||
private val v2x: Int = 3
|
||||
private val report: Int = 4
|
||||
@@ -67,6 +68,11 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
.inflate(R.layout.item_msg_bubble_operation_stop, parent, false)
|
||||
return BubbleOperationStopHolder(view)
|
||||
}
|
||||
operationDoorSwitchFail ->{
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_msg_bubble_operation_door, parent, false)
|
||||
return BubbleOperationDoorFailHolder(view)
|
||||
}
|
||||
report -> {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_report,parent,false)
|
||||
return BubbleReportHolder(view)
|
||||
@@ -114,6 +120,16 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
val operationStopMsg = it[position].msgBoxBean.bean as OperationMsg
|
||||
holder.tvOperationStopTime.text =
|
||||
TimeUtils.millis2String(operationStopMsg.timestamp, getHourMinFormat())
|
||||
holder.tvOperationStopContent.text = operationStopMsg.content
|
||||
}
|
||||
}
|
||||
//车门开启关闭失败
|
||||
is BubbleOperationDoorFailHolder -> {
|
||||
data?.let{
|
||||
val operationDoorMsg = it[position].msgBoxBean.bean as OperationMsg
|
||||
holder.tvOperationDoorTime.text =
|
||||
TimeUtils.millis2String(operationDoorMsg.timestamp, getHourMinFormat())
|
||||
holder.tvOperationDoorContent.text = operationDoorMsg.content
|
||||
}
|
||||
}
|
||||
is BubbleReportHolder -> {
|
||||
@@ -221,7 +237,10 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
}else if((data!![position].msgBoxBean.bean as OperationMsg).type == 1){
|
||||
//运营平台靠边停车
|
||||
operationStop
|
||||
}else{
|
||||
}else if((data!![position].msgBoxBean.bean as OperationMsg).type == 3){
|
||||
//车门开启关闭失败
|
||||
operationDoorSwitchFail
|
||||
} else{
|
||||
//普通运营平台
|
||||
operation
|
||||
}
|
||||
@@ -260,8 +279,13 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
//运营平台靠边停车通知
|
||||
class BubbleOperationStopHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var tvOperationStopTime: TextView = itemView.findViewById(R.id.tvOperationStopTime)
|
||||
var tvOperationStopContent: TextView = itemView.findViewById(R.id.tvOperationStopContent)
|
||||
}
|
||||
//车门开启关闭失败
|
||||
class BubbleOperationDoorFailHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var tvOperationDoorTime: TextView = itemView.findViewById(R.id.tvOperationDoorTime)
|
||||
var tvOperationDoorContent: TextView = itemView.findViewById(R.id.tvOperationDoorContent)
|
||||
}
|
||||
|
||||
//Notice
|
||||
class BubbleNoticeHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var ivNoticeImage: ImageView = itemView.findViewById(R.id.ivNoticeImage)
|
||||
|
||||
@@ -37,6 +37,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
|
||||
private val operation: Int = 1
|
||||
private val operationReturn: Int = 10
|
||||
private val operationStop: Int = 11
|
||||
private val operationDoorSwitchFail: Int = 13
|
||||
private val notice: Int = 2
|
||||
private val v2x: Int = 3
|
||||
private val report: Int = 5
|
||||
@@ -84,6 +85,11 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
|
||||
.inflate(R.layout.item_msg_box_operation_stop, parent, false)
|
||||
return MsgBoxOperationStop(view)
|
||||
}
|
||||
operationDoorSwitchFail -> {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_msg_box_operation_door, parent, false)
|
||||
return MsgBoxOperationDoor(view)
|
||||
}
|
||||
notice -> {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_msg_box_notice, parent, false)
|
||||
@@ -315,6 +321,16 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
|
||||
val operationStopMsg = it[position].bean as OperationMsg
|
||||
holder.tvOperationStopTime.text =
|
||||
TimeUtils.millis2String(operationStopMsg.timestamp, getHourMinFormat())
|
||||
holder.tvOperationStopContent.text = operationStopMsg.content
|
||||
}
|
||||
}
|
||||
//运营平台开关门失败
|
||||
is MsgBoxOperationDoor -> {
|
||||
data?.let{
|
||||
val operationDoorMsg = it[position].bean as OperationMsg
|
||||
holder.tvOperationDoorTime.text =
|
||||
TimeUtils.millis2String(operationDoorMsg.timestamp, getHourMinFormat())
|
||||
holder.tvOperationDoorContent.text = operationDoorMsg.content
|
||||
}
|
||||
}
|
||||
is MsgBoxNotice -> {
|
||||
@@ -394,7 +410,10 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
|
||||
}else if((data!![position].bean as OperationMsg).type == 1){
|
||||
//运营平台靠边停车
|
||||
operationStop
|
||||
}else{
|
||||
}else if((data!![position].bean as OperationMsg).type == 3){
|
||||
//开关门失败
|
||||
operationDoorSwitchFail
|
||||
} else{
|
||||
//普通运营平台
|
||||
operation
|
||||
}
|
||||
@@ -457,8 +476,13 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
|
||||
//运营平台靠边停车通知
|
||||
class MsgBoxOperationStop(itemView: View) : RecyclerView.ViewHolder(itemView){
|
||||
var tvOperationStopTime: TextView = itemView.findViewById(R.id.tvOperationStopTime)
|
||||
var tvOperationStopContent: TextView = itemView.findViewById(R.id.tvOperationStopContent)
|
||||
}
|
||||
//运营平台开关门失败
|
||||
class MsgBoxOperationDoor(itemView: View) : RecyclerView.ViewHolder(itemView){
|
||||
var tvOperationDoorTime: TextView = itemView.findViewById(R.id.tvOperationDoorTime)
|
||||
var tvOperationDoorContent: TextView = itemView.findViewById(R.id.tvOperationDoorContent)
|
||||
}
|
||||
|
||||
//Notice
|
||||
class MsgBoxNotice(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
var ivNoticeImage: ImageView = itemView.findViewById(R.id.ivNoticeImage)
|
||||
|
||||
@@ -65,7 +65,9 @@ import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.logcatch.ILogViewListener
|
||||
import com.mogo.eagle.core.function.hmi.ui.logcatch.LogInfoView
|
||||
import com.mogo.eagle.core.function.hmi.ui.map.OfflineMapDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.SystemVersionView
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
@@ -76,6 +78,7 @@ import com.mogo.eagle.core.utilcode.mogo.permissions.BackgrounderPermission
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.map.hdcache.IHdCacheListener
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.*
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
@@ -180,6 +183,9 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
private var isStarted = false
|
||||
|
||||
// 高精地图是否已缓存
|
||||
private var isHDCached = false
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_debug_setting, this, true)
|
||||
initView()
|
||||
@@ -571,6 +577,32 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
btn_cache_hd_map?.onClick {
|
||||
if (isHDCached) {
|
||||
ToastUtils.showShort(resources.getString(R.string.offline_had_downloaded))
|
||||
} else {
|
||||
if (CallerMapUIServiceManager.getCityCode().isNullOrEmpty()) {// 未拿到高德的cityCode
|
||||
if (mGnssInfo == null || (mGnssInfo!!.longitude <= 0.0 && mGnssInfo!!.latitude <= 0.0)) {// 未拿到高精的经纬度
|
||||
ToastUtils.showShort(resources.getString(R.string.location_try_again))
|
||||
} else {// 拿到了高精的经纬度
|
||||
cacheHDOfflineData(false)
|
||||
}
|
||||
} else {// 拿到高德的cityCode
|
||||
cacheHDOfflineData(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
ThreadUtils.getIoPool().execute {
|
||||
val isCached = CallerMapUIServiceManager.isCityDataCached()
|
||||
isHDCached = isCached
|
||||
UiThreadHandler.post {
|
||||
btn_cache_hd_map.text = "缓存高精离线地图(${if (isCached) "已是最新版" else "待更新"}!)"
|
||||
}
|
||||
}
|
||||
btn_cache_hd_map.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改自车按钮(出租车、小巴车)
|
||||
@@ -2123,6 +2155,52 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
Process.killProcess(Process.myPid())
|
||||
}
|
||||
|
||||
private fun cacheHDOfflineData(isGaoDe: Boolean) {
|
||||
var progss = 0
|
||||
if (isGaoDe) {// 拿到了高德地图的cityCode
|
||||
CallerMapUIServiceManager.cacheHDDataByCity(object : IHdCacheListener {
|
||||
override fun onMapHdCacheProgress(cityId: Int, progress: Double) {
|
||||
// 更新进度
|
||||
progss = progress.toInt()
|
||||
if (progss == 100) {
|
||||
isHDCached = true
|
||||
btn_cache_hd_map.text = "缓存高精离线地图(已是最新版!)"
|
||||
} else {
|
||||
btn_cache_hd_map.text = "缓存高精离线地图(进度:${progss}%)"
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMapHdCacheResult(cityId: Int, state: Int) {
|
||||
if (state == 0) {// 失败
|
||||
btn_cache_hd_map.text = "缓存高精离线地图(下载失败!)"
|
||||
ToastUtils.showShort("下载失败,请重试!")
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {// 只拿到了高精的经纬度
|
||||
mGnssInfo?.let { loc ->
|
||||
CallerMapUIServiceManager.cacheHDDataByCityByLonLat(object : IHdCacheListener {
|
||||
override fun onMapHdCacheProgress(cityId: Int, progress: Double) {
|
||||
progss = progress.toInt()
|
||||
if (progss == 100) {
|
||||
isHDCached = true
|
||||
btn_cache_hd_map.text = "缓存高精离线地图(已是最新版!)"
|
||||
} else {
|
||||
btn_cache_hd_map.text = "缓存高精离线地图(进度:${progss}%)"
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMapHdCacheResult(cityId: Int, state: Int) {
|
||||
if (state == 0) {// 失败
|
||||
btn_cache_hd_map.text = "缓存高精离线地图(下载失败!)"
|
||||
ToastUtils.showShort("下载失败,请重试!")
|
||||
}
|
||||
}
|
||||
}, loc)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun fwThreadClose() {
|
||||
refreshTraceInfo()
|
||||
}
|
||||
|
||||
@@ -55,7 +55,6 @@ class TakeOverView @JvmOverloads constructor(
|
||||
*/
|
||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||
autopilotStatus = autoPilotStatusInfo.state
|
||||
Log.i(TAG,"onAutopilotStatusResponse autoPilotStatusInfo state="+autoPilotStatusInfo.state)
|
||||
if(autoPilotStatusInfo.state == 7){
|
||||
isParallel = true
|
||||
}else if(autoPilotStatusInfo.state == 0 || autoPilotStatusInfo.state == 1){
|
||||
@@ -70,7 +69,6 @@ class TakeOverView @JvmOverloads constructor(
|
||||
super.onAutopilotGuardian(guardianInfo)
|
||||
ThreadUtils.runOnUiThread {
|
||||
guardianInfo?.let {
|
||||
Log.i(TAG,"onAutopilotGuardian guardianInfo ="+it.code)
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
return@let
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ class DriverMonitorView :
|
||||
|
||||
override fun onPlaRequesting() {
|
||||
Logger.e("${SceneConstant.M_HMI}$TAG", "onPlaRequesting……")
|
||||
isLived = false
|
||||
isLived = true
|
||||
refreshView(isLived)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.appcompat.content.res.AppCompatResources
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.eagle.core.function.api.map.roma.IMoGoRomaListener
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager.romaTrigger
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import kotlinx.android.synthetic.main.view_roma_bus_bg.view.ivRomaView
|
||||
import kotlinx.android.synthetic.main.view_roma_bus_bg.view.ll_roma_bg
|
||||
|
||||
class RomaBusView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoRomaListener {
|
||||
|
||||
companion object{
|
||||
private const val TAG = "RomaView"
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var romaMode = false
|
||||
|
||||
@Volatile
|
||||
private var click = true
|
||||
|
||||
private val normalRes: Int
|
||||
private val openRes: Int
|
||||
|
||||
init{
|
||||
LayoutInflater.from(context).inflate(R.layout.view_roma_bus_bg, this, true)
|
||||
val a = context.obtainStyledAttributes(
|
||||
attrs,
|
||||
R.styleable.RomaView,
|
||||
defStyleAttr,
|
||||
0
|
||||
)
|
||||
normalRes = a.getResourceId(
|
||||
R.styleable.RomaView_roma_close_bg,
|
||||
R.drawable.romabg_normal_select
|
||||
)
|
||||
openRes = a.getResourceId(
|
||||
R.styleable.RomaView_roma_open_bg,
|
||||
R.drawable.romabg_press_select_bg
|
||||
)
|
||||
a.recycle()
|
||||
if(normalRes!=0){
|
||||
ll_roma_bg.background = AppCompatResources.getDrawable(context, normalRes)
|
||||
}
|
||||
|
||||
setOnClickListener {
|
||||
if(!click){
|
||||
return@setOnClickListener
|
||||
}
|
||||
if(!MogoStatusManager.getInstance().isSocketOnLine){
|
||||
ToastUtils.showShort("长链状态异常,请检查链接后开启漫游")
|
||||
return@setOnClickListener
|
||||
}
|
||||
click = false
|
||||
romaMode = !romaMode
|
||||
//司机屏不控制乘客屏漫游,独自漫游
|
||||
romaTrigger(romaMode)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun romaStatus(status: Boolean) {
|
||||
click = true
|
||||
if (status) {
|
||||
romaMode = true
|
||||
if(openRes!=0){
|
||||
ll_roma_bg.setBackgroundResource(openRes)
|
||||
}else{
|
||||
ll_roma_bg.setBackgroundResource(R.drawable.romabg_press_select_bg)
|
||||
}
|
||||
ivRomaView.setBackgroundResource(R.drawable.roma_press_select_bg)
|
||||
} else {
|
||||
romaMode = false
|
||||
if(normalRes!=0){
|
||||
ll_roma_bg.setBackgroundResource(normalRes)
|
||||
}else{
|
||||
ll_roma_bg.setBackgroundResource(R.drawable.roma_bg_selector)
|
||||
}
|
||||
ivRomaView.setBackgroundResource(R.drawable.romafront_select_bg)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerMapRomaListener.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerMapRomaListener.removeListener(TAG)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,10 +4,12 @@ import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.eagle.core.function.api.map.roma.IMoGoRomaListener
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager.romaTrigger
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
|
||||
class RomaPassengerView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
@@ -39,6 +41,10 @@ class RomaPassengerView @JvmOverloads constructor(
|
||||
if(!click){
|
||||
return@setOnClickListener
|
||||
}
|
||||
if(!MogoStatusManager.getInstance().isSocketOnLine){
|
||||
ToastUtils.showShort("长链状态异常,请检查链接后开启漫游")
|
||||
return@setOnClickListener
|
||||
}
|
||||
click = false
|
||||
romaMode = !romaMode
|
||||
romaTrigger(romaMode)
|
||||
|
||||
@@ -5,13 +5,16 @@ import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.appcompat.content.res.AppCompatResources
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.eagle.core.function.api.map.roma.IMoGoRomaListener
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager.romaTrigger
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import kotlinx.android.synthetic.main.view_roma_bg.view.*
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import kotlinx.android.synthetic.main.view_roma_taxi_bg.view.ivRomaView
|
||||
import kotlinx.android.synthetic.main.view_roma_taxi_bg.view.ll_roma_bg
|
||||
|
||||
class RomaView @JvmOverloads constructor(
|
||||
class RomaTaxiView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
@@ -31,7 +34,7 @@ class RomaView @JvmOverloads constructor(
|
||||
private val openRes: Int
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_roma_bg, this, true)
|
||||
LayoutInflater.from(context).inflate(R.layout.view_roma_taxi_bg, this, true)
|
||||
val a = context.obtainStyledAttributes(
|
||||
attrs,
|
||||
R.styleable.RomaView,
|
||||
@@ -55,6 +58,10 @@ class RomaView @JvmOverloads constructor(
|
||||
if(!click){
|
||||
return@setOnClickListener
|
||||
}
|
||||
if(!MogoStatusManager.getInstance().isSocketOnLine){
|
||||
ToastUtils.showShort("长链状态异常,请检查链接后开启漫游")
|
||||
return@setOnClickListener
|
||||
}
|
||||
click = false
|
||||
romaMode = !romaMode
|
||||
//司机屏不控制乘客屏漫游,独自漫游
|
||||
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="804dp"
|
||||
android:layout_height="160dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#53000000"
|
||||
app:roundLayoutRadius="24dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_marginBottom="7dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivOperationDoorImage"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="110dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginBottom="25dp"
|
||||
android:layout_marginStart="25dp"
|
||||
android:src="@drawable/v2x_icon_shigu_sanjiaopai"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvOperationDoorTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/ivOperationDoorImage"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvOperationDoorContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivOperationDoorImage"
|
||||
app:layout_constraintRight_toRightOf="@id/tvOperationDoorTime"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="25dp"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="32dp"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="804dp"
|
||||
android:layout_height="160dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#53000000"
|
||||
app:roundLayoutRadius="24dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_marginBottom="7dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivOperationDoorImage"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="110dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginBottom="25dp"
|
||||
android:layout_marginStart="25dp"
|
||||
android:src="@drawable/v2x_icon_shigu_sanjiaopai"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvOperationDoorTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/ivOperationDoorImage"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvOperationDoorContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivOperationDoorImage"
|
||||
app:layout_constraintRight_toRightOf="@id/tvOperationDoorTime"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="25dp"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="32dp"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="804dp"
|
||||
android:layout_height="160dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
@@ -49,4 +49,4 @@
|
||||
android:text="靠边停车"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -1560,6 +1560,21 @@
|
||||
app:layout_constraintRight_toRightOf="@id/changesight_cross_btn"
|
||||
app:layout_constraintTop_toBottomOf="@id/changesight_cross_btn" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_cache_hd_map"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="2dp"
|
||||
android:gravity="center"
|
||||
android:text="缓存高精离线地图"
|
||||
android:padding="@dimen/dp_20"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintLeft_toRightOf="@id/reset_changesight"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/changesight_far_btn"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbChangeCurrentCarIcon"
|
||||
android:layout_width="0dp"
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/cl_roma_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_roma_bg"
|
||||
android:layout_width="@dimen/dp_102"
|
||||
android:layout_height="@dimen/dp_102"
|
||||
android:layout_margin="40dp"
|
||||
android:background="@drawable/roma_bg_selector"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivRomaView"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:src="@drawable/romafront_select_bg"
|
||||
android:elevation="@dimen/dp_10"
|
||||
/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -80,13 +80,14 @@ class MapPointCloudSubscriber private constructor()
|
||||
fun isDrawCloudPointDockerVersion(): Boolean {
|
||||
// 由于Docker命名规则不统一,但核心版本是统一但,采用"."分割,如下
|
||||
// MAP-taxi_RoboTaxi_Default_2.2.0_badcasetest_20220215_dev
|
||||
// MAP_RoboBus_B1_3.3.0_lxw_20230526_old_dev
|
||||
val dockerVersionName = AppConfigInfo.dockerVersion
|
||||
// "." 分割,取前两位
|
||||
val dockerVersionNameArray = dockerVersionName?.split(".")
|
||||
|
||||
var dockerVersionCode = ""
|
||||
dockerVersionNameArray?.let {
|
||||
if (it.size > 3) {
|
||||
if (it.size >= 3) {
|
||||
for (index in 0 until 3) {
|
||||
dockerVersionCode +=
|
||||
when (index) {
|
||||
@@ -110,10 +111,10 @@ class MapPointCloudSubscriber private constructor()
|
||||
0
|
||||
}
|
||||
|
||||
if (dockerVersion >= 260) {
|
||||
return true
|
||||
if (dockerVersion <= 260) {
|
||||
return false
|
||||
}
|
||||
return false
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,10 +3,15 @@ package com.mogo.eagle.core.function.business.identify
|
||||
import android.os.Handler
|
||||
import android.os.Message
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuWarningListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isTaxi
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler
|
||||
import com.mogo.eagle.core.utilcode.util.ParseVersionUtils
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
import mogo.yycp.api.proto.SocketDownData
|
||||
@@ -31,15 +36,40 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener {
|
||||
private var aiCloudIdentify: Identify? = null
|
||||
|
||||
init {
|
||||
identify = if (FunctionBuildConfig.isBeautyMode) {
|
||||
UserIdentify.beautifyDataDrawer
|
||||
} else {
|
||||
DriverIdentify.originDataDrawer
|
||||
val dockerVersion = getAutoPilotStatusInfo().dockVersion
|
||||
if (dockerVersion != null && dockerVersion.isNotEmpty()) {
|
||||
try {
|
||||
val version = ParseVersionUtils.parseVersion(true, dockerVersion)
|
||||
identify = if (version >= 30100 && isTaxi(FunctionBuildConfig.appIdentityMode)) {
|
||||
FunctionBuildConfig.isBeautyMode = false
|
||||
drawType("关闭感知优化模式")
|
||||
DriverIdentify.originDataDrawer
|
||||
} else {
|
||||
FunctionBuildConfig.isBeautyMode = true
|
||||
drawType("开启感知优化模式")
|
||||
UserIdentify.beautifyDataDrawer
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
drawType("解析docker异常:$dockerVersion")
|
||||
identify = UserIdentify.beautifyDataDrawer
|
||||
}
|
||||
}
|
||||
aiCloudIdentify = AiIdentify.aiCloudDataDrawer
|
||||
CallerObuWarningListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_LINK_LOG_CONNECT_STATUS,
|
||||
linkCode = ChainConstant.CHAIN_LINK_INIT,
|
||||
endpoint = 4,
|
||||
nodeAliasCode = ChainConstant.CHAIN_ALIAS_CODE_ADAS_MESSAGE_RECT_DATA,
|
||||
paramIndexes = [0],
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
private fun drawType(type: String) {
|
||||
|
||||
}
|
||||
|
||||
private const val MSG_DATA_TRACK = 0
|
||||
private const val MSG_DATA_AI_TRACK = 1
|
||||
private const val MSG_DATA_WARNING = 2
|
||||
@@ -57,12 +87,14 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener {
|
||||
// 非感知美化优化模式,清除旧数据,使用 DriverIdentify originDataDrawer 原始数据绘制
|
||||
if (identify is IdentifyBeautifyDataDrawer) {
|
||||
identify!!.clearOldMarker()
|
||||
drawType("isBeautyMode 模式改变,关闭感知优化模式")
|
||||
identify = DriverIdentify.originDataDrawer
|
||||
}
|
||||
} else {
|
||||
// 感知优化模式,清除旧数据,使用 UserIdentify beautifyDataDrawer 优化数据
|
||||
if (identify is IdentifyOriginDataDrawer) {
|
||||
identify!!.clearOldMarker()
|
||||
drawType("isBeautyMode 模式改变,开启感知优化模式")
|
||||
identify = UserIdentify.beautifyDataDrawer
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,6 +131,7 @@ class IdentifyOriginDataDrawer : Identify {
|
||||
.removeMarker(uuid)
|
||||
}
|
||||
trafficDataUuidList.clear()
|
||||
mMarkersCaches.clear()
|
||||
WarningHelper.clear()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +1,13 @@
|
||||
package com.mogo.eagle.core.function.business.identify;
|
||||
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE_ADAS_MESSAGE_RECT_DATA;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_ADAS;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_DATA_TRACKED;
|
||||
import static com.mogo.eagle.core.function.business.identify.TrackManager.LIMIT_SPEED;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.geometry.S2CellId;
|
||||
import com.mogo.eagle.core.utilcode.geometry.S2LatLng;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ParseVersionUtils;
|
||||
import com.zhjt.service.chain.ChainLog;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
@@ -53,28 +45,9 @@ public class TrackObj {
|
||||
|
||||
private void correct() {
|
||||
calAverageSpeedAndType();
|
||||
String dockerVersion = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getDockVersion();
|
||||
if (dockerVersion != null && !dockerVersion.isEmpty()) {
|
||||
try {
|
||||
int version = ParseVersionUtils.parseVersion(true, dockerVersion);
|
||||
if (version >= 310 && AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
|
||||
return;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logErrorOfVersion(dockerVersion);
|
||||
}
|
||||
}
|
||||
calLoc();
|
||||
}
|
||||
|
||||
@ChainLog(linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_DATA_TRACKED,
|
||||
linkCode = CHAIN_LINK_ADAS,
|
||||
nodeAliasCode = CHAIN_ALIAS_CODE_ADAS_MESSAGE_RECT_DATA,
|
||||
paramIndexes = {0})
|
||||
private void logErrorOfVersion(String version) {
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
private void calAverageSpeedAndType() {
|
||||
if (circleQueue.size() >= 3) {
|
||||
|
||||
@@ -113,7 +113,11 @@ object MarkerDrawerManager {
|
||||
baseDiffDis = diff
|
||||
// 距离最近的时候判断是否走过
|
||||
if (DrivingDirectionUtils.getDegreeOfCar2Poi2(realLon, realLat, latLng.longitude, latLng.latitude, heading) >= 90) {
|
||||
currentIndex = i
|
||||
currentIndex = if (i < lastArrivedIndex) {
|
||||
lastArrivedIndex
|
||||
} else {
|
||||
i
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user