opt
This commit is contained in:
@@ -157,6 +157,7 @@ public class EventDispatchCenter implements
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged2( Location latLng ) {
|
||||
|
||||
Iterator< IMogoCarLocationChangedListener > iterator = MogoRegisterCenterHandler.getInstance().getCarLocationChangedListener();
|
||||
if ( iterator == null ) {
|
||||
return;
|
||||
@@ -370,7 +371,6 @@ public class EventDispatchCenter implements
|
||||
public void onStartNavi() {
|
||||
Iterator< IMogoNaviListener > iterator = MogoRegisterCenterHandler.getInstance().getNaviListeners();
|
||||
|
||||
|
||||
if ( iterator == null ) {
|
||||
return;
|
||||
}
|
||||
@@ -447,6 +447,7 @@ public class EventDispatchCenter implements
|
||||
|
||||
@Override
|
||||
public void onLocationChanged( MogoLocation location ) {
|
||||
|
||||
final long start = System.currentTimeMillis();
|
||||
Iterator< IMogoLocationListener > iterator = MogoRegisterCenterHandler.getInstance().getLocationListeners();
|
||||
if ( iterator == null ) {
|
||||
|
||||
@@ -13,6 +13,9 @@ import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-09
|
||||
@@ -57,6 +60,11 @@ public class MogoRegisterCenter implements IMogoRegisterCenter {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoLocationListener( moduleName, listener );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator< IMogoLocationListener > getLocationListeners() {
|
||||
return MogoRegisterCenterHandler.getInstance().getLocationListeners();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoLocationListener( String moduleName ) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoLocationListener( moduleName );
|
||||
|
||||
@@ -158,6 +158,7 @@ public class MogoRegisterCenterHandler implements IMogoRegisterCenter {
|
||||
return mNavi.values().iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator< IMogoLocationListener > getLocationListeners() {
|
||||
return mLocation.values().iterator();
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ class MogoMainService extends Service implements IMogoLocationListener {
|
||||
Logger.d( TAG, "基本服务启动" );
|
||||
mServiceApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation();
|
||||
initAndStartLocation();
|
||||
initGpsSimulatorListener();
|
||||
loadBaseModules();
|
||||
startTanluService();
|
||||
initADAS();
|
||||
@@ -60,7 +61,9 @@ class MogoMainService extends Service implements IMogoLocationListener {
|
||||
mLocationClient = mServiceApis.getMapServiceApi().getSingletonLocationClient( AbsMogoApplication.getApp() );
|
||||
mLocationClient.addLocationListener( this );
|
||||
mLocationClient.start( 2_000L );
|
||||
}
|
||||
|
||||
private void initGpsSimulatorListener() {
|
||||
mServiceApis.getMapServiceApi().getNavi( this ).registerCarLocationChangedListener( EventDispatchCenter.getInstance() );
|
||||
}
|
||||
|
||||
@@ -69,11 +72,11 @@ class MogoMainService extends Service implements IMogoLocationListener {
|
||||
MogoModulesManager.getInstance().loadBaseModule();
|
||||
}
|
||||
|
||||
private void startTanluService(){
|
||||
private void startTanluService() {
|
||||
MainService.Companion.launchService( getApplicationContext(), "0" );
|
||||
}
|
||||
|
||||
private void initADAS(){
|
||||
private void initADAS() {
|
||||
mServiceApis.getAdasControllerApi().init( AbsMogoApplication.getApp() );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user