1. 优化模块加载、去掉部分逻辑、升级socket版本号

This commit is contained in:
wangcongtao
2020-11-23 17:49:55 +08:00
parent d8eb3569b9
commit 0a3c77cef0
23 changed files with 122 additions and 95 deletions

View File

@@ -37,8 +37,7 @@ public class AnimRes {
R.drawable.mogo_tts_icon_00008,
R.drawable.mogo_tts_icon_00009,
R.drawable.mogo_tts_icon_00010,
R.drawable.mogo_tts_icon_00011
}, {
R.drawable.mogo_tts_icon_00011,
R.drawable.mogo_tts_icon_00012,
R.drawable.mogo_tts_icon_00013,
R.drawable.mogo_tts_icon_00014,
@@ -50,8 +49,7 @@ public class AnimRes {
R.drawable.mogo_tts_icon_00020,
R.drawable.mogo_tts_icon_00021,
R.drawable.mogo_tts_icon_00022,
R.drawable.mogo_tts_icon_00023
}, {
R.drawable.mogo_tts_icon_00023,
R.drawable.mogo_tts_icon_00024,
R.drawable.mogo_tts_icon_00025,
R.drawable.mogo_tts_icon_00026,
@@ -63,8 +61,7 @@ public class AnimRes {
R.drawable.mogo_tts_icon_00032,
R.drawable.mogo_tts_icon_00033,
R.drawable.mogo_tts_icon_00034,
R.drawable.mogo_tts_icon_00035
}, {
R.drawable.mogo_tts_icon_00035,
R.drawable.mogo_tts_icon_00036,
R.drawable.mogo_tts_icon_00037,
R.drawable.mogo_tts_icon_00038,
@@ -76,8 +73,7 @@ public class AnimRes {
R.drawable.mogo_tts_icon_00044,
R.drawable.mogo_tts_icon_00045,
R.drawable.mogo_tts_icon_00046,
R.drawable.mogo_tts_icon_00047
}, {
R.drawable.mogo_tts_icon_00047,
R.drawable.mogo_tts_icon_00048,
R.drawable.mogo_tts_icon_00049,
R.drawable.mogo_tts_icon_00050,
@@ -89,8 +85,7 @@ public class AnimRes {
R.drawable.mogo_tts_icon_00056,
R.drawable.mogo_tts_icon_00057,
R.drawable.mogo_tts_icon_00058,
R.drawable.mogo_tts_icon_00059
}, {
R.drawable.mogo_tts_icon_00059,
R.drawable.mogo_tts_icon_00060,
R.drawable.mogo_tts_icon_00061,
R.drawable.mogo_tts_icon_00062,

View File

@@ -70,7 +70,7 @@ public class OthersAnim implements Anim {
}
mStarted = true;
mHandler.sendEmptyMessage( MSG_LOOP );
mHandler.sendEmptyMessageDelayed( MSG_CHANGE, 60 * 1_000L );
// mHandler.sendEmptyMessageDelayed( MSG_CHANGE, 60 * 1_000L );
}
@Override

View File

@@ -258,17 +258,18 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
mStatusManager.setDisplayOverview(TAG, false);
UiThreadHandler.removeCallbacks(mLockCarRunnable);
}
if ( mIsLock ) {
if ( mMApUIController.getCurrentUiMode() == EnumMapUI.CarUp_2D ) {
mMApUIController.changeMapMode( EnumMapUI.NorthUP_2D );
} else if( mMApUIController.getCurrentUiMode() == EnumMapUI.NorthUP_2D ){
mMApUIController.changeMapMode( EnumMapUI.CarUp_2D );
}
} else {
if ( !mApis.getRefreshStrategyControllerApi().restartAutoRefreshAtTime( 0 ) ) {
mStatusManager.setUserInteractionStatus(TAG, true, false);
mMApUIController.recoverLockMode();
}
// if ( mIsLock ) {
// if ( mMApUIController.getCurrentUiMode() == EnumMapUI.CarUp_2D ) {
// mMApUIController.changeMapMode( EnumMapUI.NorthUP_2D );
// } else if( mMApUIController.getCurrentUiMode() == EnumMapUI.NorthUP_2D ){
// mMApUIController.changeMapMode( EnumMapUI.CarUp_2D );
// }
// } else {
//
// }
if ( !mApis.getRefreshStrategyControllerApi().restartAutoRefreshAtTime( 0 ) ) {
mStatusManager.setUserInteractionStatus(TAG, true, false);
mMApUIController.recoverLockMode();
}
}
} );
@@ -753,16 +754,15 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
} else {
mExitNavi.setText(R.string.module_ext_str_continue_navi);
}
if ( isLock ) {
if ( mMApUIController.getCurrentUiMode() == EnumMapUI.CarUp_2D ) {
mMove2CurrentLocation.setImageResource( R.drawable.icon_north_up );
} else {
mMove2CurrentLocation.setImageResource( R.drawable.icon_car_up );
}
} else {
mMove2CurrentLocation.setImageResource( R.drawable.module_map_ic_move2_current_location );
}
// if ( isLock ) {
// if ( mMApUIController.getCurrentUiMode() == EnumMapUI.CarUp_2D ) {
// mMove2CurrentLocation.setImageResource( R.drawable.icon_north_up );
// } else {
// mMove2CurrentLocation.setImageResource( R.drawable.icon_car_up );
// }
// } else {
// mMove2CurrentLocation.setImageResource( R.drawable.module_map_ic_move2_current_location );
// }
}
private void traceData(String from) {
@@ -986,11 +986,11 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
mCameraMode.setSelected(ui == EnumMapUI.NorthUP_2D);
mCameraMode.setText(getString(ui == EnumMapUI.NorthUP_2D ? R.string.mode_car_up : R.string.mode_north_up));
if ( ui == EnumMapUI.CarUp_2D ) {
mMove2CurrentLocation.setImageResource( R.drawable.icon_north_up );
} else if( ui == EnumMapUI.NorthUP_2D ){
mMove2CurrentLocation.setImageResource( R.drawable.icon_car_up );
}
// if ( ui == EnumMapUI.CarUp_2D ) {
// mMove2CurrentLocation.setImageResource( R.drawable.icon_north_up );
// } else if( ui == EnumMapUI.NorthUP_2D ){
// mMove2CurrentLocation.setImageResource( R.drawable.icon_car_up );
// }
}
private static int SEEK_HELP_NOTICE_NUM_MSG_TYPE = 401015;

