[2.13.0-arch-opt] merge
This commit is contained in:
@@ -125,15 +125,6 @@
|
||||
android:name="MAP_SDK_VERSION111111"
|
||||
android:value="${MAP_SDK_VERSION}" />
|
||||
|
||||
<service
|
||||
android:name="com.mogo.eagle.core.function.main.service.MogoMainService"
|
||||
android:enabled="true"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.mogo.launcher.action.MAIN_SERVICE" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<receiver android:name="com.mogo.eagle.core.function.hmi.receiver.V2XWarningBroadcastReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.hmi.v2x.notification" />
|
||||
|
||||
@@ -24,7 +24,7 @@ class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifec
|
||||
|
||||
private val statusChangedListenerForCheckNotice =
|
||||
IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND) {
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifecycle
|
||||
private var cancelTv: TextView? = null
|
||||
|
||||
private val statusChangedListenerForCheckNotice = IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND) {
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
private var playErrorImageView: ImageView? = null
|
||||
private var connectTextView: TextView? = null
|
||||
private val statusChangedListenerForCheckNotice = IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND) {
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -443,7 +443,7 @@ public class NoticeTrafficDialog extends BaseFloatDialog implements LifecycleObs
|
||||
}
|
||||
|
||||
private final IMogoStatusChangedListener statusChangedListenerForNotice = (descriptor, isTrue) -> {
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND) {
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onStatusChanged==MAIN_PAGE_IS_BACKGROUND");
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.content.ClipboardManager
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.os.Build
|
||||
import android.telecom.Call
|
||||
import android.text.Html
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
@@ -73,7 +74,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.map.MogoMapUIController
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.*
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.*
|
||||
@@ -279,7 +279,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
btnOpenAllGestures.setOnClickListener {
|
||||
MogoMapUIController.getInstance().setAllGesturesEnabled(true)
|
||||
CallerMapUIServiceManager.getMapUIController()?.setAllGesturesEnabled(true)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,8 +5,8 @@ import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.map.MogoMapUIController
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import kotlinx.android.synthetic.main.view_perspective_switch.view.*
|
||||
|
||||
@@ -28,25 +28,17 @@ class PerspectiveSwitchView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
//切换地图的远近视图
|
||||
if (MogoMapUIController.getInstance().currentMapVisualAngle.isLongSight) {
|
||||
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
|
||||
// .visibleAllMarkers()
|
||||
MogoMapUIController.getInstance()
|
||||
.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
|
||||
textSwitch.setText(R.string.module_map_model_normal)
|
||||
} else if (MogoMapUIController.getInstance().currentMapVisualAngle.isMediumSight) {
|
||||
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
|
||||
// .inVisibleWithoutMarkers(DataTypes.TYPE_MARKER_ADAS)
|
||||
MogoMapUIController.getInstance()
|
||||
.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
|
||||
textSwitch.setText(R.string.module_map_model_faster)
|
||||
} else {
|
||||
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
|
||||
// .visibleAllMarkers()
|
||||
MogoMapUIController.getInstance()
|
||||
.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
|
||||
textSwitch.setText(R.string.module_map_model_normal)
|
||||
getMapUIController()?.let {
|
||||
if (it.currentMapVisualAngle.isLongSight) {
|
||||
it.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
|
||||
textSwitch.setText(R.string.module_map_model_normal)
|
||||
} else if (it.currentMapVisualAngle.isMediumSight) {
|
||||
it.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
|
||||
textSwitch.setText(R.string.module_map_model_faster)
|
||||
} else {
|
||||
it.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
|
||||
textSwitch.setText(R.string.module_map_model_faster)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,9 @@ import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.map.MogoMapUIController
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
@@ -38,7 +38,7 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
init {
|
||||
initEvent(context)
|
||||
initEvent()
|
||||
setBackgroundResource(R.drawable.yi_biao_pan_bg_nor)
|
||||
mContext = context
|
||||
mSpeedChartView = SpeedChartView(context)
|
||||
@@ -52,7 +52,7 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
addView(mSpeedChartView)
|
||||
}
|
||||
|
||||
private fun initEvent(context: Context) {
|
||||
private fun initEvent() {
|
||||
setOnLongClickListener {
|
||||
CallerHmiManager.toggleDebugView()
|
||||
false
|
||||
@@ -69,8 +69,7 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
val task = object : TimerTask() {
|
||||
override fun run() {
|
||||
mLatLng?.let {
|
||||
mSpeedLimit = MogoMapUIController.getInstance()
|
||||
.getLimitSpeed(it.longitude, it.latitude, it.bearing)
|
||||
mSpeedLimit = CallerMapUIServiceManager.getMapUIController()!!.getLimitSpeed(it.longitude, it.latitude, it.bearing)
|
||||
UiThreadHandler.post {
|
||||
val speed = (it.speed * 3.6f).toInt()
|
||||
mSpeedChartView.setArcColor(Color.parseColor(if (speed > mSpeedLimit) "#DB3137" else "#3E77F6"))
|
||||
|
||||
@@ -1,283 +0,0 @@
|
||||
package com.mogo.eagle.core.function.main;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
|
||||
import android.location.Location;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.main.registercenter.MogoRegisterCenterHandler;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.model.MogoPoi;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-04-24
|
||||
* <p>
|
||||
* 事件回调分发中心
|
||||
*/
|
||||
public class EventDispatchCenter implements
|
||||
IMogoMarkerClickListener,
|
||||
IMogoCarLocationChangedListener2,
|
||||
IMogoMapListener,
|
||||
IMogoLocationListener {
|
||||
|
||||
|
||||
private static volatile EventDispatchCenter sInstance;
|
||||
private Runnable mMapLoadedCallback;
|
||||
|
||||
private EventDispatchCenter() {
|
||||
}
|
||||
|
||||
public static EventDispatchCenter getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (EventDispatchCenter.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new EventDispatchCenter();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private static final String TAG = "DispatchCenter";
|
||||
|
||||
@Override
|
||||
public boolean onMarkerClicked(IMogoMarker marker) {
|
||||
IMogoMarkerClickListener listener = MogoRegisterCenterHandler.getInstance().getMarkerListener(marker.getOwner());
|
||||
if (listener != null) {
|
||||
try {
|
||||
return listener.onMarkerClicked(marker);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onMarkerClicked error : " + e);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onStaticMarkerClicked(IMogoMarker marker) {
|
||||
ArrayList<IMogoMarkerClickListener> list = MogoRegisterCenterHandler.getInstance().getStaticMarkerListener(marker.getOwner());
|
||||
if (list == null) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
for (IMogoMarkerClickListener listener : list) {
|
||||
return listener.onStaticMarkerClicked(marker);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onStaticMarkerClicked error : " + e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged2(Location latLng) {
|
||||
|
||||
Iterator<IMogoCarLocationChangedListener> iterator = MogoRegisterCenterHandler.getInstance().getCarLocationChangedListener();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
MogoLatLng target = null;
|
||||
while (iterator.hasNext()) {
|
||||
IMogoCarLocationChangedListener listener = iterator.next();
|
||||
if (listener instanceof IMogoCarLocationChangedListener2) {
|
||||
try {
|
||||
((IMogoCarLocationChangedListener2) listener).onCarLocationChanged2(latLng);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 地图加载完成回调
|
||||
*
|
||||
* @param callback
|
||||
*/
|
||||
void setMapLoadedCallback(Runnable callback) {
|
||||
this.mMapLoadedCallback = callback;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
if (mMapLoadedCallback != null) {
|
||||
mMapLoadedCallback.run();
|
||||
mMapLoadedCallback = null;
|
||||
}
|
||||
|
||||
Iterator<IMogoMapListener> iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while (iterator.hasNext()) {
|
||||
IMogoMapListener listener = iterator.next();
|
||||
if (listener != null) {
|
||||
try {
|
||||
listener.onMapLoaded();
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onMapLoaded error : " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTouch(MotionEvent motionEvent) {
|
||||
Iterator<IMogoMapListener> iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while (iterator.hasNext()) {
|
||||
IMogoMapListener listener = iterator.next();
|
||||
if (listener != null) {
|
||||
try {
|
||||
listener.onTouch(motionEvent);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onTouch error : " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPOIClick(MogoPoi poi) {
|
||||
Iterator<IMogoMapListener> iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while (iterator.hasNext()) {
|
||||
IMogoMapListener listener = iterator.next();
|
||||
if (listener != null) {
|
||||
try {
|
||||
listener.onPOIClick(poi);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onPOIClick error : " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapClick(MogoLatLng latLng) {
|
||||
Iterator<IMogoMapListener> iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while (iterator.hasNext()) {
|
||||
IMogoMapListener listener = iterator.next();
|
||||
if (listener != null) {
|
||||
try {
|
||||
listener.onMapClick(latLng);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onMapClick error : " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLockMap(boolean isLock) {
|
||||
Iterator<IMogoMapListener> iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while (iterator.hasNext()) {
|
||||
IMogoMapListener listener = iterator.next();
|
||||
if (listener != null) {
|
||||
try {
|
||||
listener.onLockMap(isLock);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onLockMap error : " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapModeChanged(EnumMapUI ui) {
|
||||
Iterator<IMogoMapListener> iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while (iterator.hasNext()) {
|
||||
IMogoMapListener listener = iterator.next();
|
||||
if (listener != null) {
|
||||
try {
|
||||
listener.onMapModeChanged(ui);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onMapModeChanged error :" + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapVisualAngleChanged(VisualAngleMode visualAngleMode) {
|
||||
Iterator<IMogoMapListener> iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while (iterator.hasNext()) {
|
||||
IMogoMapListener listener = iterator.next();
|
||||
if (listener != null) {
|
||||
try {
|
||||
listener.onMapVisualAngleChanged(visualAngleMode);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onMapVisualAngleChanged error : " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapChanged(MogoLatLng location, float zoom, float tilt, float bearing) {
|
||||
Iterator<IMogoMapListener> iterator = MogoRegisterCenterHandler.getInstance().getMapListeners();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while (iterator.hasNext()) {
|
||||
IMogoMapListener listener = iterator.next();
|
||||
if (listener != null) {
|
||||
try {
|
||||
listener.onMapChanged(location, zoom, tilt, bearing);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onMapChanged error :" + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(MogoLocation location) {
|
||||
|
||||
Iterator<IMogoLocationListener> iterator = MogoRegisterCenterHandler.getInstance().getLocationListeners();
|
||||
if (iterator == null) {
|
||||
return;
|
||||
}
|
||||
while (iterator.hasNext()) {
|
||||
IMogoLocationListener listener = iterator.next();
|
||||
if (listener != null) {
|
||||
try {
|
||||
listener.onLocationChanged(location);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onLocationChanged error : " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_LOG_N
|
||||
import static com.mogo.eagle.core.function.main.MainPresenter.MOGO_PERMISSION_REQUEST_CODE;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@@ -36,15 +35,14 @@ import com.mogo.commons.mvp.BaseFragment;
|
||||
import com.mogo.commons.mvp.MvpActivity;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig;
|
||||
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView;
|
||||
import com.mogo.eagle.core.function.main.cards.MogoModulesManager;
|
||||
import com.mogo.eagle.core.function.main.service.MogoMainService;
|
||||
import com.mogo.eagle.core.function.main.modules.MogoModulesManager;
|
||||
import com.mogo.eagle.core.function.main.stagetwo.AutopilotStartup;
|
||||
import com.mogo.eagle.core.function.main.windowview.FloatingViewHandler;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
|
||||
@@ -54,9 +52,9 @@ import com.mogo.eagle.core.utilcode.mogo.toast.ResourcesHelper;
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ProcessUtils;
|
||||
import com.mogo.map.listener.IMogoHosListenerRegister;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.rousetime.android_startup.StartupManager;
|
||||
@@ -81,7 +79,6 @@ import system_master.SystemStatusInfo;
|
||||
* 描述:加载各个模块
|
||||
*/
|
||||
public class MainActivity extends MvpActivity<MainView, MainPresenter> implements MainView,
|
||||
IMogoLocationListener,
|
||||
IMoGoAutopilotStatusListener {
|
||||
|
||||
protected static final String TAG = "MainActivity";
|
||||
@@ -129,8 +126,8 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
}
|
||||
|
||||
private void injectStatusBar() {
|
||||
FrameLayout decorView =(FrameLayout) this.getWindow().getDecorView();
|
||||
View contentView = ((ViewGroup)decorView.findViewById(android.R.id.content)).getChildAt(0);
|
||||
FrameLayout decorView = (FrameLayout) this.getWindow().getDecorView();
|
||||
View contentView = ((ViewGroup) decorView.findViewById(android.R.id.content)).getChildAt(0);
|
||||
contentView.setFitsSystemWindows(false);
|
||||
decorView.setClipToPadding(false);
|
||||
|
||||
@@ -228,29 +225,25 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
@Override
|
||||
public void loadModules() {
|
||||
final long start = System.currentTimeMillis();
|
||||
|
||||
MogoModulesManager.getInstance().init(this);
|
||||
IMogoHosListenerRegister listenerRegister = CallerMapUIServiceManager.INSTANCE.getHostListenerRegister();
|
||||
if (listenerRegister != null) {
|
||||
listenerRegister.registerHostMapListener(TAG,EventDispatchCenter.getInstance());
|
||||
listenerRegister.registerMarkerClickListener(TAG, EventDispatchCenter.getInstance());
|
||||
}
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().registerHostMapListener(TAG, new IMogoMapListener() {
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
// 延时加载其他模块
|
||||
getWindow().getDecorView().post(() -> {
|
||||
HdMapBuildConfig.isMapLoaded = true;
|
||||
loadOthersModules();
|
||||
loadFunctionFragment();
|
||||
|
||||
EventDispatchCenter.getInstance().setMapLoadedCallback(() -> {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "map loaded." + Thread.currentThread().getName());
|
||||
// 延时加载其他模块
|
||||
getWindow().getDecorView().post(() -> {
|
||||
loadOthersModules();
|
||||
loadFunctionFragment();
|
||||
// TODO 这里临时兼容进入VR模式,标记状态机。有些业务(OCH)会根据状态判断加载
|
||||
MogoStatusManager.getInstance().setVrMode(TAG, true);
|
||||
// 设置地图样式
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapModeChanged(EnumMapUI.MAP_STYLE_DAY_VR);
|
||||
});
|
||||
CallerLogger.INSTANCE.i(M_HMI + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
|
||||
// TODO 这里临时兼容进入VR模式,标记状态机。有些业务(OCH)会根据状态判断加载
|
||||
MogoStatusManager.getInstance().setVrMode(TAG, true);
|
||||
// 设置地图样式
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapModeChanged(EnumMapUI.MAP_STYLE_DAY_VR);
|
||||
});
|
||||
CallerLogger.INSTANCE.i(M_HMI + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
}
|
||||
});
|
||||
|
||||
// 加载地图
|
||||
loadFunctionMapView();
|
||||
}
|
||||
@@ -263,27 +256,16 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
MogoModulesManager.getInstance().loadFunctionModules();
|
||||
mPresenter.delayOperations();
|
||||
MogoModulesManager.getInstance().loadFunctionModulesServer();
|
||||
|
||||
// 启动一些基本的服务:定位等
|
||||
startBaseService();
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "5秒已过,启动基础服务……");
|
||||
MogoModulesManager.getInstance().loadBaseModule();
|
||||
}, 5_000L);
|
||||
if (DebugConfig.isDebug()) {
|
||||
// 启动Native内存泄漏监测
|
||||
startLeakMonitor();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动后台服务
|
||||
*/
|
||||
private void startBaseService() {
|
||||
Intent intentMainService = new Intent(this, MogoMainService.class);
|
||||
startService(intentMainService);
|
||||
|
||||
// USB 摄像头行车记录仪进程
|
||||
// Intent intentCarcorderService = new Intent(this, CarcorderService.class);
|
||||
// startService(intentCarcorderService);
|
||||
}
|
||||
|
||||
private void startLeakMonitor() {
|
||||
LeakMonitorConfig leakMonitorConfig = new LeakMonitorConfig.Builder()
|
||||
.setLoopInterval(50000)
|
||||
@@ -355,16 +337,11 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
return new MainPresenter(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(MogoLocation location) {
|
||||
EventDispatchCenter.getInstance().onLocationChanged(location);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
MogoStatusManager.getInstance().setMainPageResumeStatus(TAG, true);
|
||||
MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, true);
|
||||
MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -379,16 +356,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponse(@NonNull AutopilotStatusInfo autoPilotStatusInfo) {
|
||||
int status = autoPilotStatusInfo.getIpcConnStatus();
|
||||
@@ -434,11 +401,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.removeListener(TAG);
|
||||
IMogoHosListenerRegister listenerRegister = CallerMapUIServiceManager.INSTANCE.getHostListenerRegister();
|
||||
if (listenerRegister != null) {
|
||||
listenerRegister.unregisterMarkerClickListener(TAG);
|
||||
listenerRegister.unregisterHostMapListener(TAG);
|
||||
}
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().unregisterHostMapListener(TAG);
|
||||
IMogoMapUIController mapUIController = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||
if (mapUIController != null) {
|
||||
mapUIController.destroy();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.main.cards;
|
||||
package com.mogo.eagle.core.function.main.modules;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.main.cards;
|
||||
package com.mogo.eagle.core.function.main.modules;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
package com.mogo.eagle.core.function.main.monitoring;
|
||||
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.check.CallerCheckManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 车辆监控,暂时隐藏该功能
|
||||
* @since: 8/16/21
|
||||
*/
|
||||
public class VehicleMonitoring implements Handler.Callback {
|
||||
|
||||
private static final String TAG = "VehicleMonitoring";
|
||||
private final Context mContext;
|
||||
private final Handler mHandler = new Handler(this);
|
||||
//自动驾驶状态下**分钟间隔弹框提示一次 后期根据需求做修改,暂定30秒自检一次
|
||||
private static final long AUTO_CHECK_STATUS_DELAY = 30 * 1000;
|
||||
//非自动驾驶测试数据 后期根据需求做修改
|
||||
private static final long MANUAL_CHECK_STATUS_DELAY = 30 * 1000;
|
||||
//自动驾驶状态
|
||||
private static int AutopilotStatus = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState();
|
||||
|
||||
public VehicleMonitoring(Context context) {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
public void vehicleCheck() {
|
||||
//暂时隐藏自检功能
|
||||
/**
|
||||
*
|
||||
if (AutopilotStatus == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "自动驾驶中...");
|
||||
mHandler.sendEmptyMessageDelayed(AutopilotStatus, AUTO_CHECK_STATUS_DELAY);
|
||||
} else {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "非自动驾驶状态");
|
||||
//非自动驾驶状态只展示一次
|
||||
mHandler.sendEmptyMessageDelayed(AutopilotStatus, MANUAL_CHECK_STATUS_DELAY);
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleMessage(Message msg) {
|
||||
// AutopilotStatus = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState();
|
||||
// switch (msg.what) {
|
||||
// case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING:
|
||||
// vehicleMonitor();
|
||||
// mHandler.sendEmptyMessageDelayed(AutopilotStatus, AUTO_CHECK_STATUS_DELAY);
|
||||
// return true;
|
||||
// case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE:
|
||||
// case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE:
|
||||
// vehicleMonitor();
|
||||
// mHandler.sendEmptyMessageDelayed(AutopilotStatus, MANUAL_CHECK_STATUS_DELAY);
|
||||
// return true;
|
||||
// default:
|
||||
// }
|
||||
return false;
|
||||
}
|
||||
|
||||
public void vehicleMonitor() {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "vehicleMonitor");
|
||||
CallerCheckManager.checkMonitor(mContext);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
package com.mogo.eagle.core.function.main.registercenter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-09
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_REGISTER_CENTER)
|
||||
public class MogoRegisterCenter implements IMogoRegisterCenter {
|
||||
|
||||
@Override
|
||||
public void registerMogoMapListener(String moduleName, IMogoMapListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoMapListener(moduleName, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoMapListener(String moduleName) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoMapListener(moduleName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoLocationListener(String moduleName, IMogoLocationListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoLocationListener(moduleName, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<IMogoLocationListener> getLocationListeners() {
|
||||
return MogoRegisterCenterHandler.getInstance().getLocationListeners();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoLocationListener(String moduleName) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoLocationListener(moduleName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoMarkerClickListener(String moduleName, IMogoMarkerClickListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoMarkerClickListener(moduleName, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoMarkerClickListener(String moduleName) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoMarkerClickListener(moduleName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoStaticMarkerClickListener(String tag, IMogoMarkerClickListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoStaticMarkerClickListener(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoStaticMarkerClickListener(String tag, IMogoMarkerClickListener listener ) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoStaticMarkerClickListener(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCarLocationChangedListener(String tag, IMogoCarLocationChangedListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().registerCarLocationChangedListener(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterCarLocationChangedListener(String tag, IMogoCarLocationChangedListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterCarLocationChangedListener(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
}
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
package com.mogo.eagle.core.function.main.registercenter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-09
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MogoRegisterCenterHandler implements IMogoRegisterCenter {
|
||||
|
||||
private static volatile MogoRegisterCenterHandler sInstance;
|
||||
|
||||
private final Map<String, IMogoMapListener> mMap = new HashMap<>();
|
||||
private final Map<String, IMogoLocationListener> mLocation = new HashMap<>();
|
||||
private final Map<String, IMogoMarkerClickListener> mMarker = new HashMap<>();
|
||||
private final Map<String, ArrayList<IMogoMarkerClickListener>> mStaticMarker = new HashMap<>();
|
||||
private final Map<String, IMogoCarLocationChangedListener> mCarLocations = new ConcurrentHashMap<>();
|
||||
|
||||
private MogoRegisterCenterHandler() {
|
||||
}
|
||||
|
||||
public static MogoRegisterCenterHandler getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (MogoRegisterCenterHandler.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new MogoRegisterCenterHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoMapListener(String tag, IMogoMapListener listener) {
|
||||
mMap.put(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoMapListener(String tag) {
|
||||
mMap.remove(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoLocationListener(String tag, IMogoLocationListener listener) {
|
||||
mLocation.put(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoLocationListener(String tag) {
|
||||
mLocation.remove(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoMarkerClickListener(String tag, IMogoMarkerClickListener listener) {
|
||||
mMarker.put(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoMarkerClickListener(String tag) {
|
||||
mMarker.remove(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoStaticMarkerClickListener(String tag, IMogoMarkerClickListener listener) {
|
||||
ArrayList<IMogoMarkerClickListener> list = mStaticMarker.get(tag);
|
||||
if (list == null) {
|
||||
list = new ArrayList<>();
|
||||
list.add(listener);
|
||||
mStaticMarker.put(tag, list);
|
||||
}
|
||||
list.add(listener);
|
||||
mStaticMarker.put(tag, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoStaticMarkerClickListener(String tag, IMogoMarkerClickListener listener) {
|
||||
ArrayList<IMogoMarkerClickListener> list = mStaticMarker.get(tag);
|
||||
if (list == null) {
|
||||
return;
|
||||
}
|
||||
list.remove(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCarLocationChangedListener(String tag, IMogoCarLocationChangedListener listener) {
|
||||
mCarLocations.put(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterCarLocationChangedListener(String tag, IMogoCarLocationChangedListener listener) {
|
||||
mCarLocations.remove(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
}
|
||||
|
||||
public IMogoMarkerClickListener getMarkerListener(String tag) {
|
||||
return mMarker.get(tag);
|
||||
}
|
||||
|
||||
public ArrayList<IMogoMarkerClickListener> getStaticMarkerListener(String tag){
|
||||
return mStaticMarker.get(tag);
|
||||
}
|
||||
|
||||
public Iterator<IMogoMapListener> getMapListeners() {
|
||||
return mMap.values().iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<IMogoLocationListener> getLocationListeners() {
|
||||
return mLocation.values().iterator();
|
||||
}
|
||||
|
||||
public Iterator<IMogoCarLocationChangedListener> getCarLocationChangedListener() {
|
||||
return mCarLocations.values().iterator();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
package com.mogo.eagle.core.function.main.service;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.function.main.EventDispatchCenter;
|
||||
import com.mogo.eagle.core.function.main.cards.MogoModulesManager;
|
||||
import com.mogo.eagle.core.function.main.monitoring.VehicleMonitoring;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.navi.MogoCarLocationChangedListenerRegister;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/10
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@Route(path = "/service/base/info")
|
||||
class MogoMainService extends Service implements IMogoLocationListener {
|
||||
|
||||
private static final String TAG = "MogoMainService";
|
||||
|
||||
/**
|
||||
* 主模块管控定位,可以向各个模块发送统一定位信息
|
||||
*/
|
||||
private IMogoLocationClient mLocationClient;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "基本服务启动");
|
||||
initAndStartLocation();
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "5秒已过,启动基础服务……");
|
||||
loadBaseModules();
|
||||
initGpsSimulatorListener();
|
||||
HdMapBuildConfig.isMapLoaded = true;
|
||||
}, 5_000L
|
||||
);
|
||||
// 车辆检测
|
||||
VehicleMonitoring monitoring = new VehicleMonitoring(this);
|
||||
monitoring.vehicleCheck();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
return START_NOT_STICKY;
|
||||
}
|
||||
|
||||
private void initAndStartLocation() {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "开始定位");
|
||||
mLocationClient = CallerMapUIServiceManager.INSTANCE.getSingletonLocationClient(AbsMogoApplication.getApp());
|
||||
if (mLocationClient != null) {
|
||||
mLocationClient.addLocationListener(this);
|
||||
mLocationClient.start(2_000L);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化自车定位监听
|
||||
*/
|
||||
private void initGpsSimulatorListener() {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "注册自车位置监听");
|
||||
MogoCarLocationChangedListenerRegister.getInstance().registerCarLocationChangedListener(EventDispatchCenter.getInstance());
|
||||
}
|
||||
|
||||
private void loadBaseModules() {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "加载基本模块");
|
||||
MogoModulesManager.getInstance().loadBaseModule();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(MogoLocation location) {
|
||||
EventDispatchCenter.getInstance().onLocationChanged(location);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mLocationClient != null) {
|
||||
mLocationClient.removeLocationListener(this);
|
||||
mLocationClient.stop();
|
||||
mLocationClient.destroy();
|
||||
mLocationClient = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user