From 982139a078d2824caef7f0ebcb72285af657a2c0 Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Tue, 16 May 2023 18:36:37 +0800 Subject: [PATCH 1/4] =?UTF-8?q?[dev=5Fminibus-d=5F230425=5F3.2.0]=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BA=A2=E7=BB=BF=E7=81=AF=E9=97=AA=E7=83=81?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BC=98=E5=8C=96=E7=BA=A2=E7=BB=BF?= =?UTF-8?q?=E7=81=AF=E8=AF=BB=E7=A7=92=E4=B8=89=E4=BD=8D=E6=95=B0=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E5=85=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/MogoTrafficLightManager.kt | 2 +- .../datacenter/v2x/TrafficLightDispatcher.kt | 18 +++++++++++++++--- .../src/main/res/values/dimens.xml | 2 +- .../union/IMoGoTrafficLightListener.kt | 5 +++++ .../v2x/CallerTrafficLightListenerManager.kt | 15 ++++++++++++--- 5 files changed, 34 insertions(+), 8 deletions(-) diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/trafficlight/core/MogoTrafficLightManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/trafficlight/core/MogoTrafficLightManager.kt index e88b3ed963..50eb5490b2 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/trafficlight/core/MogoTrafficLightManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/trafficlight/core/MogoTrafficLightManager.kt @@ -13,6 +13,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02Lis import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_LOOP_SEARCH_CROSS_ROAD import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_LOOP_SEARCH_TRAFFIC_LIGHT @@ -100,7 +101,6 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener { } CallerTrafficLightListenerManager.resetTrafficLightStatus() CallerTrafficLightListenerManager.invokeTrafficRequestError() - }) } }, { diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/TrafficLightDispatcher.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/TrafficLightDispatcher.kt index 58a7bd1214..953c4be308 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/TrafficLightDispatcher.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/TrafficLightDispatcher.kt @@ -51,7 +51,6 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight val INSTANCE: TrafficLightDispatcher by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) { TrafficLightDispatcher() } - } private var mContext: Context? = null @@ -156,7 +155,20 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight hide() } + /** + * 是否重置红绿灯数据,需要确保,在obu的红绿灯显示的时候,不执行。否则会闪屏 + */ + override fun resetTrafficLight(isReset: Boolean) { + CallerLogger.d("${SceneConstant.M_OBU}${TAG}", "resetTrafficLight ------> isReset = $isReset ") + if (!hasObuLightStatus) { + if(isReset){ + hide() + } + } + } + private fun hide(){ + CallerLogger.d("${SceneConstant.M_OBU}${TAG}", "hide() -------> ") CallerTrafficLightListenerManager.disableTrafficLight() if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { CallerTelematicManager.sendMsgToAllClients(TelematicConstant.HIDE_TRAFFIC_LIGHT, "0".toByteArray()) @@ -172,7 +184,7 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight lightSource: DataSourceType ) { super.onTrafficLightPlusSource(light, remain, lightSource) - CallerLogger.d("${SceneConstant.M_OBU}${TAG}", "onTrafficLightPlusSource ----- light = $light ---remain = $remain ---lightSource = $lightSource") +// CallerLogger.d("${SceneConstant.M_OBU}${TAG}", "onTrafficLightPlusSource ----- light = $light ---remain = $remain ---lightSource = $lightSource") if (lightSource == DataSourceType.OBU) { hasObuLightStatus = true } @@ -213,9 +225,9 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight } onTrafficLightPlusSource(it.convert(), remain, DataSourceType.AICLOUD) } - } + fun destroy() { //取消注册监听AI云.OBU,路侧获取红绿灯状态 CallerTrafficLightListenerManager.removeListener(TAG) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/dimens.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/dimens.xml index c8e191641e..036c0ac988 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/dimens.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/dimens.xml @@ -64,7 +64,7 @@ 15dp 17dp 154dp - 71dp + 110dp 60dp 32dp diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/union/IMoGoTrafficLightListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/union/IMoGoTrafficLightListener.kt index a103cce6a6..13491090cd 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/union/IMoGoTrafficLightListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/union/IMoGoTrafficLightListener.kt @@ -18,6 +18,11 @@ interface IMoGoTrafficLightListener { } + /** + * 是否重置 + */ + fun resetTrafficLight(isReset: Boolean) {} + /** * 云端红绿灯接口请求失败 */ diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerTrafficLightListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerTrafficLightListenerManager.kt index 2d7e13ef71..2e23552406 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerTrafficLightListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerTrafficLightListenerManager.kt @@ -5,6 +5,8 @@ import com.mogo.eagle.core.data.enums.TrafficLightEnum import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener import com.mogo.eagle.core.function.call.base.CallerBase +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant object CallerTrafficLightListenerManager : CallerBase() { @@ -57,10 +59,17 @@ object CallerTrafficLightListenerManager : CallerBase */ fun resetTrafficLightStatus(hideTrafficLight:Boolean = true) { trafficLightResult = null - // 隐藏traffic light - if(hideTrafficLight){ - disableTrafficLight() +// // 隐藏traffic light +// if(hideTrafficLight){ +// CallerLogger.d("${SceneConstant.M_OBU}${"TrafficLightDispatcher"}", "resetTrafficLightStatus ------> hideTrafficLight = $hideTrafficLight ") +// disableTrafficLight() +// } + + M_LISTENERS.forEach { + val listener = it.value + listener.resetTrafficLight(hideTrafficLight) } + } fun showTrafficLight(checkLightId: TrafficLightEnum, lightSource: DataSourceType) { From c6737617f7cffcbb28eeec0bafb6b8904d1cdd82 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Tue, 16 May 2023 18:47:29 +0800 Subject: [PATCH 2/4] [3.2.0] add func of trafficlight support daylightmode and fix passport sn and token get problem --- .../res/layout/bus_p_base_fragment.xml | 2 +- .../res/layout/bus_p_base_fragment.xml | 2 +- .../hmi/ui/widget/SingleTrafficLightView.kt | 26 ++++++++++++++++++- .../drawable/traffic_light_bg_day_light.xml | 7 +++++ .../res/layout/hmi_view_traffic_light.xml | 3 --- .../src/main/res/values/color.xml | 1 + gradle.properties | 18 ++++++------- 7 files changed, 44 insertions(+), 15 deletions(-) create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/res/drawable/traffic_light_bg_day_light.xml diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_base_fragment.xml b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_base_fragment.xml index 5f48333a3d..7354a3d725 100644 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_base_fragment.xml +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_base_fragment.xml @@ -52,7 +52,7 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> - - { + hmi_traffic_light_bg.setBackgroundResource(R.drawable.traffic_light_bg) + hmi_traffic_light_source.setTextColor(resources.getColor(R.color.color_FFFFFF)) + hmi_traffic_light_divider.setBackgroundColor(resources.getColor(R.color.color_FFFFFF)) + } + 1 -> { + hmi_traffic_light_bg.setBackgroundResource(R.drawable.traffic_light_bg_day_light) + hmi_traffic_light_source.setTextColor(resources.getColor(R.color.color_2D3E5F)) + hmi_traffic_light_divider.setBackgroundColor(resources.getColor(R.color.color_2D3E5F)) + } + } + } + } + /** * 展示红绿灯预警 * diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/traffic_light_bg_day_light.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/traffic_light_bg_day_light.xml new file mode 100644 index 0000000000..574797906a --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/traffic_light_bg_day_light.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_view_traffic_light.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_view_traffic_light.xml index f49e4c473d..cd31442233 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_view_traffic_light.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_view_traffic_light.xml @@ -12,7 +12,6 @@ android:layout_height="@dimen/hmi_traffic_light_bg_height" android:layout_marginStart="@dimen/hmi_traffic_light_bg_margin_left" android:layout_marginTop="@dimen/hmi_traffic_light_bg_margin_top" - android:background="@drawable/traffic_light_bg" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -41,7 +40,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" tools:text="自车感知" - android:textColor="@color/color_FFFFFF" android:textSize="@dimen/hmi_traffic_light_source_size" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" @@ -53,7 +51,6 @@ android:id="@+id/hmi_traffic_light_divider" android:layout_width="@dimen/dp_1" android:layout_height="@dimen/dp_47" - android:background="@color/color_FFFFFF" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintRight_toLeftOf="@id/hmi_traffic_light_source" diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml index ff8c61e6bf..72ea2d92b5 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml @@ -21,6 +21,7 @@ #0099dd #FFFFFF #2C2E30 + #2D3E5F #D4D8DC #27FFFFFF #1E111111 diff --git a/gradle.properties b/gradle.properties index 4665e5d4c0..4ae3edb87c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -66,23 +66,23 @@ SERVICE_BIZ_VERSION=1.2.4 LOGLIB_VERSION=1.5.27 ######## MogoAiCloudSDK Version ######## # 网络请求LOGLIB_VERSION -MOGO_NETWORK_VERSION=1.4.6.7 +MOGO_NETWORK_VERSION=1.4.6.8 # 鉴权 -MOGO_PASSPORT_VERSION=1.4.6.7 +MOGO_PASSPORT_VERSION=1.4.6.8 # 常链接 -MOGO_SOCKET_VERSION=1.4.6.7 +MOGO_SOCKET_VERSION=1.4.6.8 # 数据采集 -MOGO_REALTIME_VERSION=1.4.6.7 +MOGO_REALTIME_VERSION=1.4.6.8 # 探路,道路事件发布,获取 -MOGO_TANLU_VERSION=1.4.6.7 +MOGO_TANLU_VERSION=1.4.6.8 # 直播推流 -MOGO_LIVE_VERSION=1.4.6.7 +MOGO_LIVE_VERSION=1.4.6.8 # 直播拉流 -MOGO_TRAFFICLIVE_VERSION=1.4.6.7 +MOGO_TRAFFICLIVE_VERSION=1.4.6.8 # 定位服务 -MOGO_LOCATION_VERSION=1.4.6.7 +MOGO_LOCATION_VERSION=1.4.6.8 # 远程通讯模块 -MOGO_TELEMATIC_VERSION=1.4.6.7 +MOGO_TELEMATIC_VERSION=1.4.6.8 ######## MogoAiCloudSDK Version ######## # 自研地图 MAP_SDK_VERSION=2.12.1.1 From b094b421bd8c9cbaab8bc77af35c1ab9878c2e7a Mon Sep 17 00:00:00 2001 From: zhongchao Date: Tue, 16 May 2023 18:54:55 +0800 Subject: [PATCH 3/4] [3.2.0] remove unuse code --- .../call/v2x/CallerTrafficLightListenerManager.kt | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerTrafficLightListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerTrafficLightListenerManager.kt index 2e23552406..b795e482a8 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerTrafficLightListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerTrafficLightListenerManager.kt @@ -5,8 +5,6 @@ import com.mogo.eagle.core.data.enums.TrafficLightEnum import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener import com.mogo.eagle.core.function.call.base.CallerBase -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger -import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant object CallerTrafficLightListenerManager : CallerBase() { @@ -19,7 +17,7 @@ object CallerTrafficLightListenerManager : CallerBase } fun invokeTrafficLightStatus(trafficLightResult: TrafficLightResult) { - CallerTrafficLightListenerManager.trafficLightResult = trafficLightResult + this.trafficLightResult = trafficLightResult M_LISTENERS.forEach { val listener = it.value listener.onTrafficLightStatus(trafficLightResult) @@ -59,12 +57,6 @@ object CallerTrafficLightListenerManager : CallerBase */ fun resetTrafficLightStatus(hideTrafficLight:Boolean = true) { trafficLightResult = null -// // 隐藏traffic light -// if(hideTrafficLight){ -// CallerLogger.d("${SceneConstant.M_OBU}${"TrafficLightDispatcher"}", "resetTrafficLightStatus ------> hideTrafficLight = $hideTrafficLight ") -// disableTrafficLight() -// } - M_LISTENERS.forEach { val listener = it.value listener.resetTrafficLight(hideTrafficLight) From dbc751400d1cdfa4a99f7f964686ecb5ba7a00a4 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Tue, 16 May 2023 19:58:01 +0800 Subject: [PATCH 4/4] [3.2.0]fix bug of multi process cause the exception --- .../mogo/eagle/core/function/main/MainMoGoApplication.java | 6 ------ .../src/main/java/com/mogo/commons/mvp/MvpActivity.java | 6 +++++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java index 26370c9ed6..22ffa6de73 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java @@ -48,12 +48,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication { CallerDevaToolsManager.INSTANCE.updateUpgradeProgress(); } - @Override - protected boolean shouldInit() { - CallerLogger.INSTANCE.w(M_HMI + TAG, "evaluate shouldInit() with: " + ProcessUtils.getProcessName(Process.myPid())); - return true; - } - /** * 初始化异常采集配置 */ diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/mvp/MvpActivity.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/mvp/MvpActivity.java index 1adc5be2fb..ef25e2967e 100644 --- a/foudations/mogo-commons/src/main/java/com/mogo/commons/mvp/MvpActivity.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/mvp/MvpActivity.java @@ -12,6 +12,7 @@ import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import com.mogo.eagle.core.utilcode.util.BarUtils; +import com.mogo.eagle.core.utilcode.util.ProcessUtils; import com.mogo.eagle.core.utilcode.util.SoftKeyBoardJobber; import me.jessyan.autosize.AutoSizeCompat; @@ -34,6 +35,9 @@ public abstract class MvpActivity> exten getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); super.onCreate(savedInstanceState); + if (!ProcessUtils.isMainProcess(this)) { + return; + } setContentView(getLayoutId()); initViews(); mPresenter = createPresenter(); @@ -112,7 +116,7 @@ public abstract class MvpActivity> exten @Override public Resources getResources() { - if ( Looper.myLooper() == Looper.getMainLooper()) { + if (Looper.myLooper() == Looper.getMainLooper()) { AutoSizeCompat.autoConvertDensityOfGlobal(super.getResources()); } return super.getResources();