Merge remote-tracking branch 'origin/qa_1.1.9' into qa_1.1.9

This commit is contained in:
tongchenfei
2021-01-11 14:18:25 +08:00
8 changed files with 58 additions and 13 deletions

View File

@@ -131,7 +131,7 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin
@Override
public void sendMsg(Object body, IMogoOnWebSocketMessageListener listener) {
Logger.d(TAG, "websocket sendMsg body = " + body);
// Logger.d(TAG, "websocket sendMsg body = " + body);
if (handlerThread != null) {
WebSocketData webSocketData = new WebSocketData();
webSocketData.setSeq(computeSendMsgTime());
@@ -145,7 +145,7 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin
webSocketData.setCityCode(null);
}
String msg = GsonUtil.jsonFromObject(webSocketData);
Logger.d(TAG,"sendMsg : " + msg);
// Logger.d(TAG,"sendMsg : " + msg);
handlerThread.sendMsg(msg);
}
}
@@ -184,10 +184,10 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin
@Override
public void handleMessage(String message) {
Logger.d(TAG, "websocket received msg = %s", message);
// Logger.d(TAG, "websocket received msg = %s", message);
WebSocketData webSocketData = GsonUtil.objectFromJson(message, WebSocketData.class);
int msgType = webSocketData.getMsgType();
Logger.d(TAG, "websocket received msg type = " + msgType);
// Logger.d(TAG, "websocket received msg type = " + msgType);
//服务端下发数据返回,上传数据回执默认不返回
if (msgType == MSG_TYPE_DOWNLINK_CAR_DATA.getMsgType()) {
List<IMogoOnWebSocketMessageListener> listeners = mListeners.get(msgType);
@@ -196,11 +196,11 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin
while (iterator.hasNext()) {
IMogoOnWebSocketMessageListener listener = iterator.next();
if (listener != null) {
Logger.d(TAG, "received msgId = " + webSocketData.getSeq() + ", content = %s", webSocketData.getData());
// Logger.d(TAG, "received msgId = " + webSocketData.getSeq() + ", content = %s", webSocketData.getData());
Object receiveObj = GsonUtil.objectFromJson(webSocketData.getData(),listener.target());
final long start = System.currentTimeMillis();
listener.onMsgReceived(receiveObj);
Logger.d("WebSocketManager-sdk-timer", "cost " + (System.currentTimeMillis() - start) + "ms");
// Logger.d("WebSocketManager-sdk-timer", "cost " + (System.currentTimeMillis() - start) + "ms");
}
}
}
@@ -208,11 +208,11 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin
if (webSocketData.getUtcTime() > 0) {
serverTime = webSocketData.getUtcTime();
receiveMsgTime = SystemClock.elapsedRealtime();
Logger.d(TAG, "设置serverTime");
// Logger.d(TAG, "设置serverTime");
if (webSocketData.getUpUtcTime() > 0) {
long nextDelay = webSocketData.getUpUtcTime() - serverTime;
MogoApisHandler.getInstance().getApis().getRefreshStrategyControllerApi().resetLocationUpDelay(nextDelay);
Logger.d(TAG, "重置下次上报时机: " + nextDelay);
// Logger.d(TAG, "重置下次上报时机: " + nextDelay);
}
}

View File

@@ -76,7 +76,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
private static final String TAG = "AMapNaviViewWrapper";
private final AMapNaviView mMapView;
private AMapNaviView mMapView;
private IMogoMap mIMap;
private AMapMarkerClickHandler mMarkerClickHandler;
@@ -239,8 +239,10 @@ public class AMapNaviViewWrapper implements IMogoMapView,
public void onDestroy() {
if ( mMapView != null ) {
mMapView.onDestroy();
mMapView = null;
AMapUIController.release();
AMapWrapper.release();
AMapMessageManager.getInstance().unregisterAMapMessageListener( this );
Logger.d( TAG, "map onDestroy" );
}
}

View File

@@ -3,6 +3,7 @@ package com.mogo.map;
import android.graphics.Point;
import android.graphics.Rect;
import android.location.Location;
import android.util.Log;
import android.view.View;
import android.view.animation.Interpolator;
@@ -55,6 +56,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void setTrafficEnabled( boolean visible ) {
initDelegate();
if ( mDelegate != null ) {
mDelegate.setTrafficEnabled( visible );
}
@@ -62,6 +64,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public MapControlResult changeZoom( boolean zoom ) {
initDelegate();
if ( mDelegate != null ) {
return mDelegate.changeZoom( zoom );
}
@@ -70,6 +73,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public MapControlResult changeZoom( float zoom ) {
initDelegate();
if ( mDelegate != null ) {
return mDelegate.changeZoom( zoom );
}
@@ -78,8 +82,8 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void changeMapMode( EnumMapUI mode ) {
initDelegate();
if ( mDelegate != null ) {
Logger.d( "whatthefuck-MogoMapUIController", "%s", this );
Logger.d( TAG, "set type: %s", mode.name() );
mDelegate.changeMapMode( mode );
}
@@ -88,6 +92,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void moveToCenter( MogoLatLng latLng, boolean animate ) {
initDelegate();
if ( mDelegate != null ) {
mDelegate.moveToCenter( latLng, animate );
}
@@ -95,6 +100,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void showMyLocation( boolean visible ) {
initDelegate();
if ( mDelegate != null ) {
mDelegate.showMyLocation( visible );
}
@@ -102,6 +108,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void emphasizeMyLocation() {
initDelegate();
if ( mDelegate != null ) {
mDelegate.emphasizeMyLocation();
}
@@ -109,6 +116,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void showMyLocation( View view ) {
initDelegate();
if ( mDelegate != null ) {
mDelegate.showMyLocation( view );
}
@@ -116,6 +124,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void recoverLockMode() {
initDelegate();
if ( mDelegate != null ) {
mDelegate.recoverLockMode();
}
@@ -123,6 +132,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void loseLockMode() {
initDelegate();
if ( mDelegate != null ) {
mDelegate.loseLockMode();
}
@@ -130,6 +140,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void setLockZoom( int var1 ) {
initDelegate();
if ( mDelegate != null ) {
mDelegate.setLockZoom( var1 );
}
@@ -137,6 +148,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void displayOverview( Rect bounds ) {
initDelegate();
if ( mDelegate != null ) {
mDelegate.displayOverview( bounds );
}
@@ -144,6 +156,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public float getScalePerPixel() {
initDelegate();
if ( mDelegate != null ) {
return mDelegate.getScalePerPixel();
}
@@ -152,6 +165,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public float getZoomLevel() {
initDelegate();
if ( mDelegate != null ) {
return mDelegate.getZoomLevel();
}
@@ -160,6 +174,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public MogoLatLng getCameraNorthEastPosition() {
initDelegate();
if ( mDelegate != null ) {
return mDelegate.getCameraNorthEastPosition();
}
@@ -168,6 +183,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public MogoLatLng getCameraSouthWestPosition() {
initDelegate();
if ( mDelegate != null ) {
return mDelegate.getCameraSouthWestPosition();
}
@@ -176,6 +192,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public MogoLatLng getWindowCenterLocation() {
initDelegate();
if ( mDelegate != null ) {
return mDelegate.getWindowCenterLocation();
}
@@ -184,6 +201,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void setPointToCenter( double mapCenterX, double mapCenterY ) {
initDelegate();
if ( mDelegate != null ) {
mDelegate.setPointToCenter( mapCenterX, mapCenterY );
}
@@ -191,6 +209,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public Point getLocationPointInScreen( MogoLatLng latLng ) {
initDelegate();
if ( mDelegate != null ) {
return mDelegate.getLocationPointInScreen( latLng );
}
@@ -199,6 +218,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public MogoLatLng getLocationMogoLatLngInScreen( Point point ) {
initDelegate();
if ( mDelegate != null ) {
return mDelegate.getLocationMogoLatLngInScreen( point );
}
@@ -207,6 +227,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void startJumpAnimation( IMogoMarker marker, float high, Interpolator interpolator, long duration ) {
initDelegate();
if ( mDelegate != null ) {
mDelegate.startJumpAnimation( marker, high, interpolator, duration );
}
@@ -214,6 +235,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void setRenderFps( int fps ) {
initDelegate();
if ( mDelegate != null ) {
mDelegate.setRenderFps( fps );
}
@@ -221,6 +243,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void showBounds( String tag, MogoLatLng carPosition, List< MogoLatLng > lonLats, Rect bound, boolean lockCarPosition ) {
initDelegate();
if ( mDelegate != null ) {
mDelegate.showBounds( tag, carPosition, lonLats, bound, lockCarPosition );
}
@@ -228,6 +251,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void forceRender() {
initDelegate();
if ( mDelegate != null ) {
mDelegate.forceRender();
}
@@ -235,6 +259,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public float calculateLineDistance( MogoLatLng p1, MogoLatLng p2 ) throws Exception {
initDelegate();
if ( mDelegate != null ) {
return mDelegate.calculateLineDistance( p1, p2 );
}
@@ -243,6 +268,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public EnumMapUI getCurrentUiMode() {
initDelegate();
if ( mDelegate != null ) {
return mDelegate.getCurrentUiMode();
}
@@ -251,6 +277,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void changeMyLocation( Location location ) {
initDelegate();
if ( mDelegate != null ) {
mDelegate.changeMyLocation( location );
}
@@ -258,6 +285,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public boolean isCarLocked() {
initDelegate();
if ( mDelegate != null ) {
return mDelegate.isCarLocked();
}
@@ -266,6 +294,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void setCarCursorOption( CarCursorOption option ) {
initDelegate();
if ( mDelegate != null ) {
mDelegate.setCarCursorOption( option );
}
@@ -273,6 +302,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public MapCameraPosition getMapCameraPosition() {
initDelegate();
if ( mDelegate != null ) {
return mDelegate.getMapCameraPosition();
}
@@ -281,6 +311,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void changeBearing( float bearing ) {
initDelegate();
if ( mDelegate != null ) {
mDelegate.changeBearing( bearing );
}
@@ -288,6 +319,7 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void rtkEnable( boolean enable ) {
initDelegate();
if ( mDelegate != null ) {
mDelegate.rtkEnable( enable );
}
@@ -296,7 +328,6 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void destroy() {
mDelegate = null;
release();
}
private void initDelegate() {

View File

@@ -367,6 +367,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
mMogoStatusManager.setMainPageLaunchedStatus( TAG, false );
mMogoStatusManager.setMainPageIsBackgroundStatus( TAG, false );
mMogoFragmentManager.unregisterMainFragmentStackTransactionListener();
mMogoFragmentManager.destroy();
mMogoFragmentManager = null;
mServiceApis.getMapServiceApi().getMapViewInstanceHandler().destroy();
mServiceApis.getMapServiceApi().getMapUIController().destroy();

View File

@@ -49,7 +49,7 @@ public class MogoRTKLocation {
mHandler.sendEmptyMessageDelayed(MSG_DATA_CHANGED, uploadDelay);
sendLocationData();
Logger.d(TAG,"handleMessage开始发送消息");
// Logger.d(TAG,"handleMessage开始发送消息");
}
}
};

View File

@@ -78,4 +78,6 @@ public interface IMogoFragmentManager extends IProvider {
void initMessageHistoryContainerId( int layoutId );
int getMessageHistoryContainerId();
void destroy();
}

View File

@@ -48,7 +48,7 @@ public class FragmentStack {
return sInstance;
}
public synchronized void release() {
public static synchronized void release() {
sInstance = null;
}
@@ -199,4 +199,8 @@ public class FragmentStack {
}
invokeCallback();
}
public void destroy(){
mFragmentManager = null;
}
}

View File

@@ -74,6 +74,11 @@ public class MogoFragmentManager implements IMogoFragmentManager {
return FragmentStack.getInstance().getMessageHistoryContainerId();
}
@Override
public void destroy() {
FragmentStack.getInstance().destroy();
}
@Override
public void init( Context context ) {