From 5830d8cc42c9046bdc6d5015db4ba8b2ec17695f Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Fri, 28 Aug 2020 15:17:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=96=E7=95=A5=E4=B8=8A=E6=8A=A5=EF=BC=9A?= =?UTF-8?q?=E6=8B=A5=E5=A0=B5=E8=81=94=E8=B0=83=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/zhidao/roadcondition/service/MainService.kt | 3 ++- .../com/mogo/module/share/strategyreceiver/BlockStrategy.kt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/MainService.kt b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/MainService.kt index 15a67e4a3b..7e734f6140 100644 --- a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/MainService.kt +++ b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/MainService.kt @@ -248,6 +248,7 @@ class MainService : Service() { getStrategyType("video") ) Log.d("MainService", "handleReportStrategy picType = $picType ---videoType = $videoType") + shareType = TANLU_ROAD_CURRENT if (picType == 1) { takePhoto(1) } else if (picType == 2) { @@ -302,7 +303,7 @@ class MainService : Service() { Log.d("MainService", "takeVideo --------1---->") // if (isAuthorization(BaseApplication.getAppContext())) { // log(TAG, "takeVideo --------2---->") - CarCorderController.takeVideo(1, duration, isCustom, id, if (isCustom) shareType else TANLU_ROAD_CURRENT, mainInfoId, fromType, mLongitude, mLatitude) + CarCorderController.takeVideo(1, duration, isCustom, id, shareType, mainInfoId, fromType, mLongitude, mLatitude) // } postVideoAlarmTask(isInterval) diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/strategyreceiver/BlockStrategy.kt b/modules/mogo-module-share/src/main/java/com/mogo/module/share/strategyreceiver/BlockStrategy.kt index 1d4ef2cf98..1cc241dddc 100644 --- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/strategyreceiver/BlockStrategy.kt +++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/strategyreceiver/BlockStrategy.kt @@ -70,7 +70,8 @@ class BlockStrategy(private val context: Context, private val apis: IMogoService if (speed == 0F) { stopFlag++ - } else { + } else if (stopFlag < STOP_FLAG_THRESHOLD) { + // 如果本次计算期间,stopFlag还没超过阈值,就置为零,如果超过阈值了,说明本次计算期间存在超过阈值的停止次数,就舍弃掉本次计算 stopFlag = 0 }