View File

@@ -370,5 +370,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
SchemeIntent.getInstance().clear();
FloatingViewHandler.clear();
mServiceApis.getShareManager().releaseContext();
mServiceApis.getSkinSupportInstallerApi().onDestroy();
}
}

View File

@@ -12,6 +12,7 @@ import com.mogo.map.IMogoUiSettings;
import com.mogo.map.MogoMapView;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.map.MyLocationUtil;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
@@ -135,6 +136,10 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements
uiSettings.setZoomGesturesEnabled( true );
mMogoMap.getUIController().changeMapMode( EnumMapUI.NorthUP_2D );
}
final EnumMapUI mapUI = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getCurrentSkinMode();
getUIController().changeMapMode( mapUI );
}
}

View File

@@ -294,9 +294,6 @@ public class MapPresenter extends Presenter< MapView > implements
mCustomVoiceCommandHandler = new MapControlCommandHandler();
mCustomVoiceCommandHandler.setCallback( this );
mRegisterCenter.registerADASControlStatusChangedListener( TAG, this );
final EnumMapUI mapUI = mApis.getAdasControllerApi().getCurrentSkinMode();
mMogoMapService.getMapUIController().changeMapMode( mapUI );
}
private void initBroadcast() {

View File

@@ -67,6 +67,8 @@ class LauncherCardRefresher {
public static final int MSG_REFRESH_ADVERTISEMENT = 2022;
// 加载网络配置数据
public static final int MSG_LOAD_NET_CONFIG = 2023;
// 加载网络配置数据2
public static final int MSG_LOAD_NET_CONFIG2 = 2026;
// 默认播报
public static final int MSG_START_LOOP_DEFAULT_CARD = 2024;
// 等待网络
@@ -129,6 +131,9 @@ class LauncherCardRefresher {
case MSG_LOAD_NET_CONFIG:
loadNetworkConfigStrategy();
break;
case MSG_LOAD_NET_CONFIG2:
requestTtsStrategyConfig();
break;
case MSG_REFRESH_DEFAULT_CARD:
renderDefaultLauncherCardConfig( false );
mRefreshStrategy = mRefreshStrategy.getNext();
@@ -181,6 +186,7 @@ class LauncherCardRefresher {
.getSingletonLocationClient( mContext )
.getLastKnowLocation() != null ) {
mHandler.sendEmptyMessageDelayed( MSG_LOAD_NET_CONFIG, 0L );
mHandler.sendEmptyMessageDelayed( MSG_LOAD_NET_CONFIG2, 2 * ONE_MINUTE );
} else {
mHandler.sendEmptyMessageDelayed( MSG_WAIT_NETWORK, 10 * ONE_SECOND );
}
@@ -206,6 +212,7 @@ class LauncherCardRefresher {
mHandler.removeMessages( MSG_START_LOOP_DEFAULT_CARD );
mHandler.removeMessages( MSG_REFRESH_ADVERTISEMENT );
mHandler.removeMessages( MSG_LOAD_NET_CONFIG );
mHandler.removeMessages( MSG_LOAD_NET_CONFIG2 );
mHandler.removeMessages( MSG_WAIT_NETWORK );
Logger.d( TAG, "stop" );
}
@@ -329,7 +336,6 @@ class LauncherCardRefresher {
*/
private void loadNetworkConfigStrategy() {
loadAdvertisementConfig();
requestTtsStrategyConfig();
}
/**
@@ -397,6 +403,8 @@ class LauncherCardRefresher {
.addType( LauncherCardRefreshType.ExplorerWay.getVal() )
.addType( LauncherCardRefreshType.Weather.getVal() )
.sn( Utils.getSn() )
.cityCode( location.getCityCode() )
.cityName( location.getCityName() )
.location( new MogoLatLng( location.getLatitude(), location.getLongitude() ) );
final Map< String, Object > query = new ParamsProvider.Builder( mContext )
.append( "data", GsonUtil.jsonFromObject( body ) )

View File

@@ -425,7 +425,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
mogoMarker = drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_HIGH );
}
} catch ( Exception e ) {
e.printStackTrace();
}
}
}

View File

@@ -20,6 +20,18 @@ class TtsConfigBody implements Parcelable {
private MogoLatLng location;
private List< String > dataType;
private String sn;
private String cityCode;
private String cityName;
public TtsConfigBody cityCode( String cityCode ) {
this.cityCode = cityCode;
return this;
}
public TtsConfigBody cityName( String cityName ) {
this.cityName = cityName;
return this;
}
public TtsConfigBody addType( String type ) {
if ( dataType == null ) {
@@ -40,6 +52,9 @@ class TtsConfigBody implements Parcelable {
}
public TtsConfigBody() {
}
@Override
public int describeContents() {
return 0;
@@ -50,15 +65,16 @@ class TtsConfigBody implements Parcelable {
dest.writeParcelable( this.location, flags );
dest.writeStringList( this.dataType );
dest.writeString( this.sn );
}
public TtsConfigBody() {
dest.writeString( this.cityCode );
dest.writeString( this.cityName );
}
protected TtsConfigBody( Parcel in ) {
this.location = in.readParcelable( MogoLatLng.class.getClassLoader() );
this.dataType = in.createStringArrayList();
this.sn = in.readString();
this.cityCode = in.readString();
this.cityName = in.readString();
}
public static final Creator< TtsConfigBody > CREATOR = new Creator< TtsConfigBody >() {