This commit is contained in:
lixiaopeng
2021-12-23 14:31:38 +08:00
parent 1d8470046c
commit 245d1339eb
7 changed files with 11 additions and 119 deletions

View File

@@ -57,13 +57,10 @@ dependencies {
implementation rootProject.ext.dependencies.rxjava
implementation rootProject.ext.dependencies.rxandroid
implementation rootProject.ext.dependencies.mogoaicloudtanlu
implementation rootProject.ext.dependencies.analytics
implementation rootProject.ext.dependencies.eventbus
implementation rootProject.ext.dependencies.coroutinescore
implementation rootProject.ext.dependencies.coroutinesandroid
// implementation rootProject.ext.dependencies.retrofit
// implementation rootProject.ext.dependencies.retrofitconvertergson
implementation 'com.zhidaoauto.controller:api:1.0.8'
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {

View File

@@ -83,11 +83,7 @@ import io.reactivex.schedulers.Schedulers;
@Route(path = MogoServicePaths.PATH_SHARE)
public class ShareControl implements IMogoShareManager, Handler.Callback {
private static final String TAG = "ShareControl";
// private static final int MSG_REAL_QUERY_SHARE_CONFIG = 1001;
// private static final long QUERY_SHARE_CONFIG_DELAY = 3_000L;
private Context mContext;
// private LaucherShareDialog mShareDialog;
private BaseFloatDialog mShareDialog;

View File

@@ -81,7 +81,6 @@ import static com.mogo.module.share.constant.ShareConstants.VOICE_COMMAND_QUERY_
* @description 探路和新鲜事的view
* @since 2020/5/19
*/
public class TanluManager implements IMogoMarkerClickListener,
IMogoPoiSearchListener,
IMogoGeoSearchListener {
@@ -338,6 +337,7 @@ public class TanluManager implements IMogoMarkerClickListener,
/**
* 列表转换
*
* @param list
* @return
*/
@@ -360,9 +360,9 @@ public class TanluManager implements IMogoMarkerClickListener,
location.setLon(exploreWayCloud.getLocation().getLon());
location.setLat(exploreWayCloud.getLocation().getLat());
exploreWay.setLocation(location);
exploreWay.setDirection((int)exploreWayCloud.getDirection());
exploreWay.setDirection((int) exploreWayCloud.getDirection());
exploreWay.setCanLive(exploreWayCloud.getCanLive());
exploreWay.setFileType((int)exploreWayCloud.getFileType());
exploreWay.setFileType((int) exploreWayCloud.getFileType());
exploreWay.setAddr(exploreWayCloud.getAddr());
exploreWay.setGenerateTime(exploreWayCloud.getGenerateTime());
exploreWay.setCityName(exploreWayCloud.getCityName());
@@ -498,7 +498,7 @@ public class TanluManager implements IMogoMarkerClickListener,
Logger.d(TAG, "moveToMarcker lat = " + lat + " >>>>lon = " + lon);
MogoLatLng latLng = new MogoLatLng(lat, lon);
mMogoStatusManager.setUserInteractionStatus(TAG, true, false);
if(!mMogoStatusManager.isVrMode()){
if (!mMogoStatusManager.isVrMode()) {
mMApUIController.moveToCenter(latLng);
}
}

View File

@@ -13,24 +13,23 @@ import com.mogo.utils.logger.Logger
*
* @author tongchenfei
*/
class VoiceCmdService:Service() {
companion object{
class VoiceCmdService : Service() {
companion object {
private const val TAG = "VoiceCmdService"
}
private val seekListener = object : ISeekHelpListener{
private val seekListener = object : ISeekHelpListener {
override fun onSeekHelpSuccess() {
// 上报完成,关掉自己
Logger.d(TAG,"上报完成,成功")
Logger.d(TAG, "上报完成,成功")
stopSelf()
}
override fun onSeekHelpFail() {
// 上报完成,关掉自己
Logger.d(TAG,"上报完成,失败")
Logger.d(TAG, "上报完成,失败")
stopSelf()
}
}
override fun onBind(intent: Intent?): IBinder? {
@@ -39,10 +38,10 @@ class VoiceCmdService:Service() {
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
intent?.let {
if (intent.getIntExtra(ShareConstants.VOICE_CMD_SERVICE_EVENT_KEY,0) == ShareConstants.VOICE_CMD_SERVICE_SEEK_HELP) {
if (intent.getIntExtra(ShareConstants.VOICE_CMD_SERVICE_EVENT_KEY, 0) == ShareConstants.VOICE_CMD_SERVICE_SEEK_HELP) {
// 收到语音指令,准备上报求助
Logger.i(TAG, "收到语音指令,准备上报求助")
SeekHelpManager.seekHelp(this,seekListener,"2")
SeekHelpManager.seekHelp(this, seekListener, "2")
}
}
return super.onStartCommand(intent, flags, startId)

View File

@@ -18,24 +18,6 @@ import com.mogo.utils.storage.SharedPrefsMgr
*/
object UploadHelper {
fun upload(context: Context, type: TanluUploadParams, forcePlayVoice: Boolean = false) {
// if (DebugConfig.isLauncher()) { //TODO launcher和独立应用
// if (ServiceApisManager.serviceApis.statusManagerApi.isUploading) {
// // 上报即成功,当前还有正在上报的事件,仅做界面展示,不做具体操作
// 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("感谢分享,正在上传")
// 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 {
if (ServiceApisManager.serviceApis.statusManagerApi.isUploading) {
Logger.d("UploadHelper", "upload is going -- ")
// 上报即成功,当前还有正在上报的事件,仅做界面展示,不做具体操作
@@ -46,7 +28,6 @@ object UploadHelper {
// 有网就正常上报
ServiceApisManager.serviceApis.statusManagerApi.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true)
// 上报即成功
// TanluManager.getInstance(context).shareSuccess(type.eventType, type.location)
ServiceApisManager.serviceApis.tanluUiApi.shareSuccess(type.eventType, type.location)
val location = ServiceApisManager.serviceApis.mapServiceApi.getSingletonLocationClient(context).lastKnowLocation
val latLon = com.mogo.eagle.core.data.map.MogoLatLng(
@@ -58,7 +39,6 @@ object UploadHelper {
ServiceApisManager.serviceApis.tanluApi.uploadRoadCondition(type)
//语音播报
showVoiceTip(context, type.eventType)
} else {
// 没网就直接提示失败
Logger.e("UploadHelper", "upload not net ")

View File

@@ -12,7 +12,6 @@ import retrofit2.http.POST;
public interface TrafficApiService {
/**
* 上报路况拥堵情况
*
*/
@FormUrlEncoded
@POST("/yycp-tmcServer/tmcServer/car/reportTraffic/v1")

View File

@@ -1,79 +0,0 @@
package com.mogo.module.share.utils
import android.util.Log
import com.google.gson.JsonArray
import com.google.gson.JsonObject
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.AbsMogoApplication
import com.mogo.module.share.bean.InformationBody
import com.mogo.module.share.bean.LocationInfo
import com.mogo.module.share.constant.INFO_TYPE_IMG
import com.mogo.module.share.constant.INFO_TYPE_VIDEO
import com.mogo.module.share.utils.StrategyPreferenceUtil.Companion.getStrategyType
import com.mogo.module.share.utils.StrategyPreferenceUtil.Companion.getStrategyValidity
fun getInformationBody(
types: Int,
urls: Map<String, String>,
locationInfo: LocationInfo,
isCustom: Boolean,
trafficInfoType:String = "",
isShare:Boolean,
poiType: String,
mainInfoId: Long,
longitude: Double,
latitude: Double,
speed: Float,
fromType: String
): InformationBody {
val jsonArray = JsonArray()
val type: Int
type = if (types == INFO_TYPE_VIDEO) {
val videoObject = JsonObject()
videoObject.addProperty("thumbnail", urls["thumb"])
videoObject.addProperty("url", urls["video"])
jsonArray.add(videoObject)
INFO_TYPE_VIDEO
} else {
val urlObject = JsonObject()
urlObject.addProperty("url", urls["pic"])
jsonArray.add(urlObject)
INFO_TYPE_IMG
}
val infoType = if (isCustom) 1 else 0
Log.d("MainServiceController", "isCustom = $isCustom ---- infoType = $infoType")
return InformationBody(
jsonArray.toString(),
locationInfo.address,
locationInfo.areaCode,
locationInfo.areaName,
locationInfo.cityCode,
locationInfo.cityName,
System.currentTimeMillis(),
if (latitude == 0.0) locationInfo.latitude else latitude,
if (longitude == 0.0) locationInfo.longitude else longitude,
locationInfo.provinceName,
MoGoAiCloudClientConfig.getInstance().getSn(),
locationInfo.street,
type,
0,
infoType,
getStrategyValidity(AbsMogoApplication.getApp().applicationContext, convertUploadTypeOfSP(type), getStrategyType(convertUploadTypeOfSP(type))),
trafficInfoType,
isShare,
locationInfo.direction,
poiType,
mainInfoId,
speed,
fromType
)
}
private fun convertUploadTypeOfSP(type: Int): String {
return when (type) {
INFO_TYPE_IMG -> "pic"
INFO_TYPE_VIDEO -> "video"
else -> "pic"
}
}