Merge remote-tracking branch 'origin/qa_1.1.9' into qa_1.1.9
This commit is contained in:
@@ -61,6 +61,7 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
|
||||
|
||||
public void release() {
|
||||
MogoApisHandler.getInstance().getApis().getWebSocketManagerApi(mContext).unregisterOnWebSocketMessageListener(this);
|
||||
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().unregisterMogoMarkerClickListener( PushDataType.TYPE_PUSH_CAMERA_DATA );
|
||||
mCloudRoadData = null;
|
||||
mContext = null;
|
||||
}
|
||||
|
||||
@@ -26,11 +26,9 @@ import com.mogo.service.module.ModuleType;
|
||||
@Route( path = MogoModulePaths.PATH_MODULE_MAP )
|
||||
public class MapFragmentProvider implements IMogoModuleProvider {
|
||||
|
||||
private MapFragment mMapFragment;
|
||||
|
||||
@Override
|
||||
public Fragment createFragment( Context context, Bundle data ) {
|
||||
mMapFragment = new MapFragment();
|
||||
MapFragment mMapFragment = new MapFragment();
|
||||
mMapFragment.setArguments( data );
|
||||
return mMapFragment;
|
||||
}
|
||||
@@ -94,6 +92,5 @@ public class MapFragmentProvider implements IMogoModuleProvider {
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
mMapFragment = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,10 @@ private const val MORNING_PEAK_STOP_MINUTE = 9 * 60 + 30
|
||||
private const val NIGHT_PEAK_START_MINUTE = 17 * 60 + 30
|
||||
private const val NIGHT_PEAK_STOP_MINUTE = 19 * 60 + 30
|
||||
|
||||
private const val NORMAL_UPLOAD_COUNT = 5 // 5
|
||||
private const val MORNING_PEAK_UPLOAD_COUNT = 2 // 2
|
||||
private const val NIGHT_PEAK_UPLOAD_COUNT = 3 // 3
|
||||
|
||||
private const val DISTANCE_MORNING_PEAK_COUNT = "DISTANCE_MORNING_PEAK_COUNT"
|
||||
private const val DISTANCE_NIGHT_PEAK_COUNT = "DISTANCE_NIGHT_PEAK_COUNT"
|
||||
private const val DISTANCE_NORMAL_COUNT = "DISTANCE_NORMAL_COUNT"
|
||||
@@ -167,7 +171,7 @@ class BlockStrategy(private val context: Context, private val apis: IMogoService
|
||||
if (isMorningPeak()) {
|
||||
val distanceMorningCount = SharedPrefsMgr.getInstance(context).getInt(DISTANCE_MORNING_PEAK_COUNT, 0)
|
||||
val speedMorningCount = SharedPrefsMgr.getInstance(context).getInt(SPEED_MORNING_PEAK_COUNT, 0)
|
||||
if (blockFromDistance && distanceMorningCount < 2) {
|
||||
if (blockFromDistance && distanceMorningCount < MORNING_PEAK_UPLOAD_COUNT) {
|
||||
Logger.d(TAG, "按距离策略上报早高峰")
|
||||
SharedPrefsMgr.getInstance(context).putInt(DISTANCE_MORNING_PEAK_COUNT, distanceMorningCount + 1)
|
||||
p.location = latLonFromDistance
|
||||
@@ -175,7 +179,7 @@ class BlockStrategy(private val context: Context, private val apis: IMogoService
|
||||
apis.tanluApi.uploadRoadCondition(p)
|
||||
return
|
||||
}
|
||||
if (blockFromSpeed && speedMorningCount < 2) {
|
||||
if (blockFromSpeed && speedMorningCount < MORNING_PEAK_UPLOAD_COUNT) {
|
||||
Logger.d(TAG, "按速度策略上报早高峰")
|
||||
SharedPrefsMgr.getInstance(context).putInt(SPEED_MORNING_PEAK_COUNT, speedMorningCount + 1)
|
||||
p.location = latLonFromSpeed
|
||||
@@ -185,7 +189,7 @@ class BlockStrategy(private val context: Context, private val apis: IMogoService
|
||||
} else if (isNightPeak()) {
|
||||
val distanceNightCount = SharedPrefsMgr.getInstance(context).getInt(DISTANCE_NIGHT_PEAK_COUNT, 0)
|
||||
val speedNightCount = SharedPrefsMgr.getInstance(context).getInt(SPEED_NIGHT_PEAK_COUNT, 0)
|
||||
if (blockFromDistance && distanceNightCount < 3) {
|
||||
if (blockFromDistance && distanceNightCount < NIGHT_PEAK_UPLOAD_COUNT) {
|
||||
Logger.d(TAG, "按距离策略上报晚高峰")
|
||||
SharedPrefsMgr.getInstance(context).putInt(DISTANCE_NIGHT_PEAK_COUNT, distanceNightCount + 1)
|
||||
p.location = latLonFromDistance
|
||||
@@ -193,7 +197,7 @@ class BlockStrategy(private val context: Context, private val apis: IMogoService
|
||||
apis.tanluApi.uploadRoadCondition(p)
|
||||
return
|
||||
}
|
||||
if (blockFromSpeed && speedNightCount < 3) {
|
||||
if (blockFromSpeed && speedNightCount < NIGHT_PEAK_UPLOAD_COUNT) {
|
||||
Logger.d(TAG, "按速度策略上报晚高峰")
|
||||
SharedPrefsMgr.getInstance(context).putInt(SPEED_NIGHT_PEAK_COUNT, speedNightCount + 1)
|
||||
p.location = latLonFromSpeed
|
||||
@@ -203,7 +207,7 @@ class BlockStrategy(private val context: Context, private val apis: IMogoService
|
||||
} else {
|
||||
val distanceNormalCount = SharedPrefsMgr.getInstance(context).getInt(DISTANCE_NORMAL_COUNT, 0)
|
||||
val speedNormalCount = SharedPrefsMgr.getInstance(context).getInt(SPEED_NORMAL_COUNT, 0)
|
||||
if (blockFromDistance && distanceNormalCount < 5) {
|
||||
if (blockFromDistance && distanceNormalCount < NORMAL_UPLOAD_COUNT) {
|
||||
Logger.d(TAG, "按距离策略上报一般时段")
|
||||
SharedPrefsMgr.getInstance(context).putInt(DISTANCE_NORMAL_COUNT, distanceNormalCount + 1)
|
||||
p.location = latLonFromDistance
|
||||
@@ -211,7 +215,7 @@ class BlockStrategy(private val context: Context, private val apis: IMogoService
|
||||
apis.tanluApi.uploadRoadCondition(p)
|
||||
return
|
||||
}
|
||||
if (blockFromSpeed && speedNormalCount < 5) {
|
||||
if (blockFromSpeed && speedNormalCount < NORMAL_UPLOAD_COUNT) {
|
||||
Logger.d(TAG, "按速度策略上报一般时段")
|
||||
SharedPrefsMgr.getInstance(context).putInt(SPEED_NORMAL_COUNT, speedNormalCount + 1)
|
||||
p.location = latLonFromSpeed
|
||||
|
||||
Reference in New Issue
Block a user