[6.6.0] union deviceUtil check and fix bug, close the multi device
This commit is contained in:
@@ -51,7 +51,7 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
|
||||
mapBizView = findViewById(R.id.mapBizView);
|
||||
videoSwitch = findViewById(R.id.video_switch_iv);
|
||||
romaPView = findViewById(R.id.romaPView);
|
||||
if(DeviceUtils.isLenovoModel() || DeviceUtils.isEB5Model()){
|
||||
if(DeviceUtils.isLeOrEb5Model()){
|
||||
romaPView.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
romaPView.setVisibility(View.GONE);
|
||||
|
||||
@@ -118,7 +118,7 @@ class TaxiPassengerBaseFragment() :
|
||||
mapBizView.visibility = View.VISIBLE
|
||||
presenter?.setItineraryVisibility()
|
||||
speedView.visibility = View.VISIBLE
|
||||
if (DeviceUtils.isLenovoModel() || DeviceUtils.isEB5Model()) {
|
||||
if (DeviceUtils.isLeOrEb5Model()) {
|
||||
romaPView.updateVisible(true)
|
||||
romaDistanceView.visibility = View.VISIBLE
|
||||
} else {
|
||||
|
||||
@@ -137,7 +137,7 @@ class TaxiPassengerBaseFragment() :
|
||||
mapBizView.visibility = View.VISIBLE
|
||||
presenter?.setItineraryVisibility()
|
||||
speedView.visibility = View.VISIBLE
|
||||
if (DeviceUtils.isLenovoModel() || DeviceUtils.isEB5Model()) {
|
||||
if (DeviceUtils.isLeOrEb5Model()) {
|
||||
romaPView.updateVisible(true)
|
||||
romaDistanceView.visibility = View.VISIBLE
|
||||
} else {
|
||||
|
||||
@@ -60,13 +60,13 @@ object ConfigStartUp {
|
||||
FunctionBuildConfig.isSupportPatchUpgrade = BuildConfig.IS_SUPPORT_PATCH_UPGRADE
|
||||
|
||||
// app安装的身份信息
|
||||
// FunctionBuildConfig.appIdentityMode = "Product_${BuildConfig.APP_IDENTITY_MODE_BODY}_${BuildConfig.APP_IDENTITY_MODE_TAIL}"
|
||||
// // 这里影响当前Activity的身份信息,多进程,主进程为乘客端,:passenger 进程为司机端 TODO 暂时不启用,仅测试3588,在B2 2024车预研
|
||||
// 这里影响当前Activity的身份信息,多进程,主进程为司机端,:passenger 进程为乘客端
|
||||
// TODO emArrow isMultiDisplay暂时不启用,仅测试3588,在B2 2024车预研
|
||||
if (DebugConfig.isMultiDisplay()) {
|
||||
if(ProcessUtils.getCurrentProcessName().contains(":passenger")){
|
||||
FunctionBuildConfig.appIdentityMode = "Product_Driver_${BuildConfig.APP_IDENTITY_MODE_TAIL}"
|
||||
}else{
|
||||
FunctionBuildConfig.appIdentityMode = "Product_Passenger_${BuildConfig.APP_IDENTITY_MODE_TAIL}"
|
||||
}else{
|
||||
FunctionBuildConfig.appIdentityMode = "Product_Driver_${BuildConfig.APP_IDENTITY_MODE_TAIL}"
|
||||
}
|
||||
}else{
|
||||
FunctionBuildConfig.appIdentityMode = "Product_${BuildConfig.APP_IDENTITY_MODE_BODY}_${BuildConfig.APP_IDENTITY_MODE_TAIL}"
|
||||
|
||||
@@ -131,8 +131,7 @@ class FuncBizProvider : IMoGoFuncBizProvider {
|
||||
PassBusStationEventManager.unInit()
|
||||
VipCarManager.INSTANCE.destroy()
|
||||
|
||||
if(!(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode))){
|
||||
if(V2NCarTypeCheck.verifyCarType()){
|
||||
V2XEventManager.onDestroy()
|
||||
}
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
|
||||
@@ -46,6 +46,7 @@ import com.mogo.eagle.core.function.datacenter.autopilot.telematic.TeleMsgHandle
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_D_C
|
||||
import com.mogo.eagle.core.utilcode.util.DeviceUtils
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ParseVersionUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
@@ -191,7 +192,7 @@ class MoGoAutopilotControlProvider :
|
||||
} else {
|
||||
NSDNettyManager.getInstance()
|
||||
.searchAndConnectServer(context, SharedPrefsMgr.getInstance().sn,
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode),
|
||||
DeviceUtils.isLeOrEb5Model(),
|
||||
object : NettyClientListener<MogoProtocolMsg> {
|
||||
override fun onMessageResponseClient(
|
||||
msg: MogoProtocolMsg?,
|
||||
|
||||
@@ -323,7 +323,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
}
|
||||
|
||||
//todo 新增稳定设备类型需要添加,目的避免在nuc设备上使用此类功能
|
||||
private val limit = DeviceUtils.isLenovoModel() || DeviceUtils.isEB5Model()
|
||||
private val limit = DeviceUtils.isLeOrEb5Model()
|
||||
override fun onPointCloud(header: MessagePad.Header, pointCloud: ByteArray?) {
|
||||
if (limit) {
|
||||
//点云数据透传
|
||||
|
||||
@@ -14,6 +14,8 @@ import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.EnvConfig
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig.isShowRouteStrategy
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.ModifyBindingcarInfo
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
@@ -36,6 +38,7 @@ import com.mogo.eagle.core.function.api.map.route.IMapRouteProvider
|
||||
import com.mogo.eagle.core.function.api.upgrade.IMoGoUpgradeProvider
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.lifeCycleScope
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.w
|
||||
import com.mogo.eagle.core.utilcode.util.AppStateManager
|
||||
@@ -296,6 +299,7 @@ class DevaToolsProvider : IDevaToolsProvider, IAppStateListener {
|
||||
* AppIdentityModeUtils.getMisChannelCode
|
||||
*/
|
||||
override fun updateAppChannel() {
|
||||
isShowRouteStrategy = !AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
bizConfigCenter.updateChannelRole() //功能开关配置更新
|
||||
traceManager.syncConfig() //同步信息至ms
|
||||
BindingCarManager.queryAppUpgrade() //更新App升级信息
|
||||
|
||||
@@ -37,7 +37,7 @@ class RomaPassengerView @JvmOverloads constructor(
|
||||
private var controlVisible = true
|
||||
|
||||
init {
|
||||
if(DeviceUtils.isLenovoModel() || DeviceUtils.isEB5Model()){
|
||||
if(DeviceUtils.isLeOrEb5Model()){
|
||||
LayoutInflater.from(context).inflate(R.layout.view_roma_passenger_bg, this, true)
|
||||
val a =
|
||||
context.obtainStyledAttributes(attrs, R.styleable.RomaPassengerView, defStyleAttr, 0)
|
||||
@@ -65,7 +65,7 @@ class RomaPassengerView @JvmOverloads constructor(
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
if(DeviceUtils.isLenovoModel() || DeviceUtils.isEB5Model()){
|
||||
if(DeviceUtils.isLeOrEb5Model()){
|
||||
CallerMapRomaListener.addListener(TAG, this)
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,7 @@ class RomaPassengerView @JvmOverloads constructor(
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
if(DeviceUtils.isLenovoModel() || DeviceUtils.isEB5Model()){
|
||||
if(DeviceUtils.isLeOrEb5Model()){
|
||||
CallerMapRomaListener.removeListener(TAG)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class MainLauncherActivity extends MainActivity {
|
||||
// 多进程方案
|
||||
CallerLogger.i(M_HMI + TAG, "MultiDisplayUtils startActWithSecond");
|
||||
// MultiDisplayUtils.INSTANCE.startActWithSecond(this, "com.mogo.launcher.passenger");
|
||||
MultiDisplayUtils.INSTANCE.startActWithSecond(this, PassengerLauncherActivity.class);
|
||||
// MultiDisplayUtils.INSTANCE.startActWithSecond(this, PassengerLauncherActivity.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -105,7 +105,7 @@ public class MainLauncherActivity extends MainActivity {
|
||||
} else {
|
||||
// 目前只有金旅星辰乘客屏是连接的双屏
|
||||
ochProvider = (IMoGoFunctionProvider) ARouter.getInstance()
|
||||
.build("/passenger/api")
|
||||
.build("/driver/api")
|
||||
.navigation(getContext());
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public class PassengerLauncherActivity extends MainActivity {
|
||||
*/
|
||||
private void loadOCHModule() {
|
||||
IMoGoFunctionProvider ochProvider = (IMoGoFunctionProvider) ARouter.getInstance()
|
||||
.build("/driver/api")
|
||||
.build("/passenger/api")
|
||||
.navigation(getContext());
|
||||
if (ochProvider != null) {
|
||||
ochProvider.createCoverage(this, R.id.module_main_id_och_fragment);
|
||||
|
||||
@@ -35,7 +35,7 @@ class MapBizProvider :IMoGoFunctionServerProvider, IMogoRoma {
|
||||
MapPointCloudSubscriber.instance
|
||||
SpeedLimitDataManager.getInstance().start()
|
||||
RoadCrossCameraManager.instance.init(context)
|
||||
if(DeviceUtils.isLenovoModel() || DeviceUtils.isEB5Model()){ //todo 新增稳定设备类型需要添加,目的避免在nuc设备上使用此类功能
|
||||
if(DeviceUtils.isLeOrEb5Model()){ //todo 新增稳定设备类型需要添加,目的避免在nuc设备上使用此类功能
|
||||
romaManager.init()
|
||||
aiCloudIdentifyDataManager.initServer(AbsMogoApplication.getApp())
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener, IMoGoAutopilotCarConf
|
||||
private var identify: Identify? = null
|
||||
private var aiCloudIdentify: Identify? = null
|
||||
private var startTime: Long = 0L
|
||||
private var dockerVersion: String? = null
|
||||
|
||||
fun initType() {
|
||||
drawType("默认开启感知优化,等待docker版本")
|
||||
@@ -50,24 +51,7 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener, IMoGoAutopilotCarConf
|
||||
}
|
||||
|
||||
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
|
||||
val dockerVersion = carConfigResp.dockVersion
|
||||
if (dockerVersion != null && dockerVersion.isNotEmpty()) {
|
||||
try {
|
||||
val version = ParseVersionUtils.parseVersion(true, dockerVersion)
|
||||
identify = if (version >= 30100 && isT1T2(FunctionBuildConfig.appIdentityMode)) {
|
||||
FunctionBuildConfig.isBeautyMode = false
|
||||
drawType("关闭感知优化模式")
|
||||
DriverIdentify.originDataDrawer
|
||||
} else {
|
||||
FunctionBuildConfig.isBeautyMode = true
|
||||
drawType("开启感知优化模式")
|
||||
UserIdentify.beautifyDataDrawer
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
drawType("解析docker异常:$dockerVersion")
|
||||
identify = UserIdentify.beautifyDataDrawer
|
||||
}
|
||||
}
|
||||
dockerVersion = carConfigResp.dockVersion
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
@@ -93,6 +77,29 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener, IMoGoAutopilotCarConf
|
||||
object : Handler(WorkThreadHandler.newInstance("IdentifyFactoryDrawer").looper) {
|
||||
override fun handleMessage(msg: Message) {
|
||||
super.handleMessage(msg)
|
||||
|
||||
if(identify == null){
|
||||
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
|
||||
}
|
||||
}else{
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if (!FunctionBuildConfig.isBeautyMode) {
|
||||
// 非感知美化优化模式,清除旧数据,使用 DriverIdentify originDataDrawer 原始数据绘制
|
||||
if (identify is IdentifyBeautifyDataDrawer) {
|
||||
@@ -108,6 +115,7 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener, IMoGoAutopilotCarConf
|
||||
identify = UserIdentify.beautifyDataDrawer
|
||||
}
|
||||
}
|
||||
|
||||
when (msg.what) {
|
||||
MSG_CHECK -> {
|
||||
if(startTime == 0L){
|
||||
|
||||
@@ -152,7 +152,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>(), IMoGoCloudListener {
|
||||
// 设置车机设备的唯一标识(这些表识必须是通过后台录入的设备)
|
||||
// TODO 现在这块逻辑因为网约车业务那后台的限制,还没有更换,条件成熟后替换为 DeviceIdUtils.getWidevineIDWithMd5(context)
|
||||
// 这里影响当前Activity的身份信息,多进程先保持与原来一样,主进程为司机端,:passenger 进程为乘客端
|
||||
if (ProcessUtils.getCurrentProcessName().contains(":passenger")) { //todo emArrow passenger需要放到下面,司乘互换
|
||||
if (ProcessUtils.getCurrentProcessName().contains(":passenger")) {
|
||||
clientConfig.thirdPartyDeviceId = DeviceUtils.getDeviceSN() + "_passenger"
|
||||
} else {
|
||||
clientConfig.thirdPartyDeviceId = DeviceUtils.getDeviceSN()
|
||||
|
||||
@@ -312,6 +312,10 @@ public final class DeviceUtils {
|
||||
return Build.MANUFACTURER;
|
||||
}
|
||||
|
||||
public static Boolean isLeOrEb5Model() {
|
||||
return isLenovoModel() || isEB5Model();
|
||||
}
|
||||
|
||||
public static Boolean isLenovoModel() {
|
||||
return getModel().contains("Lenovo") || getBrand().contains("Lenovo");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user