Merge branch 'dev_arch_opt_3.0' into dev_robosweeper-d_app-module_221230_1.1.0
# Conflicts: # core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/report/IPCReportManager.kt
This commit is contained in:
@@ -173,9 +173,6 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
|
||||
override fun updateUpgradeProgress() {
|
||||
upgradeManager.updateUpgradeProgress(mContext!!)
|
||||
}
|
||||
|
||||
override fun updateObuUpgradeStatus() {
|
||||
upgradeManager.updateObuUpgradeStatus(mContext!!)
|
||||
}
|
||||
|
||||
|
||||
@@ -86,10 +86,18 @@ class BindingCarNetWorkManager private constructor() {
|
||||
SharedPrefsConstants.CAR_INFO,
|
||||
GsonUtils.toJson(info.getData())
|
||||
)
|
||||
} else {
|
||||
// SharedPrefsMgr.getInstance(context).putString(
|
||||
// SharedPrefsConstants.CAR_INFO, "null")
|
||||
e(
|
||||
SceneConstant.M_BINDING + TAG, "getBindingCarInfo data = null "
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(e: Throwable) {
|
||||
// SharedPrefsMgr.getInstance(context).putString(
|
||||
// SharedPrefsConstants.CAR_INFO, e.message.toString())
|
||||
e(
|
||||
SceneConstant.M_BINDING + TAG,
|
||||
"getBindingCarInfo onError e = " + e.toString() + "---e.getMessage = " + e.message
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.view.KeyEvent
|
||||
import com.mogo.commons.context.ContextHolderUtil
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.mofang.MfConstants
|
||||
import com.mogo.eagle.core.function.api.devatools.mofang.IMoGoMoFangListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendOperatorChangeLaneLeft
|
||||
@@ -46,7 +47,6 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
|
||||
private lateinit var mBluetoothAdapter: BluetoothAdapter
|
||||
private var isMfConnect: Boolean = false //添加状态判断
|
||||
|
||||
private val isShowToast = false //toast 控制,自测使用
|
||||
private var startPressTime: Long = 0 //开始按键时间
|
||||
private var isPressEnd = false //按键是否结束
|
||||
@Volatile
|
||||
@@ -171,23 +171,23 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
|
||||
startPressTime = System.currentTimeMillis()
|
||||
}
|
||||
e(M_F + "MoFangManager",
|
||||
"dispatchKeyEvent ------ bluetoothName = $bluetoothName ---code = $keyCode -----action = $action ")
|
||||
"dispatchKeyEvent ------ bluetoothName = $bluetoothName ---code = $keyCode -----action = $action ---HmiBuildConfig.isShowMfToastView = ${HmiBuildConfig.isShowMfToastView}")
|
||||
if (keyCode == KeyEvent.KEYCODE_A) { //单击 -1,长按无操作,AB组合-2
|
||||
if (action == KeyEvent.ACTION_DOWN) {
|
||||
pressADownTime = System.currentTimeMillis()
|
||||
d(M_F + "MoFangManager",
|
||||
"dispatchKeyEvent A down pressADownTime = " + pressADownTime + "---" + (pressADownTime - startPressTime) + "----isCombinationKey = " + isCombinationKey + "--pressBDownTime = " + pressBDownTime)
|
||||
if (pressADownTime - startPressTime in (clickTimeInterval + 1) until longPressTime && pressBDownTime > 0) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 A 按AB组合 +1 ")
|
||||
if (HmiBuildConfig.isShowMfToastView) {
|
||||
ToastUtils.showShort("方块 A 按AB组合 +1 timeInterval: ${pressADownTime - startPressTime}ms---$pressBDownTime")
|
||||
}
|
||||
sendAcc(true, +1.0)
|
||||
isCombinationKey = 3
|
||||
}
|
||||
if (isCombinationKey != 3 && isCombinationKey != 1) {
|
||||
if (pressADownTime - startPressTime > longPressTimeInterval) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 长按A -2 ")
|
||||
if (HmiBuildConfig.isShowMfToastView) {
|
||||
ToastUtils.showShort("方块 长按A -2 timeInterval: ${pressADownTime - startPressTime}ms")
|
||||
}
|
||||
sendAcc(true, -2.0)
|
||||
isCombinationKey = 2
|
||||
@@ -199,8 +199,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
|
||||
"dispatchKeyEvent A up pressAUpTime = " + pressAUpTime + "---" + (pressAUpTime - startPressTime) + "--pressBDownTime = " + pressBDownTime + "---isCombinationKey = $isCombinationKey")
|
||||
if (pressAUpTime - startPressTime < clickTime && isCombinationKey != 3) {
|
||||
isCombinationKey = 1
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 单击A -1 ")
|
||||
if (HmiBuildConfig.isShowMfToastView) {
|
||||
ToastUtils.showShort("方块 单击A -1 timeInterval: ${pressAUpTime - startPressTime}ms")
|
||||
}
|
||||
sendAcc(true, -1.0)
|
||||
}
|
||||
@@ -215,16 +215,16 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
|
||||
"dispatchKeyEvent B down pressBDownTime = " + pressBDownTime + "--差-" + (pressBDownTime - startPressTime) + "---isCombinationKey = " + isCombinationKey + "--pressADownTime = " + pressADownTime
|
||||
)
|
||||
if (pressBDownTime - startPressTime > clickTimeInterval && pressBDownTime - startPressTime < longPressTime && pressADownTime > 0) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 B 按AB组合 +1 ")
|
||||
if (HmiBuildConfig.isShowMfToastView) {
|
||||
ToastUtils.showShort("方块 B 按AB组合 +1 timeInterval: ${pressBDownTime - startPressTime}ms ---pressADownTime = $pressADownTime ")
|
||||
}
|
||||
sendAcc(true, +1.0)
|
||||
isCombinationKey = 3
|
||||
}
|
||||
if (isCombinationKey != 3 && isCombinationKey != 1) {
|
||||
if (pressBDownTime - startPressTime > longPressTimeInterval) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 长按B 无操作 ")
|
||||
if (HmiBuildConfig.isShowMfToastView) {
|
||||
ToastUtils.showShort("方块 长按B 无操作 timeInterval: ${pressBDownTime - startPressTime}ms")
|
||||
}
|
||||
isCombinationKey = 2
|
||||
}
|
||||
@@ -234,8 +234,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
|
||||
d(M_F + "MoFangManager",
|
||||
"dispatchKeyEvent B up pressBUpTime = " + pressBUpTime + "--差-" + (pressBUpTime - startPressTime) + "--pressADownTime = " + pressADownTime + "----isCombinationKey = $isCombinationKey")
|
||||
if (pressBUpTime - startPressTime < clickTime && isCombinationKey != 3) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 单击B 0 ")
|
||||
if (HmiBuildConfig.isShowMfToastView) {
|
||||
ToastUtils.showShort("方块 单击B 0 timeInterval: ${pressBUpTime - startPressTime}ms")
|
||||
}
|
||||
sendAcc(false, 0.0)
|
||||
isCombinationKey = 1
|
||||
@@ -250,8 +250,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
|
||||
d(M_F + "MoFangManager",
|
||||
"dispatchKeyEvent 方块 长按C 无操作 time dif = " + (pressCDownTime - startPressTime))
|
||||
if (pressCDownTime - startPressTime > longPressTimeInterval) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 长按C 无操作 ")
|
||||
if (HmiBuildConfig.isShowMfToastView) {
|
||||
ToastUtils.showShort("方块 长按C 无操作 timeInterval: ${pressCDownTime - startPressTime}ms")
|
||||
}
|
||||
}
|
||||
} else if (action == KeyEvent.ACTION_UP) {
|
||||
@@ -260,8 +260,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
|
||||
d(M_F + "MoFangManager",
|
||||
"dispatchKeyEvent 方块 单击C ← 向左变道 time dif = " + (pressCUpTime - startPressTime))
|
||||
if (pressCUpTime - startPressTime < clickTime) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 单击C ← 向左变道 ")
|
||||
if (HmiBuildConfig.isShowMfToastView) {
|
||||
ToastUtils.showShort("方块 单击C ← 向左变道 timeInterval: ${pressCUpTime - startPressTime}ms")
|
||||
}
|
||||
sendOperatorChangeLaneLeft()
|
||||
}
|
||||
@@ -272,8 +272,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
|
||||
d(M_F + "MoFangManager",
|
||||
"dispatchKeyEvent 方块 长按D 无操作 time dif = " + (pressDDownTime - startPressTime))
|
||||
if (pressDDownTime - startPressTime > longPressTimeInterval) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 长按D 无操作 ")
|
||||
if (HmiBuildConfig.isShowMfToastView) {
|
||||
ToastUtils.showShort("方块 长按D 无操作 timeInterval: ${pressDDownTime - startPressTime}ms")
|
||||
}
|
||||
}
|
||||
} else if (action == KeyEvent.ACTION_UP) {
|
||||
@@ -282,8 +282,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
|
||||
d(M_F + "MoFangManager",
|
||||
"dispatchKeyEvent 方块 单击D → 向右变道 time dif = " + (pressDUpTime - startPressTime))
|
||||
if (pressDUpTime - startPressTime < clickTime) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 单击D → 向右变道 ")
|
||||
if (HmiBuildConfig.isShowMfToastView) {
|
||||
ToastUtils.showShort("方块 单击D → 向右变道 timeInterval: ${pressDUpTime - startPressTime}ms")
|
||||
}
|
||||
sendOperatorChangeLaneRight()
|
||||
}
|
||||
@@ -294,8 +294,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
|
||||
d(M_F + "MoFangManager",
|
||||
"dispatchKeyEvent 方块 长按E 鸣笛 time dif = " + (pressEDownTime - startPressTime))
|
||||
if (pressEDownTime - startPressTime > longPressTimeInterval) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 长按E 鸣笛 ")
|
||||
if (HmiBuildConfig.isShowMfToastView) {
|
||||
ToastUtils.showShort("方块 长按E 鸣笛 timeInterval: ${pressEDownTime - startPressTime}ms")
|
||||
}
|
||||
sendOperatorSetHorn(1.0)
|
||||
if (timerHorn == null) {
|
||||
@@ -314,8 +314,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
|
||||
d(M_F + "MoFangManager",
|
||||
"方块 单击E 开启自动驾驶 time dif = " + (pressEUpTime - startPressTime))
|
||||
if (pressEUpTime - startPressTime < clickTime) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 单击E 开启自动驾驶 ")
|
||||
if (HmiBuildConfig.isShowMfToastView) {
|
||||
ToastUtils.showShort("方块 单击E 开启自动驾驶 timeInterval: ${pressEUpTime - startPressTime}ms")
|
||||
}
|
||||
startAutoPilot(getAutoPilotStatusInfo().autopilotControlParameters)
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ class SceneManager {
|
||||
}
|
||||
}
|
||||
//call back
|
||||
CallerDevaToolsListenerManager.invokeDevaToolsModuleLogChanges(sceneModuleTAG.map)
|
||||
// CallerDevaToolsListenerManager.invokeDevaToolsModuleLogChanges(sceneModuleTAG.map)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.zhjt.mogo_core_function_devatools.upgrade
|
||||
|
||||
import android.app.NotificationManager
|
||||
import android.content.Context
|
||||
import androidx.core.app.NotificationCompat
|
||||
import com.elegant.utils.UiThreadHandler
|
||||
import com.mogo.eagle.core.data.obu.MogoObuConst
|
||||
import com.mogo.eagle.core.function.api.devatools.IMogoDevaToolsUpgradeListener
|
||||
@@ -128,31 +126,20 @@ class UpgradeManager : IDownload {
|
||||
}
|
||||
|
||||
/**
|
||||
* 鹰眼app下载监听 liyz
|
||||
* 鹰眼app下载监听
|
||||
*/
|
||||
fun updateUpgradeProgress(context: Context) {
|
||||
val builder = NotificationCompat.Builder(context)
|
||||
// builder.setSmallIcon(R.mipmap.icon1001);//todo emArrow 更换图标,去除地图下载图标的依赖关系
|
||||
builder.setContentTitle("下载")
|
||||
builder.setContentText("正在下载")
|
||||
val manager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||
CallerDevaToolsUpgradeListenerManager.addListener(
|
||||
TAG,
|
||||
object : IMogoDevaToolsUpgradeListener {
|
||||
override fun onStart(url: String?) {}
|
||||
override fun onPause(url: String?) {}
|
||||
override fun onProgress(url: String?, length: Int) {
|
||||
builder.setProgress(100, length, false)
|
||||
manager.notify(0x3, builder.build())
|
||||
//下载进度提示
|
||||
builder.setContentText("已下载$length%")
|
||||
updateStatusBarDownloadView(true, "download", length)
|
||||
}
|
||||
|
||||
override fun onFinished(url: String?) {
|
||||
builder.setContentText("已下载" + 100 + "%")
|
||||
UiThreadHandler.postDelayed({
|
||||
manager.cancel(0x3)
|
||||
updateStatusBarDownloadView(false, "download", 100)
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user