1. 优化模块加载、去掉部分逻辑、升级socket版本号
This commit is contained in:
@@ -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 ) )
|
||||
|
||||
@@ -425,7 +425,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
mogoMarker = drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_HIGH );
|
||||
}
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 >() {
|
||||
|
||||
Reference in New Issue
Block a user