bugfix: UI-859
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package com.mogo.base.services;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/7/23
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
interface BaseServicesConstants {
|
||||
|
||||
/**
|
||||
* 建立长链的通道ID
|
||||
*/
|
||||
String SOCKET_CHANNEL_ID = "dataCrawler";
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import android.content.Context;
|
||||
import androidx.annotation.Keep;
|
||||
|
||||
import com.elegant.spi.annotations.Service;
|
||||
import com.mogo.base.services.BaseServicesConstants;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.service.locationinfo.IMogoLocationInfoService;
|
||||
@@ -52,7 +53,7 @@ class MogoLocationInfoServices implements IMogoLocationInfoService {
|
||||
@Override
|
||||
public void provideLocation( MogoLocation location ) {
|
||||
mLocation = location;
|
||||
Logger.d(TAG, "sdk - provideLocation");
|
||||
Logger.d( TAG, "sdk - provideLocation" );
|
||||
}
|
||||
|
||||
public MogoLocation getLocation() {
|
||||
@@ -62,25 +63,26 @@ class MogoLocationInfoServices implements IMogoLocationInfoService {
|
||||
@Override
|
||||
public void start() {
|
||||
LocUploadManager.getInstance().startUpload();
|
||||
Logger.d(TAG, "sdk - start");
|
||||
Logger.d( TAG, "sdk - start" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
LocUploadManager.getInstance().stopUpload();
|
||||
Logger.d(TAG, "sdk - stop");
|
||||
Logger.d( TAG, "sdk - stop" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
LocUploadConfig.instance().
|
||||
setAppId( DebugConfig.getSocketAppId() ).
|
||||
setSocketChannelId( BaseServicesConstants.SOCKET_CHANNEL_ID ).
|
||||
setContext( context.getApplicationContext() ).
|
||||
setLocEnvironment( getEnvironment() ).
|
||||
setLoggable( DebugConfig.isDebug() ).
|
||||
setPlatform( Platform.car ).
|
||||
setLocInterval( 2000L );
|
||||
Logger.d(TAG, "sdk - init");
|
||||
Logger.d( TAG, "sdk - init" );
|
||||
}
|
||||
|
||||
private LocEnvironment getEnvironment() {
|
||||
|
||||
@@ -7,7 +7,9 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.mogo.base.services.BaseServicesConstants;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.network.Utils;
|
||||
import com.mogo.service.connection.IMogoMsgAckListener;
|
||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
import com.mogo.service.connection.IMogoSocketManager;
|
||||
@@ -86,8 +88,9 @@ class SocketManager implements IMogoSocketManager, Callback {
|
||||
.setAppContext( context.getApplicationContext() )
|
||||
.setEnvironment( getEnvironment() )
|
||||
.setClient( Platform.getClient( Platform.car ) )
|
||||
.setAppId( appId )
|
||||
// .setOpenAnalytics( true )
|
||||
.setChannelId( BaseServicesConstants.SOCKET_CHANNEL_ID )
|
||||
.setOpenAnalytics( true )
|
||||
.setSn( Utils.getSn() )
|
||||
.setDebug( DebugConfig.isDebug() );
|
||||
SocketMessageDispatcher.getInstance().start( context );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user