增加 根据服务端下发的上报时间,重置本地轮询上报时间间隔
This commit is contained in:
@@ -45,8 +45,8 @@ public class MogoRTKLocation {
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
if (msg.what == MSG_DATA_CHANGED) {
|
||||
sendLocationData();
|
||||
mHandler.sendEmptyMessageDelayed(MSG_DATA_CHANGED, uploadDelay);
|
||||
sendLocationData();
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -159,4 +159,15 @@ public class MogoRTKLocation {
|
||||
uploadDelay = intent.getIntExtra("fixTime", 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认保持{@link #uploadDelay}间隔进行位置上报,如遇服务端控制,进行上报间隔修改
|
||||
* @param delay 上报间隔
|
||||
*/
|
||||
public void resetUploadDelay(long delay) {
|
||||
if (mHandler != null && mHandler.hasMessages(MSG_DATA_CHANGED)) {
|
||||
mHandler.removeMessages(MSG_DATA_CHANGED);
|
||||
mHandler.sendEmptyMessageDelayed(MSG_DATA_CHANGED, delay);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.module.service.MogoServices;
|
||||
import com.mogo.module.service.location.MogoRTKLocation;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.strategy.IMogoRefreshStrategyController;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -33,6 +34,11 @@ public class MogoRefreshStrategyController implements IMogoRefreshStrategyContro
|
||||
MogoServices.getInstance().clearAllData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetLocationUpDelay(long delay) {
|
||||
MogoRTKLocation.getInstance().resetUploadDelay(delay);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user