思必驰实现道路事件上报免唤醒转唤醒
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -4,7 +4,7 @@
|
||||
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
|
||||
<groovy codeStyle="LEGACY" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -68,7 +68,7 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
MogoModulePaths.addModule( new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME ) );
|
||||
}
|
||||
MogoModulePaths.addModule( new MogoModule( TanluApiConst.MODULE_PATH, TanluApiConst.MODULE_NAME ) );
|
||||
MogoModulePaths.addModule( new MogoModule( TanluConstants.TAG, TanluConstants.MODEL_NAME ) );
|
||||
MogoModulePaths.addBaseModule( new MogoModule( TanluConstants.TAG, TanluConstants.MODEL_NAME ) );
|
||||
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_SHARE, "ShareControl" ) );
|
||||
|
||||
MogoModulePaths.addModule( new MogoModule( LeftPanelConst.PATH_NAME, LeftPanelConst.MODULE_NAME ) );
|
||||
|
||||
@@ -37,6 +37,8 @@ public class SchemeIntent implements IMogoStatusChangedListener {
|
||||
|
||||
public static final String TYPE_NAVI = "navi";
|
||||
|
||||
public static final String TYPE_SEARCH_ROAD_CONDITION = "search-road-condition";
|
||||
|
||||
public static final String TYPE_LAUNCH = "launch";
|
||||
|
||||
private IMogoServiceApis mApis;
|
||||
@@ -122,10 +124,24 @@ public class SchemeIntent implements IMogoStatusChangedListener {
|
||||
case TYPE_LAUNCH:
|
||||
handleLaunchIntent( target );
|
||||
break;
|
||||
case TYPE_SEARCH_ROAD_CONDITION:
|
||||
handleSearchRoadCondition(target);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void handleSearchRoadCondition(Uri target) {
|
||||
if (mApis == null) {
|
||||
return;
|
||||
}
|
||||
mApis.getTanluUiApi().searchRoadCondition(target.getQueryParameter("intentStr"),
|
||||
target.getQueryParameter("data"), target.getQueryParameter("city"),
|
||||
target.getQueryParameter("keywords"));
|
||||
}
|
||||
|
||||
private void handleSwitchCardIntent( String type ) {
|
||||
CardSwitchLiveData.getInstance().postValue( new CardInfo( type, true ) );
|
||||
}
|
||||
|
||||
@@ -185,42 +185,16 @@ public class ShareControl implements IMogoShareManager, IMogoIntentListener, IMo
|
||||
intentManager.registerIntentListener(VOICE_CMD_NO_REPLY_SHARE_DIALOG_CLOSE, this);
|
||||
intentManager.registerIntentListener(UNWAKE_UPLOAD_ROAD_CONDITION, this);
|
||||
|
||||
// 免唤醒词注册
|
||||
// AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_ROAD_BLOCK,
|
||||
// CMD_UPLOAD_BLOCK, this);
|
||||
// AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_TRAFFIC_CHECK,
|
||||
// CMD_TRAFFIC_CHECK, this);
|
||||
// AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_ROAD_CLOSURE,
|
||||
// CMD_ROAD_CLOSURE, this);
|
||||
// AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_CANCEL_SHARE,
|
||||
// CMD_CANCEL_SHARE, this);
|
||||
// if (DebugConfig.getAIType() == DebugConfig.AI_TYPE_TXZ) {
|
||||
// // 使用同行者语义你的话,增加如下免唤醒词
|
||||
// AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_ACCIDENT,
|
||||
// CMD_UPLOAD_ACCIDENT, this);
|
||||
// AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_REAL_TIME_TRAFFIC,
|
||||
// UPLOAD_REAL_TIME_TRAFFIC, this);
|
||||
// AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_SEEK_HELP,
|
||||
// UPLOAD_SEEK_HELP, this);
|
||||
// AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_STAGNANT_WATER,
|
||||
// UPLOAD_STAGNANT_WATER, this);
|
||||
// AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_ROAD_ICY,
|
||||
// UPLOAD_ROAD_ICY, this);
|
||||
// AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_DENSE_FOG,
|
||||
// UPLOAD_DENSE_FOG, this);
|
||||
// AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_ROAD_CONSTRUCTION,
|
||||
// UPLOAD_ROAD_CONSTRUCTION, this);
|
||||
// }
|
||||
// 免唤醒词注册,全局免唤醒
|
||||
AIAssist.getInstance(mContext).registerUnWakeupCommand(UNWAKE_UPLOAD_REAL_TIME_TRAFFIC,
|
||||
UPLOAD_REAL_TIME_TRAFFIC, ShareControl.this);
|
||||
|
||||
if(!DebugConfig.isLauncher()) {
|
||||
ServiceApisManager.serviceApis.getStatusManagerApi().registerStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_RESUME, new IMogoStatusChangedListener() {
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
if (!isTrue) {
|
||||
AIAssist.getInstance(mContext).unregisterUnWakeupCommand(UNWAKE_UPLOAD_REAL_TIME_TRAFFIC,ShareControl.this);
|
||||
dismissShareDialog();
|
||||
}else{
|
||||
AIAssist.getInstance(mContext).registerUnWakeupCommand(UNWAKE_UPLOAD_REAL_TIME_TRAFFIC,
|
||||
UPLOAD_REAL_TIME_TRAFFIC, ShareControl.this);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -389,6 +363,7 @@ public class ShareControl implements IMogoShareManager, IMogoIntentListener, IMo
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case VOICE_CMD_PUB_ROAD_CONDITION:
|
||||
String obCondition =
|
||||
new JSONObject(intent.getStringExtra("data")).opt("obj").toString();
|
||||
|
||||
@@ -27,7 +27,7 @@ class StrategyShareProvider : IProvider {
|
||||
// 注册事故
|
||||
apis.getSocketManagerApi(context).registerOnMessageListener(ACCIDENT_STRATEGY_SHARE_PUSH_TYPE, AccidentStrategyReceiver(apis))
|
||||
apis.registerCenterApi.registerMogoLocationListener(MogoServicePaths.PATH_STRATEGY_SHARE){
|
||||
Logger.d(S_TAG,"定位发生变化,准备记录速度: ${it.speed}")
|
||||
// Logger.d(S_TAG,"定位发生变化,准备记录速度: ${it.speed}")
|
||||
blockStrategy.recordSpeed(it.speed)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,6 +80,5 @@ public class ShareConstants {
|
||||
/**
|
||||
* 这个是实时路况,不是拥堵,拥堵放在了extention模块里面处理
|
||||
*/
|
||||
public static final String VOICE_CMD_PUB_ROAD_CONDITION = "com.zhidao.pathfinder.report" +
|
||||
".roadCondition";
|
||||
public static final String VOICE_CMD_PUB_ROAD_CONDITION = "com.zhidao.pathfinder.report.roadCondition";
|
||||
}
|
||||
|
||||
@@ -74,6 +74,8 @@ class BlockStrategy(private val apis: IMogoServiceApis) {
|
||||
Logger.d(TAG, "平均速度为: $ave")
|
||||
// 上报平均速度
|
||||
uploadAverageSpeed(ave)
|
||||
}else{
|
||||
Logger.d(TAG,"判定为停车,不进行上报")
|
||||
}
|
||||
startRecordTime = 0
|
||||
}
|
||||
|
||||
@@ -51,13 +51,21 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||
implementation rootProject.ext.dependencies.rxjava
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
|
||||
compileOnly rootProject.ext.dependencies.mogomap
|
||||
compileOnly rootProject.ext.dependencies.mogoutils
|
||||
compileOnly rootProject.ext.dependencies.mogocommons
|
||||
compileOnly rootProject.ext.dependencies.mogoserviceapi
|
||||
compileOnly rootProject.ext.dependencies.modulecommon
|
||||
compileOnly rootProject.ext.dependencies.moduleshare
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
compileOnly rootProject.ext.dependencies.mogomap
|
||||
compileOnly rootProject.ext.dependencies.mogoutils
|
||||
compileOnly rootProject.ext.dependencies.mogocommons
|
||||
compileOnly rootProject.ext.dependencies.mogoserviceapi
|
||||
compileOnly rootProject.ext.dependencies.modulecommon
|
||||
compileOnly rootProject.ext.dependencies.moduleshare
|
||||
}else{
|
||||
compileOnly project(":libraries:mogo-map")
|
||||
compileOnly project(":foudations:mogo-utils")
|
||||
compileOnly project(":foudations:mogo-commons")
|
||||
compileOnly project(":services:mogo-service-api")
|
||||
compileOnly project(":modules:mogo-module-common")
|
||||
compileOnly project(":modules:mogo-module-share")
|
||||
}
|
||||
compileOnly rootProject.ext.dependencies.carcallprovider
|
||||
|
||||
implementation rootProject.ext.dependencies.videoarmv7
|
||||
|
||||
@@ -64,7 +64,10 @@ public class TanluConstants {
|
||||
//打开探路 唤醒
|
||||
public static final String OPEN_ROADCONDITION_AWAKE_COMMAND = "system.application.operation";
|
||||
|
||||
//xx堵不堵 唤醒
|
||||
// 同行者 xx堵不堵 唤醒
|
||||
public static final String TXZ_SPECIFIEDROAD_SEARCH = "com.zhidao.roadcondition.roadinfo";
|
||||
|
||||
//思必驰 xx堵不堵 唤醒
|
||||
public static final String SPECIFIEDROAD_SEARCH = "com.zhidao.pathfinder.specifiedroad.search";
|
||||
//播放 免唤醒
|
||||
public static final String PLAY_VIDEO = "com.zhidao.tanlu.play";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.module.tanlu.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
@@ -16,8 +17,17 @@ import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.service.module.ModuleType;
|
||||
import com.mogo.module.tanlu.constant.TanluConstants;
|
||||
import com.mogo.service.tanlu.IMogoTanluUiProvider;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import io.reactivex.Single;
|
||||
import io.reactivex.SingleEmitter;
|
||||
import io.reactivex.SingleOnSubscribe;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-24
|
||||
@@ -25,77 +35,35 @@ import com.mogo.utils.logger.Logger;
|
||||
* 描述
|
||||
*/
|
||||
@Route( path = TanluConstants.TAG )
|
||||
public class TanluCardViewProvider implements IMogoModuleProvider {
|
||||
public class TanluCardViewProvider implements IMogoTanluUiProvider {
|
||||
|
||||
private static final String TAG = "TanluCardViewProvider";
|
||||
private TanluCardViewFragment fragment;
|
||||
|
||||
@Override
|
||||
public Fragment createFragment( Context context, Bundle data ) {
|
||||
fragment = new TanluCardViewFragment();
|
||||
fragment.setArguments( data );
|
||||
Logger.i( TAG, "createFragment" );
|
||||
return fragment;
|
||||
}
|
||||
|
||||
private TanluListWindow tanluListWindow;
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
Logger.d(TAG, "init --------------> 1");
|
||||
TanluServiceManager.init( context );
|
||||
TanluServiceManager.getDataManager().registerDataListener( TanluConstants.MODEL_NAME, DataSetChangedAdapter.getInstance() );
|
||||
|
||||
TanluListWindow tanluListWindow = new TanluListWindow(context);
|
||||
tanluListWindow = new TanluListWindow(context);
|
||||
tanluListWindow.initWindow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModuleName() {
|
||||
return "CARD_TYPE_ROAD_CONDITION";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoModuleLifecycle getCardLifecycle() {
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View createView( Context context ) {
|
||||
// don't
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMapListener getMapListener() {
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return ModuleType.TYPE_CARD_FRAGMENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoNaviListener getNaviListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoLocationListener getLocationListener() {
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMarkerClickListener getMarkerClickListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppPackage() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppName() {
|
||||
return "探路";
|
||||
public void searchRoadCondition(String intentStr, String data, String city, String keywords) {
|
||||
Disposable disposable = Single.create((SingleOnSubscribe<Intent>) emitter -> {
|
||||
Logger.d(TAG, "searchRoadCondition---> intentStr: " + intentStr + " data: " + data + " " +
|
||||
"city: " + city + " keywords: " + keywords);
|
||||
Intent intent = new Intent(intentStr);
|
||||
intent.putExtra("data", data);
|
||||
intent.putExtra("city", city);
|
||||
intent.putExtra("keywords", keywords);
|
||||
Thread.sleep(3000);
|
||||
emitter.onSuccess(intent);
|
||||
}).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(intent -> {
|
||||
Logger.d(TAG, "searchRoadCondition---go real share");
|
||||
tanluListWindow.realShare(intentStr, intent);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Rect;
|
||||
import android.net.Uri;
|
||||
import android.os.CountDownTimer;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
@@ -117,6 +118,7 @@ import static com.mogo.module.tanlu.constant.ConstKt.VOICE_COMMAND_QUERY_ROAD_CL
|
||||
import static com.mogo.module.tanlu.constant.ConstKt.VOICE_COMMAND_QUERY_TRAFFIC_CHECK;
|
||||
import static com.mogo.module.tanlu.constant.TanluConstants.PLAY_VIDEO_AWAKEN;
|
||||
import static com.mogo.module.tanlu.constant.TanluConstants.SPECIFIEDROAD_SEARCH;
|
||||
import static com.mogo.module.tanlu.constant.TanluConstants.TXZ_SPECIFIEDROAD_SEARCH;
|
||||
import static com.mogo.module.tanlu.video.VideoInitKt.initVideo;
|
||||
|
||||
/**
|
||||
@@ -477,6 +479,9 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
|
||||
*/
|
||||
private void initListener() {
|
||||
if (mogoIntentManager != null) {
|
||||
// 同行者 xxx堵不堵唤醒词语音注册
|
||||
mogoIntentManager.registerIntentListener(TXZ_SPECIFIEDROAD_SEARCH,mogoIntentListener);
|
||||
// 通用唤醒词语音注册
|
||||
mogoIntentManager.registerIntentListener(SPECIFIEDROAD_SEARCH, mogoIntentListener);
|
||||
mogoIntentManager.registerIntentListener(PLAY_VIDEO_AWAKEN, mogoIntentListener);
|
||||
mogoIntentManager.registerIntentListener(VOICE_COMMAND_QUERY_TRAFFIC_CHECK, mogoIntentListener);
|
||||
@@ -497,75 +502,97 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
|
||||
/**
|
||||
* 唤醒语音
|
||||
*/
|
||||
private IMogoIntentListener mogoIntentListener = new IMogoIntentListener() {
|
||||
@Override
|
||||
public void onIntentReceived(String intentStr, Intent intent) {
|
||||
String data = intent.getStringExtra("data");
|
||||
Logger.d(TAG, "唤醒 mogoIntentListener intentStr =" + intentStr + ">>data =" + data);
|
||||
VoiceCmdData voiceData = null;
|
||||
switch (intentStr) {
|
||||
case VOICE_COMMAND_QUERY_TRAFFIC_CHECK:
|
||||
// 搜索交通检查
|
||||
Logger.d(TAG, "搜索交通检查");
|
||||
voiceData = Utils.parseTOVoiceCmdData(data);
|
||||
voiceData.setObj(TYPE_NAME_TRAFFIC_CHECK);
|
||||
break;
|
||||
case VOICE_COMMAND_QUERY_ROAD_CLOSED:
|
||||
// 搜索封路
|
||||
Logger.d(TAG, "搜索封路");
|
||||
voiceData = Utils.parseTOVoiceCmdData(data);
|
||||
voiceData.setLocation(voiceData.getObj());
|
||||
voiceData.setObj(TYPE_NAME_CLOSURE);
|
||||
break;
|
||||
case SPECIFIEDROAD_SEARCH:
|
||||
// 拥堵和路况
|
||||
Logger.d(TAG, "拥堵和路况");
|
||||
voiceData = Utils.parseTOVoiceCmdData(data);
|
||||
voiceData.setObj(TYPE_NAME_BLOCK);
|
||||
break;
|
||||
case VOICE_COMMAND_NOVELTY_QUERY:
|
||||
Logger.d(TAG, "其他");
|
||||
voiceData = Utils.parseTOVoiceCmdData(data);
|
||||
break;
|
||||
case PLAY_VIDEO_AWAKEN:
|
||||
Logger.d(TAG, "mogoIntentListener 播放路况 唤醒 ----> ");
|
||||
delayTime();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (voiceData != null) {
|
||||
mTanluModelData.queryRodeInfo(voiceData, new RoadInfoCallback() {
|
||||
@Override
|
||||
public void onQueryRoadInfoSuccess(@NotNull List<? extends MarkerExploreWay> roadInfoList) {
|
||||
if (roadInfoList == null || (roadInfoList != null && roadInfoList.size() <= 0)) {
|
||||
speakFailVoice("未找到其他车主分享的路况信息");
|
||||
moveToMarcker(currentLat, currentLon);
|
||||
return;
|
||||
}
|
||||
Logger.d(TAG, "onQueryRoadInfoSuccess roadInfoList.size() = " + roadInfoList.size()
|
||||
+ " >>currentLat = " + currentLat + " -->currentLon = " + currentLon);
|
||||
initData(null, (List<MarkerExploreWay>) roadInfoList);
|
||||
addMarkersAction((List<MarkerExploreWay>) roadInfoList, currentLat, currentLon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onQueryRoadInfoFail(@NotNull String msg, int code) {
|
||||
Logger.e(TAG, "onQueryRoadInfoFail ----- msg = " + msg);
|
||||
speakFailVoice(searchfaileVoiceStrings[2]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocatSuccess(double lat, double lon) {
|
||||
currentLat = lat;
|
||||
currentLon = lon;
|
||||
}
|
||||
});
|
||||
}
|
||||
private IMogoIntentListener mogoIntentListener = (intentStr, intent) -> {
|
||||
if (TanluServiceManager.getMogoStatusManager().isMainPageOnResume()) {
|
||||
// 直接执行相关查询操作
|
||||
Logger.d(TAG, "智慧出行在前台,可直接分享--->");
|
||||
realShare(intentStr, intent);
|
||||
}else{
|
||||
// 需要打开智慧驾驶,然后执行操作
|
||||
Logger.d(TAG, "智慧出行没在前台,需要打开 --->");
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
String data = intent.getStringExtra("data") == null ? "" : intent.getStringExtra("data");
|
||||
String city = intent.getStringExtra("city") == null ? "" : intent.getStringExtra("city");
|
||||
String keywords = intent.getStringExtra("keywords") == null ? "" : intent.getStringExtra("keywords");
|
||||
intent.setData(Uri.parse("mogo://launcher/main/switch2?type=search-road-condition" +
|
||||
"&intentStr=" + intentStr + "&data=" + data + "&city=" + city + "&keywords=" + keywords));
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
};
|
||||
|
||||
public void realShare(String intentStr, Intent intent){
|
||||
String data = intent.getStringExtra("data");
|
||||
Logger.d(TAG, "唤醒 mogoIntentListener intentStr =" + intentStr + ">>data =" + data);
|
||||
VoiceCmdData voiceData = null;
|
||||
switch (intentStr) {
|
||||
case VOICE_COMMAND_QUERY_TRAFFIC_CHECK:
|
||||
// 搜索交通检查
|
||||
Logger.d(TAG, "搜索交通检查");
|
||||
voiceData = Utils.parseTOVoiceCmdData(data);
|
||||
voiceData.setObj(TYPE_NAME_TRAFFIC_CHECK);
|
||||
break;
|
||||
case VOICE_COMMAND_QUERY_ROAD_CLOSED:
|
||||
// 搜索封路
|
||||
Logger.d(TAG, "搜索封路");
|
||||
voiceData = Utils.parseTOVoiceCmdData(data);
|
||||
voiceData.setLocation(voiceData.getObj());
|
||||
voiceData.setObj(TYPE_NAME_CLOSURE);
|
||||
break;
|
||||
case SPECIFIEDROAD_SEARCH:
|
||||
// 拥堵和路况
|
||||
Logger.d(TAG, "拥堵和路况");
|
||||
voiceData = Utils.parseTOVoiceCmdData(data);
|
||||
voiceData.setObj(TYPE_NAME_BLOCK);
|
||||
break;
|
||||
case VOICE_COMMAND_NOVELTY_QUERY:
|
||||
Logger.d(TAG, "其他");
|
||||
voiceData = Utils.parseTOVoiceCmdData(data);
|
||||
break;
|
||||
case PLAY_VIDEO_AWAKEN:
|
||||
Logger.d(TAG, "mogoIntentListener 播放路况 唤醒 ----> ");
|
||||
delayTime();
|
||||
break;
|
||||
case TXZ_SPECIFIEDROAD_SEARCH:
|
||||
Logger.d(TAG, "同行者--xx堵不堵--唤醒--->");
|
||||
String keyWords = intent.getStringExtra("keywords");
|
||||
String city = intent.getStringExtra("city");
|
||||
voiceData = new VoiceCmdData("", city + keyWords, TYPE_NAME_BLOCK);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (voiceData != null) {
|
||||
mTanluModelData.queryRodeInfo(voiceData, new RoadInfoCallback() {
|
||||
@Override
|
||||
public void onQueryRoadInfoSuccess(@NotNull List<? extends MarkerExploreWay> roadInfoList) {
|
||||
if (roadInfoList == null || (roadInfoList != null && roadInfoList.size() <= 0)) {
|
||||
speakFailVoice("未找到其他车主分享的路况信息");
|
||||
moveToMarcker(currentLat, currentLon);
|
||||
return;
|
||||
}
|
||||
Logger.d(TAG, "onQueryRoadInfoSuccess roadInfoList.size() = " + roadInfoList.size()
|
||||
+ " >>currentLat = " + currentLat + " -->currentLon = " + currentLon);
|
||||
initData(null, (List<MarkerExploreWay>) roadInfoList);
|
||||
addMarkersAction((List<MarkerExploreWay>) roadInfoList, currentLat, currentLon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onQueryRoadInfoFail(@NotNull String msg, int code) {
|
||||
Logger.e(TAG, "onQueryRoadInfoFail ----- msg = " + msg);
|
||||
speakFailVoice(searchfaileVoiceStrings[2]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocatSuccess(double lat, double lon) {
|
||||
currentLat = lat;
|
||||
currentLon = lon;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加marker
|
||||
*/
|
||||
@@ -1058,7 +1085,7 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
|
||||
|
||||
if (!NetworkUtils.isConnected(getContext())) { //没有网络
|
||||
TipToast.shortTip("分享失败,请检查网络");
|
||||
} else {
|
||||
} else if(TanluServiceManager.getMogoStatusManager().isMainPageOnResume()) {
|
||||
float bearing = TanluServiceManager.getLocationClient().getLastKnowLocation().getBearing(); //角度
|
||||
Logger.d(TAG, "onMarkerInfo event.type = " + event.type + " >>event.lat = " + event.lat + " >>event.lon = " + event.lon + " >>event.imageUrl =" + event.imageUrl);
|
||||
String poiType = event.type;
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.mogo.service.statusmanager.IMogoMsgCenter;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.strategy.IMogoRefreshStrategyController;
|
||||
import com.mogo.service.tanlu.IMogoTanluProvider;
|
||||
import com.mogo.service.tanlu.IMogoTanluUiProvider;
|
||||
import com.mogo.service.windowview.IMogoTopViewManager;
|
||||
import com.mogo.service.windowview.IMogoWindowManager;
|
||||
|
||||
@@ -257,4 +258,9 @@ public interface IMogoServiceApis extends IProvider {
|
||||
* @return
|
||||
*/
|
||||
IMogoMonitorProvider getMogoMonitorApi();
|
||||
/**
|
||||
* 获取探路ui服务
|
||||
* @return
|
||||
*/
|
||||
IMogoTanluUiProvider getTanluUiApi();
|
||||
}
|
||||
|
||||
@@ -244,4 +244,10 @@ public class MogoServicePaths {
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String PATH_STRATEGY_SHARE = "/share/strategy";
|
||||
|
||||
/**
|
||||
* 探路ui
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String PATH_TANLU_UI_API = "/tanlu/ui";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.mogo.service.tanlu;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
|
||||
/**
|
||||
* 探路相关ui provider
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public interface IMogoTanluUiProvider extends IProvider {
|
||||
/**
|
||||
* 搜索道路事件接口,当前只在应用在后台时,收到搜索相关唤醒词指令,需跳转前台时使用
|
||||
* @param intentStr action
|
||||
* @param data 思必驰相关事件
|
||||
* @param city 同行者-xx堵不堵-北京
|
||||
* @param keywords 同行者-xx堵不堵-中关村
|
||||
*/
|
||||
void searchRoadCondition(String intentStr, String data, String city, String keywords);
|
||||
}
|
||||
@@ -40,6 +40,7 @@ import com.mogo.service.statusmanager.IMogoMsgCenter;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.strategy.IMogoRefreshStrategyController;
|
||||
import com.mogo.service.tanlu.IMogoTanluProvider;
|
||||
import com.mogo.service.tanlu.IMogoTanluUiProvider;
|
||||
import com.mogo.service.windowview.IMogoTopViewManager;
|
||||
import com.mogo.service.windowview.IMogoWindowManager;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -218,6 +219,11 @@ public class MogoServiceApis implements IMogoServiceApis {
|
||||
return getApiInstance(IMogoMonitorProvider.class,MogoServicePaths.PATH_MOGO_MONITOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoTanluUiProvider getTanluUiApi(){
|
||||
return getApiInstance(IMogoTanluUiProvider.class, MogoServicePaths.PATH_TANLU_UI_API);
|
||||
}
|
||||
|
||||
private static < T extends IProvider > T getApiInstance(Class< T > clazz, String path ) {
|
||||
T inst = SingletonsHolder.get( clazz );
|
||||
if ( inst == null ) {
|
||||
|
||||
Reference in New Issue
Block a user