[672][app][device]升级build gradle版本到3.5.4用于兼容Android11 manifest <queries>标签;添加硬件管理模块用于管理车载已硬件:新老核销、语音模块等;OCH核销依赖下沉;

This commit is contained in:
xinfengkun
2024-11-19 10:32:56 +08:00
parent 2b3e3a2cf7
commit 2531d8f4f2
23 changed files with 750 additions and 78 deletions

View File

@@ -61,6 +61,7 @@ dependencies {
implementation project(':libraries:mogo-obu')
implementation project(':libraries:mogo-adas')
implementation project(':libraries:mogo-hardware-devices')
implementation rootProject.ext.dependencies.mogoaicloudtelematic
compileOnly project(':core:function-impl:mogo-core-function-map')
implementation project(':core:mogo-core-function-call')

View File

@@ -4,20 +4,20 @@ import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.function.api.datacenter.IDataCenterProvider
import com.mogo.eagle.core.function.call.datacenter.CallerDataCenterBizListener
import com.mogo.eagle.core.function.call.datacenter.CallerDataCenterBizManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.datacenter.location.MoGoLocationDispatcher
import com.mogo.eagle.core.function.datacenter.v2x.SpeedLimitDispatcher
import com.mogo.eagle.core.function.datacenter.v2x.TrafficLightDispatcher
import com.mogo.eagle.core.function.datacenter.iot.IotInItManager
@Route(path = MogoServicePaths.PATH_DATA_CENTER_MODULE)
class DataCenterProvider: IDataCenterProvider {
class DataCenterProvider : IDataCenterProvider {
override val functionName: String
get() = "DataCenterProvider"
private var mContext:Context? = null
private var mContext: Context? = null
override fun init(context: Context?) {
MoGoLocationDispatcher.initListener()
@@ -27,6 +27,7 @@ class DataCenterProvider: IDataCenterProvider {
CallerMsgBoxManager.queryAllMessages(it)
TrafficLightDispatcher.INSTANCE.initServer(it)
SpeedLimitDispatcher.INSTANCE.initLimit(it)
IotInItManager.init()
}
}

View File

@@ -0,0 +1,28 @@
package com.mogo.eagle.core.function.datacenter.iot
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.storage.SharedPrefsMgr
import com.mogo.eagle.core.function.api.cloud.IMoGoCloudListener
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
import com.mogo.support.device.DevicesManager
object IotInItManager : IMoGoCloudListener {
private const val TAG = "IotInIt"
fun init() {
CallerCloudListenerManager.addListener(TAG, this)
hardwareDeviceBind(SharedPrefsMgr.getInstance().sn)
}
override fun tokenGot(token: String, sn: String) {
super.tokenGot(token, sn)
hardwareDeviceBind(sn)
}
private fun hardwareDeviceBind(sn: String) {
if (sn.isNotEmpty()) {
DevicesManager.init(AbsMogoApplication.getApp(), sn)
}
}
}

View File

@@ -81,6 +81,8 @@ dependencies {
implementation rootProject.ext.dependencies.preference_ktx
implementation rootProject.ext.dependencies.amapsearch
// 硬件管理
compileOnly project(":libraries:mogo-hardware-devices")
implementation rootProject.ext.dependencies.thread_opt
api project(':test:crashreport-apmbyte')
compileOnly project(':core:function-impl:mogo-core-function-datacenter')

View File

@@ -19,6 +19,7 @@ import android.view.ViewGroup
import android.widget.BaseAdapter
import android.widget.TextView
import androidx.annotation.RequiresApi
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.widget.ListPopupWindow
import androidx.appcompat.widget.PopupMenu
import androidx.constraintlayout.widget.ConstraintLayout
@@ -132,6 +133,8 @@ import com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_CROSS
import com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_TOP
import com.mogo.map.uicontroller.VisualAngleMode.MODE_LONG_SIGHT
import com.mogo.tts.base.IMogoTTSCallback
import com.mogo.support.device.DevicesManager
import com.mogo.support.device.IBindStateChangeListener
import com.zhjt.mogo.adas.data.AdasConstants
import com.zhjt.service.chain.ChainLog
import kotlinx.android.synthetic.main.view_debug_setting.view.appVersionInfoLayout
@@ -272,6 +275,7 @@ import kotlinx.android.synthetic.main.view_debug_setting.view.tvDriverServerStar
import kotlinx.android.synthetic.main.view_debug_setting.view.tvGearInfo
import kotlinx.android.synthetic.main.view_debug_setting.view.tvGitBranchInfo
import kotlinx.android.synthetic.main.view_debug_setting.view.tvHDCityCode
import kotlinx.android.synthetic.main.view_debug_setting.view.tvHardwareDeviceBindState
import kotlinx.android.synthetic.main.view_debug_setting.view.tvIPCMac
import kotlinx.android.synthetic.main.view_debug_setting.view.tvIdentifyInfo
import kotlinx.android.synthetic.main.view_debug_setting.view.tvIdentifyInfoCopy
@@ -351,7 +355,7 @@ internal class DebugSettingView @JvmOverloads constructor(
IMoGoChassisStatesListener,
IMoGoSweeperFutianCleanSystemListener,
IMoGoObuInfoListener,
ISopSettingListener, IViewControlListener, IMoGoCloudListener {
ISopSettingListener, IViewControlListener, IMoGoCloudListener, IBindStateChangeListener {
companion object {
private const val TAG = "DebugSettingView"
@@ -474,6 +478,7 @@ internal class DebugSettingView @JvmOverloads constructor(
}
CallerObuInfoListenerManager.addListener(TAG, this)
DevicesManager.addBindStateChangeListener(TAG,this)
}
override fun onDetachedFromWindow() {
@@ -503,7 +508,7 @@ internal class DebugSettingView @JvmOverloads constructor(
CallerSopSettingManager.removeListener(TAG)
CallerHmiViewControlListenerManager.removeListener(TAG)
DevicesManager.removeBindStateChangeListener(TAG)
// 移除 业务配置监听
CallerDevaToolsFuncConfigListenerManager.unRegisterDevaToolsFuncConfigListener(
FuncBizConfig.FOUNDATION,
@@ -1323,6 +1328,40 @@ internal class DebugSettingView @JvmOverloads constructor(
}
CallerHmiManager.toggleHdMapVisualAngleAdjust(isChecked)
}
//硬件服务绑定状态以及版本
tvHardwareDeviceBindState.setOnClickListener {
val state = when (DevicesManager.getServiceBindState()) {
0 -> {
"绑定成功"
}
1 -> {
"绑定失败未安装“硬件服务”APP"
}
2 -> {
"绑定失败:没有绑定权限或找不到服务"
}
3 -> {
"服务被异常销毁"
}
else -> {
"未知"
}
}
var msg = "客户端SDK版本${DevicesManager.getSDKVersion() ?: "未知"}\n"
msg += "客户端SDK AIDL版本${DevicesManager.getSDKAIDLVersion() ?: "未知"}\n"
msg += "硬件服务端APP版本${DevicesManager.getServerVersion() ?: "未知"}\n"
msg += "硬件服务端APP AIDL版本${DevicesManager.getServerAIDLVersion() ?: ""}"
AlertDialog.Builder(context)
.setTitle("硬件服务绑定状态: $state")
.setMessage(msg)
.setPositiveButton("确定", null)
.create().show()
}
}
/**
@@ -2707,4 +2746,31 @@ internal class DebugSettingView @JvmOverloads constructor(
private fun invokeCronetResult(json: String) {
CallerLogger.d(SceneConstant.M_HMI + "CronetNetwork", json)
}
override fun onServiceState(state: Int) {
val stateMsg = when (state) {
0 -> {
"绑定成功"
}
1 -> {
"绑定失败未安装“硬件服务”APP"
}
2 -> {
"绑定失败:没有绑定权限或找不到服务"
}
3 -> {
"服务被异常销毁"
}
else -> {
"未知"
}
}
UiThreadHandler.post {
tvHardwareDeviceBindState.text = "硬件服务绑定状态: $stateMsg"
}
}
}

View File

@@ -681,6 +681,23 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0" />
<TextView
android:id="@+id/tvHardwareDeviceBindState"
style="@style/DebugSettingText"
android:text="硬件服务绑定状态: 未知"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0" />
<TextView
android:id="@+id/tvBackgroundOperation"
style="@style/DebugSettingText"