From 108dd30e3818db9d2b494963872c2f4bbb0869f9 Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Mon, 31 Aug 2020 10:40:18 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E4=B8=8A=E6=8A=A5?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=EF=BC=8C=E6=A3=80=E6=9F=A5=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/module/share/manager/UploadHelper.kt | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/UploadHelper.kt b/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/UploadHelper.kt index 770b17831e..9727027167 100644 --- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/UploadHelper.kt +++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/UploadHelper.kt @@ -9,6 +9,7 @@ import com.mogo.map.location.MogoLocation import com.mogo.module.share.ShareControl import com.mogo.module.share.dialog.LaucherShareDialog import com.mogo.service.tanlu.TanluUploadParams +import com.mogo.utils.NetworkUtils import com.mogo.utils.TipToast import com.mogo.utils.logger.Logger @@ -21,21 +22,22 @@ object UploadHelper { Logger.d("UploadHelper", "正在上报===") TipToast.tip("正在上报,请稍后重试") }else { - ServiceApisManager.serviceApis.statusManagerApi.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true) - if(DebugConfig.getAIType() == DebugConfig.AI_TYPE_TXZ||forcePlayVoice) { - AIAssist.getInstance(context).speakTTSVoice("感谢分享,正在上传") + // 判断当前网络状态 + if(NetworkUtils.isConnected(context)) { + // 有网就正常上报 + ServiceApisManager.serviceApis.statusManagerApi.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true) + if (DebugConfig.getAIType() == DebugConfig.AI_TYPE_TXZ || forcePlayVoice) { + AIAssist.getInstance(context).speakTTSVoice("感谢分享,正在上传") + } + val location = ServiceApisManager.serviceApis.mapServiceApi.getSingletonLocationClient(context).lastKnowLocation + val latLon = MogoLatLng(location.latitude, location.longitude) + type.location = latLon + Logger.d("UploadHelper", "upload ----> $type") + ServiceApisManager.serviceApis.tanluApi.uploadRoadCondition(type) + }else{ + // 没网就直接提示失败 + AIAssist.getInstance(context).speakTTSVoice("分享失败,请检查网络") } - val location = ServiceApisManager.serviceApis.mapServiceApi.getSingletonLocationClient(context).lastKnowLocation - val latLon = MogoLatLng(location.latitude, location.longitude) - type.location = latLon - Logger.d("UploadHelper", "upload ----> $type") - ServiceApisManager.serviceApis.tanluApi.uploadRoadCondition(type) -// val intent = Intent() -// intent.action = "com.zhidao.share.roadcondition.action" -// intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND) -// intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES) -// intent.putExtra("type", type) -// context.sendBroadcast(intent) } } } \ No newline at end of file From 6f60672667f907a77e5c2ff202a95303b1941e2c Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Mon, 31 Aug 2020 11:32:32 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AD=96=E7=95=A5?= =?UTF-8?q?=E4=B8=8A=E6=8A=A5=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/zhidao/roadcondition/constant/Const.kt | 5 +++++ .../zhidao/roadcondition/service/CarCorderController.kt | 9 ++++++--- .../zhidao/roadcondition/service/CustomStatusHandler.kt | 2 +- .../java/com/mogo/service/tanlu/IMogoTanluProvider.java | 6 ++++++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/constant/Const.kt b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/constant/Const.kt index 889aedacc7..cd278e9299 100644 --- a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/constant/Const.kt +++ b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/constant/Const.kt @@ -68,6 +68,11 @@ const val UPLOAD_FROM_STRATEGY_CLOUD_CHECK = "4" */ const val UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO = "5" +/** + * 策略上报集合 + */ +val STRATEGY_UPLOAD_TYPE_ARRAY = arrayOf(UPLOAD_FROM_STRATEGY_BLOCK_AUTO, + UPLOAD_FROM_STRATEGY_CLOUD_CHECK, UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO) /** * 默认视频抓取时长,单位是秒 */ diff --git a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CarCorderController.kt b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CarCorderController.kt index 7ae76ba6e8..845db90855 100644 --- a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CarCorderController.kt +++ b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CarCorderController.kt @@ -9,7 +9,6 @@ import com.mogo.utils.NetworkUtils import com.zhidao.auto.carcorder.callback.TakePhotoCallback import com.zhidao.auto.carcorder.callback.TakeVideoCallback import com.zhidao.auto.carcorder.controller.ZdCarCoderController -import com.zhidao.roadcondition.BuildConfig import com.zhidao.roadcondition.constant.* import com.zhidao.roadcondition.event.GetImageSuccessEvent import com.zhidao.roadcondition.event.LatLngStickyEventBus @@ -109,7 +108,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { this.mLatitude = latitude if (DebugConfig.getCarMachineType() == 0) { //自研车机 outputVideoPath = getCompressVideoPath() - CustomStatusHandler.offerVideoStatus(TakeEntity(isCustom, id)) + CustomStatusHandler.offerVideoStatus(TakeEntity(isCustom, id,fromType)) zdCarCoderController.takeVideo(cameraId, duration) trackGetVideo(1) } else { //比亚迪 @@ -118,7 +117,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { // TipToast.shortTip("分享失败,请检查网络") // } else { //失败了,传空地址,发起请求 - val entity = TakeEntity(isCustom, id) + val entity = TakeEntity(isCustom, id,fromType) videoAndThumbMap["video"] = "" videoAndThumbMap["thumb"] = "" @@ -272,6 +271,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { } } + //获取视频成功 override fun onTakeVideoSuccess(camera: Int, videoPath: String?) { var thumbnailPath = @@ -304,6 +304,9 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { entity?.let { if (entity.isCustom) { compressVideo(videoPath, thumbnailPath, entity) + }else if (entity.fromType in STRATEGY_UPLOAD_TYPE_ARRAY) { + // 属于策略上报 + compressVideo(videoPath, thumbnailPath, entity) } else { Log.d( TAG, diff --git a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CustomStatusHandler.kt b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CustomStatusHandler.kt index bd0d63ba14..65955f847b 100644 --- a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CustomStatusHandler.kt +++ b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CustomStatusHandler.kt @@ -27,5 +27,5 @@ object CustomStatusHandler { } class TakeEntity( - var isCustom: Boolean, var id: Long + var isCustom: Boolean, var id: Long, var fromType: String = "0" ) \ No newline at end of file diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/tanlu/IMogoTanluProvider.java b/services/mogo-service-api/src/main/java/com/mogo/service/tanlu/IMogoTanluProvider.java index 6fd2b2af19..2ea236564c 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/tanlu/IMogoTanluProvider.java +++ b/services/mogo-service-api/src/main/java/com/mogo/service/tanlu/IMogoTanluProvider.java @@ -66,6 +66,12 @@ public interface IMogoTanluProvider extends IProvider { */ String UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO = "5"; + /** + * 策略上报集合 + */ + String[] STRATEGY_UPLOAD_TYPE_ARRAY = new String[]{UPLOAD_FROM_STRATEGY_BLOCK_AUTO, + UPLOAD_FROM_STRATEGY_CLOUD_CHECK, UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO}; + /** * 默认视频抓取时长 */ From 7918bdb7917c6486d71d1dbb3b9f36b9dbc5569e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Mon, 31 Aug 2020 11:51:00 +0800 Subject: [PATCH 3/8] Fix current car seek help status refresh --- .idea/codeStyles/Project.xml | 18 ++++++++++++++++++ app/src/e8xx/AndroidManifest.xml | 1 - .../com/mogo/module/v2x/V2XModuleProvider.java | 14 ++++++-------- .../scene/help/V2XCarForHelpScenario.java | 1 - .../{seek => help}/V2XSeekHelpDialog.java | 2 +- 5 files changed, 25 insertions(+), 11 deletions(-) rename modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/{seek => help}/V2XSeekHelpDialog.java (99%) diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 681f41ae2a..0d156937bb 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,5 +1,23 @@ + + + +