Merge remote-tracking branch 'origin/feature/v1.0.0' into feature/v1.0.0
This commit is contained in:
@@ -26,6 +26,7 @@ import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.model.MogoPoi;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.map.navi.MogoTraffic;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.MogoModule;
|
||||
@@ -46,8 +47,6 @@ import com.mogo.service.module.ModuleType;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.service.voice.IMogoVoiceListener;
|
||||
import com.mogo.service.voice.IMogoVoiceManager;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.List;
|
||||
@@ -239,8 +238,10 @@ public class MogoServiceProvider implements IMogoModuleProvider,
|
||||
registerCenter.registerMogoMapListener( getModuleName(), this );
|
||||
|
||||
mIntentManager = ( IMogoIntentManager ) ARouter.getInstance().build( MogoServicePaths.PATH_INTENT_MANAGER ).navigation( context );
|
||||
mIntentManager.registerIntentListener( MogoReceiver.ADAS_ACTION, this );
|
||||
|
||||
mIntentManager.registerIntentListener( MogoReceiver.ACTIION_ADAS, this );
|
||||
mIntentManager.registerIntentListener( Intent.ACTION_POWER_CONNECTED, this );
|
||||
mIntentManager.registerIntentListener( Intent.ACTION_POWER_DISCONNECTED, this );
|
||||
mIntentManager.registerIntentListener( MogoReceiver.ACTION_NWD_ACC, this );
|
||||
}
|
||||
|
||||
private void registerAIReceiver( Context context ) {
|
||||
@@ -262,7 +263,11 @@ public class MogoServiceProvider implements IMogoModuleProvider,
|
||||
}
|
||||
}
|
||||
filter.addAction( MogoReceiver.VOICE_ACTION );
|
||||
filter.addAction( MogoReceiver.ADAS_ACTION );
|
||||
filter.addAction( MogoReceiver.ACTIION_ADAS );
|
||||
filter.addAction( MogoReceiver.ACTION_NWD_ACC );
|
||||
// acc On
|
||||
filter.addAction( Intent.ACTION_POWER_CONNECTED );
|
||||
filter.addAction( Intent.ACTION_POWER_DISCONNECTED );
|
||||
try {
|
||||
context.getApplicationContext().registerReceiver( mAIAssistReceiver, filter );
|
||||
Logger.i( TAG, "register voice receiver." );
|
||||
@@ -376,7 +381,6 @@ public class MogoServiceProvider implements IMogoModuleProvider,
|
||||
@Override
|
||||
public void onMapChanged( MogoLatLng latLng, float zoom, float tilt, float bearing ) {
|
||||
|
||||
|
||||
if ( mIsCameraInited ) {
|
||||
mLastCustomRefreshCenterLocation = latLng;
|
||||
mIsCameraInited = false;
|
||||
@@ -477,11 +481,6 @@ public class MogoServiceProvider implements IMogoModuleProvider,
|
||||
|
||||
@Override
|
||||
public void onNaviInfoUpdate( MogoNaviInfo naviinfo ) {
|
||||
// 发送当前限速到 adas
|
||||
Intent intent = new Intent( "com.mogo.launcher.adas" );
|
||||
intent.putExtra( "adas_speed_limit", naviinfo.getCurrentLimitSpeed() );
|
||||
Logger.i( TAG, "send limit data to adas: limitspeed = %f", naviinfo.getCurrentLimitSpeed() );
|
||||
mContext.sendBroadcast( intent );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -525,18 +524,37 @@ public class MogoServiceProvider implements IMogoModuleProvider,
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateTraffic( MogoTraffic traffic ) {
|
||||
if ( traffic != null ) {
|
||||
|
||||
Logger.i( TAG, "speed = %d, desc = %s", traffic.getSpeedLimit(), traffic.getDesc() );
|
||||
// 发送当前限速到 adas
|
||||
Intent intent = new Intent( "com.mogo.launcher.adas" );
|
||||
intent.putExtra( "adas_speed_limit", traffic.getSpeedLimit() );
|
||||
mContext.sendBroadcast( intent );
|
||||
}
|
||||
}
|
||||
|
||||
public IMogoMarkerClickListener getMarkerClickListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onIntentReceived( String command, Intent intent ) {
|
||||
if ( MogoReceiver.ADAS_ACTION.equals( command ) ) {
|
||||
if ( MogoReceiver.ACTIION_ADAS.equals( command ) ) {
|
||||
if ( intent == null ) {
|
||||
return;
|
||||
}
|
||||
int status = intent.getIntExtra( MogoReceiver.PARAM_ADAS_STATUS, 0 );
|
||||
mStatusManager.setADASUIShow( getModuleName(), status == 1 );
|
||||
} else if ( Intent.ACTION_POWER_CONNECTED.equals( command ) ) {
|
||||
mStatusManager.setAccStatus( getModuleName(), true );
|
||||
} else if ( Intent.ACTION_POWER_DISCONNECTED.equals( command ) ) {
|
||||
mStatusManager.setAccStatus( getModuleName(), false );
|
||||
} else if ( MogoReceiver.ACTION_NWD_ACC.equals( command ) ) {
|
||||
int state = intent.getByteExtra( MogoReceiver.PARAM_ACC_STATUS, ( byte ) 0 );
|
||||
mStatusManager.setAccStatus( getModuleName(), state == 1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,10 +30,16 @@ public class MogoReceiver extends BroadcastReceiver {
|
||||
/**
|
||||
* ADAS
|
||||
*/
|
||||
public static final String ADAS_ACTION = "com.zhidao.autopilot.adas";
|
||||
public static final String ACTIION_ADAS = "com.zhidao.autopilot.adas";
|
||||
// ADAS 状态 0 - 关闭 1 - 打开
|
||||
public static final String PARAM_ADAS_STATUS = "adas_drawer_status";
|
||||
|
||||
// 诺威达 acc 状态
|
||||
public static final String ACTION_NWD_ACC = "com.nwd.action.ACTION_MCU_STATE_CHANGE";
|
||||
|
||||
// 诺威达 acc 状态
|
||||
public static final String PARAM_ACC_STATUS = "extra_mcu_state";
|
||||
|
||||
private IMogoIntentManager mMogoIntentManager;
|
||||
|
||||
public MogoReceiver( Context context ) {
|
||||
|
||||
Reference in New Issue
Block a user