From c5c330821fe663d4e0751c5e88cb49fcdde0f4aa Mon Sep 17 00:00:00 2001 From: zhongchao Date: Tue, 27 Jun 2023 16:03:51 +0800 Subject: [PATCH] [3.3.0] fix SpeedLimit call back in main thread --- .../core/function/business/SpeedLimitDataManager.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/SpeedLimitDataManager.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/SpeedLimitDataManager.java index 8f02b7a311..4b3b941056 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/SpeedLimitDataManager.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/SpeedLimitDataManager.java @@ -4,13 +4,10 @@ import androidx.annotation.Nullable; import com.mogo.eagle.core.data.enums.DataSourceType; import com.mogo.eagle.core.data.map.MogoLocation; -import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener; -import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager; import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager; -import com.mogo.eagle.core.utilcode.util.UiThreadHandler; import java.util.Objects; import java.util.Timer; @@ -58,11 +55,9 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationWGS84Listener private void getSpeedLimit() { int speedLimit = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), (float) mLocation.getHeading()); - UiThreadHandler.post(() -> { - if (speedLimit > 0) { - CallerLimitingVelocityListenerManager.INSTANCE.invokeUnion(speedLimit, DataSourceType.MAP); - } - }); + if (speedLimit > 0) { + CallerLimitingVelocityListenerManager.INSTANCE.invokeUnion(speedLimit, DataSourceType.MAP); + } } }