Merge branch 'qa_byd' into qa_byd_res
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="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -123,23 +123,19 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
private void preparePassportEnvironment( IMogoServiceApis apis, Runnable after ) {
|
||||
apis.getPassportManagerApi().requestTicket( new IMogoTicketCallback() {
|
||||
@Override
|
||||
public void onSuccess( String ticket ) {
|
||||
public void onTicketGot( String ticket ) {
|
||||
Logger.d( TAG, "ticket = %s", ticket );
|
||||
SpStorage.setTicket( ticket );
|
||||
if ( after != null ) {
|
||||
after.run();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError( int code, String msg ) {
|
||||
Logger.w( TAG, "code = %s, msg = %s", code, msg );
|
||||
if ( !TextUtils.isEmpty( Utils.getSn() ) ) {
|
||||
if ( after != null ) {
|
||||
after.run();
|
||||
}
|
||||
} else {
|
||||
prepareBaseService(1_000L);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoginSuccess( String token, String sn ) {
|
||||
if ( after != null ) {
|
||||
after.run();
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
@@ -101,8 +101,8 @@ targetSdkVersion : 22,
|
||||
moduleextensions : "com.mogo.module:module-extensions:${MOGO_MODULE_EXTENSIONS_VERSION}",
|
||||
carcall : "com.mogo.module.carchatting:module-carchatting:${CARCHATTING_VERSION}",
|
||||
carcallprovider : "com.mogo.module.carchatting:module-carchatting-provider:${CARCHATTINGPROVIDER_VERSION}",
|
||||
guideshow : "com.mogo.module.guideshow:module-guideshow:${MOGO_MODULE_GUIDESHOW_VERSION}",
|
||||
guideshowprovider : "com.mogo.module.guideshow:module-guideshow-provider:${MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION}",
|
||||
// guideshow : "com.mogo.module.guideshow:module-guideshow:${MOGO_MODULE_GUIDESHOW_VERSION}",
|
||||
// guideshowprovider : "com.mogo.module.guideshow:module-guideshow-provider:${MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION}",
|
||||
// 在线车辆
|
||||
moduleonlinecar : "com.mogo.module:module-onlinecar:${MOGO_MODULE_ONLINECAR_VERSION}",
|
||||
// V2X
|
||||
|
||||
@@ -53,7 +53,7 @@ class PassportManager implements IMogoPassportManager {
|
||||
Logger.d( TAG, "success" );
|
||||
SpStorage.setTicket( ticket );
|
||||
if ( callback != null ) {
|
||||
callback.onSuccess( ticket );
|
||||
callback.onTicketGot( ticket );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ dependencies {
|
||||
// 长链
|
||||
implementation 'com.zhidao.socket:built-in-socket:1.0.15'
|
||||
// passport
|
||||
implementation 'com.zhidao.tcloginsdk:tclogin:1.0.9'
|
||||
implementation 'com.zhidao.tcloginsdk:tclogin:1.1.0'
|
||||
|
||||
annotationProcessor 'com.elegant.spi:compiler:1.0.3'
|
||||
|
||||
|
||||
@@ -11,8 +11,9 @@ import com.mogo.service.passport.IMogoTicketCallback;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.accountsdk.manager.CarPadClientManagerImpl;
|
||||
import com.zhidao.accountsdk.manager.TicketInfoCallback;
|
||||
import com.zhidao.accountsdk.network.NetEnvironManager;
|
||||
import com.zhidao.tcloginsdk.LoginManager;
|
||||
import com.zhidao.tcloginsdk.model.TokenData;
|
||||
import com.zhidao.tcloginsdk.network.LoginCallback;
|
||||
|
||||
public
|
||||
/**
|
||||
@@ -29,13 +30,14 @@ class PassportManager implements IMogoPassportManager {
|
||||
|
||||
private static volatile PassportManager sInstance;
|
||||
|
||||
private PassportManager(){}
|
||||
private PassportManager() {
|
||||
}
|
||||
|
||||
@Keep
|
||||
public static PassportManager getInstance(){
|
||||
if( sInstance == null ){
|
||||
synchronized( PassportManager.class ) {
|
||||
if( sInstance == null ){
|
||||
public static PassportManager getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( PassportManager.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new PassportManager();
|
||||
}
|
||||
}
|
||||
@@ -43,30 +45,46 @@ class PassportManager implements IMogoPassportManager {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release(){
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestTicket( final IMogoTicketCallback callback ) {
|
||||
getTicket( new TicketInfoCallback() {
|
||||
LoginManager.getInstance( mContext ).login( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE, DebugConfig.getProductFlavor(), new LoginCallback() {
|
||||
@Override
|
||||
public void onSuccess( String ticket ) {
|
||||
Logger.d( TAG, "success" );
|
||||
SpStorage.setTicket( ticket );
|
||||
public void onSuccess( TokenData.TokenResult result ) {
|
||||
if ( callback != null ) {
|
||||
callback.onSuccess( ticket );
|
||||
callback.onLoginSuccess( result.token, result.sn );
|
||||
}
|
||||
getTicket( new TicketInfoCallback() {
|
||||
@Override
|
||||
public void onSuccess( String ticket ) {
|
||||
Logger.d( TAG, "success" );
|
||||
SpStorage.setTicket( ticket );
|
||||
if ( callback != null ) {
|
||||
callback.onTicketGot( ticket );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure( int code ) {
|
||||
Logger.d( TAG, "fail" );
|
||||
if ( callback != null ) {
|
||||
callback.onError( code, "getTicket error." );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure( int code ) {
|
||||
Logger.d( TAG, "fail" );
|
||||
public void onFailure( int code, String msg ) {
|
||||
if ( callback != null ) {
|
||||
callback.onError( code, "error." );
|
||||
callback.onError( code, "login: " + msg );
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
}
|
||||
|
||||
private void getTicket( TicketInfoCallback callback ) {
|
||||
@@ -96,6 +114,5 @@ class PassportManager implements IMogoPassportManager {
|
||||
mode = DebugConfig.NET_MODE_QA;
|
||||
}
|
||||
LoginManager.getInstance( context ).setNetEnviron( mode );
|
||||
LoginManager.getInstance( context ).login(DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE, DebugConfig.getProductFlavor());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,35 +110,6 @@ public class AbsMogoApplication extends Application {
|
||||
|
||||
}
|
||||
|
||||
// private static void initAccountSdk() {
|
||||
// int mode = DebugConfig.getNetMode();
|
||||
// if ( mode == DebugConfig.NET_MODE_DEMO ) {
|
||||
// // 演示环境用 qa 的
|
||||
// mode = DebugConfig.NET_MODE_QA;
|
||||
// }
|
||||
// AccountClientManager.init( sApp, mode, NetEnvironManager.OS_2C, "os2.0-launcher" );
|
||||
// getTicket( new TicketInfoCallback() {
|
||||
// @Override
|
||||
// public void onSuccess( String ticket ) {
|
||||
// SpStorage.setTicket( ticket );
|
||||
// Logger.w( TAG, "request ticket success" );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure( int code, String msg ) {
|
||||
// Logger.w( TAG, "request ticket error code = %d, msg = %s", code, msg );
|
||||
// }
|
||||
// } );
|
||||
// }
|
||||
//
|
||||
// private static void getTicket( TicketInfoCallback callback ) {
|
||||
// if ( DebugConfig.isLauncher() ) {
|
||||
// AccountClientManager.getTicket( callback );
|
||||
// } else {
|
||||
// AccountClientManager.getAppTicket( callback );
|
||||
// }
|
||||
// }
|
||||
|
||||
private static void initNetConfig() {
|
||||
|
||||
try {
|
||||
|
||||
@@ -60,7 +60,7 @@ MOGO_MODULE_V2X_VERSION=1.2.1.20
|
||||
|
||||
## 工程外部模块
|
||||
# 探路
|
||||
MOGO_MODULE_TANLU_VERSION=1.3.1.5
|
||||
MOGO_MODULE_TANLU_VERSION=1.3.1.6
|
||||
# 车聊聊
|
||||
CARCHATTING_VERSION=1.4.6
|
||||
# 车聊聊接口
|
||||
@@ -78,7 +78,7 @@ MOGO_MODULE_PUSH_NOOP_VERSION=1.1.5.6
|
||||
# 广告资源位
|
||||
MOGO_MODULE_AD_CARD_VERSION=1.0.1
|
||||
# 探路上报和分享模块
|
||||
TANLULIB_VERSION=1.3.1.5
|
||||
TANLULIB_VERSION=1.3.1.6
|
||||
MOGO_MODULE_EVENT_PANEL_VERSION = 1.0.0-SNAPSHOT
|
||||
MOGO_MODULE_EVENT_PANEL_NOOP_VERSION = 1.0.0-SNAPSHOT
|
||||
#左侧面板模块
|
||||
|
||||
@@ -2,7 +2,8 @@ package com.mogo.module.common.wm;
|
||||
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -12,12 +13,15 @@ import com.mogo.utils.logger.Logger;
|
||||
*/
|
||||
class DialogImpl implements IWindowManagerView {
|
||||
private Dialog dialog;
|
||||
private View contentView;
|
||||
|
||||
@Override
|
||||
public void init(WindowManagerView.WMViewParams params) {
|
||||
Logger.d("DialogImpl", "init====");
|
||||
dialog = new BaseFloatDialog(params.mContext);
|
||||
Logger.d("DialogImpl","params view : " + params.mContentView);
|
||||
dialog.setContentView(params.mContentView);
|
||||
contentView = params.mContentView;
|
||||
Logger.d("DialogImpl", "params view : " + contentView);
|
||||
dialog.setContentView(contentView);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -32,6 +36,12 @@ class DialogImpl implements IWindowManagerView {
|
||||
|
||||
@Override
|
||||
public void hide() {
|
||||
/*
|
||||
* 取得view的父组件,然后移除view
|
||||
*/
|
||||
if (contentView != null) {
|
||||
((ViewGroup) contentView.getParent()).removeView(contentView);
|
||||
}
|
||||
dialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ public class EventDispatchCenter implements
|
||||
*
|
||||
* @param callback
|
||||
*/
|
||||
void setMapLoadedCallback( Runnable callback ){
|
||||
void setMapLoadedCallback( Runnable callback ) {
|
||||
this.mMapLoadedCallback = callback;
|
||||
}
|
||||
|
||||
@@ -162,6 +162,21 @@ public class EventDispatchCenter implements
|
||||
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 ) {
|
||||
Logger.e( TAG, e, "error." );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -466,46 +481,46 @@ public class EventDispatchCenter implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showCarLocationInfo(CarLocationInfo info) {
|
||||
public void showCarLocationInfo( CarLocationInfo info ) {
|
||||
Iterator< IMogoObuDataChangedListener > iterator = MogoRegisterCenterHandler.getInstance().getObuDataChangedListeners();
|
||||
if ( iterator == null ) {
|
||||
return;
|
||||
}
|
||||
while ( iterator.hasNext() ) {
|
||||
iterator.next().showCarLocationInfo(info);
|
||||
iterator.next().showCarLocationInfo( info );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showOtherInfo(String info) {
|
||||
public void showOtherInfo( String info ) {
|
||||
Iterator< IMogoObuDataChangedListener > iterator = MogoRegisterCenterHandler.getInstance().getObuDataChangedListeners();
|
||||
if ( iterator == null ) {
|
||||
return;
|
||||
}
|
||||
while ( iterator.hasNext() ) {
|
||||
iterator.next().showOtherInfo(info);
|
||||
iterator.next().showOtherInfo( info );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showTrafficLightInfo(TrafficLightInfo info) {
|
||||
public void showTrafficLightInfo( TrafficLightInfo info ) {
|
||||
Iterator< IMogoObuDataChangedListener > iterator = MogoRegisterCenterHandler.getInstance().getObuDataChangedListeners();
|
||||
if ( iterator == null ) {
|
||||
return;
|
||||
}
|
||||
while ( iterator.hasNext() ) {
|
||||
iterator.next().showTrafficLightInfo(info);
|
||||
iterator.next().showTrafficLightInfo( info );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showCarEventInfo(CarEventInfo info) {
|
||||
public void showCarEventInfo( CarEventInfo info ) {
|
||||
Iterator< IMogoObuDataChangedListener > iterator = MogoRegisterCenterHandler.getInstance().getObuDataChangedListeners();
|
||||
if ( iterator == null ) {
|
||||
return;
|
||||
}
|
||||
while ( iterator.hasNext() ) {
|
||||
iterator.next().showCarEventInfo(info);
|
||||
iterator.next().showCarEventInfo( info );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 19 KiB |
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -11,11 +12,14 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
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.IMogoNaviListener;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
@@ -53,7 +57,8 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
@Route(path = V2XConst.PATH_V2X_UI)
|
||||
public class V2XModuleProvider implements
|
||||
IMogoModuleProvider,
|
||||
IMogoStatusChangedListener {
|
||||
IMogoStatusChangedListener,
|
||||
IMogoMapListener {
|
||||
private final String TAG = "V2XMocduleProvider";
|
||||
|
||||
private Context mContext;
|
||||
@@ -125,6 +130,9 @@ public class V2XModuleProvider implements
|
||||
handleAdas();
|
||||
initData();
|
||||
|
||||
|
||||
V2XServiceManager.getMogoRegisterCenter().registerMogoMapListener(V2XConst.MODULE_NAME, this);
|
||||
|
||||
// 注册广播接收场景弹窗使用的
|
||||
SceneBroadcastReceiver localReceiver = new SceneBroadcastReceiver();
|
||||
LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(context);
|
||||
@@ -145,16 +153,12 @@ public class V2XModuleProvider implements
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
//初始化获得自车求助状态
|
||||
initCarForHelpStatus();
|
||||
|
||||
try {
|
||||
// 查询ACC状态
|
||||
SharedPrefsMgr.getInstance(V2XUtils.getApp()).putBoolean("descriptor_ACC_STATUS", isAccOn());
|
||||
if (isAccOn()) {
|
||||
// 记录开机时间
|
||||
FatigueDrivingUtils.refreshAccOnTime();
|
||||
initCarForHelpStatus();
|
||||
// 刷新配置文件
|
||||
refreshStrategyConfig();
|
||||
} else {
|
||||
@@ -293,4 +297,40 @@ public class V2XModuleProvider implements
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
//初始化获得自车求助状态
|
||||
initCarForHelpStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTouch(MotionEvent motionEvent) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPOIClick(MogoPoi poi) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapClick(MogoLatLng latLng) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLockMap(boolean isLock) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapModeChanged(EnumMapUI ui) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapChanged(MogoLatLng latLng, float zoom, float tilt, float bearing) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,15 +50,19 @@ public class V2XSeekHelpButton implements IV2XButton {
|
||||
@Override
|
||||
public void show() {
|
||||
registerVoice();
|
||||
tv = V2XServiceManager.getMogoEntranceButtonController().getButton(ButtonIndex.BUTTON2);
|
||||
tv.setText("取消\n求助");
|
||||
tv.setVisibility(View.VISIBLE);
|
||||
tv.setBackgroundResource(R.drawable.bg_v2x_event_live_show);
|
||||
tv.setOnClickListener(v -> {
|
||||
//调用取消求助接口
|
||||
// TODO: 2020/5/18 回调,显示对话框
|
||||
doAction();
|
||||
});
|
||||
try {
|
||||
tv = V2XServiceManager.getMogoEntranceButtonController().getButton(ButtonIndex.BUTTON2);
|
||||
tv.setText("取消\n求助");
|
||||
tv.setVisibility(View.VISIBLE);
|
||||
tv.setBackgroundResource(R.drawable.bg_v2x_event_live_show);
|
||||
tv.setOnClickListener(v -> {
|
||||
//调用取消求助接口
|
||||
// TODO: 2020/5/18 回调,显示对话框
|
||||
doAction();
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -86,11 +86,9 @@ public class V2XSeekHelpDialog extends ConstraintLayout implements View.OnClickL
|
||||
try {
|
||||
Logger.d(TAG, "使用windowManager实现");
|
||||
if (!isShown) {
|
||||
if (windowManager == null) {
|
||||
windowManager = new WindowManagerView.Builder(
|
||||
V2XServiceManager.getMogoEntranceButtonController().getButton(ButtonIndex.BUTTON2).getContext()
|
||||
).contentView(this).build();
|
||||
}
|
||||
windowManager = new WindowManagerView.Builder(
|
||||
V2XServiceManager.getMogoEntranceButtonController().getButton(ButtonIndex.BUTTON2).getContext()
|
||||
).contentView(this).build();
|
||||
windowManager.show();
|
||||
isShown = true;
|
||||
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("确定要解除求助状态吗");
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
app:alignContent="flex_start"
|
||||
app:alignItems="center"
|
||||
app:flexDirection="row"
|
||||
android:paddingStart="@dimen/dp_150"
|
||||
app:flexWrap="wrap"
|
||||
app:justifyContent="flex_start">
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ public interface IMogoModuleProvider extends IProvider {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
IMogoMapListener getMapListener();
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,7 +9,9 @@ public
|
||||
*/
|
||||
interface IMogoTicketCallback {
|
||||
|
||||
void onSuccess( String ticket );
|
||||
void onTicketGot( String ticket );
|
||||
|
||||
void onError( int code, String msg );
|
||||
|
||||
void onLoginSuccess(String token, String sn);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user