[Upload]
迁移mogo-module-map代码MoGoEagleEye.core.function-impl.mogo-core-function-map Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -48,12 +48,6 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
private var mCityCode: String = ""
|
||||
|
||||
|
||||
private var getVideoFailed: (() -> Unit)? = null
|
||||
|
||||
fun getVideoFailed(getVideoFailed: (() -> Unit)) {
|
||||
this.getVideoFailed = getVideoFailed
|
||||
}
|
||||
|
||||
fun initCarCorderController() {
|
||||
try {
|
||||
zdCarCoderController =
|
||||
@@ -140,17 +134,6 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
} else { //比亚迪
|
||||
Logger.d(TANLU, "takeVideo ------ isnet = " + NetworkUtils.isConnected(AbsMogoApplication.getApp().applicationContext))
|
||||
getInfo("", mAddress, mLongitude, mLatitude, mType, mDirection, mAreaCode, mCityCode, 1, mFromType, CarCorderController.mainInfoId)?.let { uploadRoadInfo(it) }
|
||||
|
||||
//地图上打点
|
||||
taskAsync(3_000) {
|
||||
try {
|
||||
// LatLngStickyEventBus.getInstance()
|
||||
// .postSticky(GetImageSuccessEvent("", mType))
|
||||
} catch (e: java.lang.Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,9 +149,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
//获取图片失败也上报,图片不打点
|
||||
if (isCustom) {
|
||||
getInfo("", mAddress, mLongitude, mLatitude, mType, mDirection, mAreaCode, mCityCode, 0, mFromType, mainInfoId)?.let { uploadRoadInfo(it) }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//拍照成功回调返回图片本地路径
|
||||
|
||||
@@ -12,15 +12,13 @@ import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.elegant.analytics.Analytics
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.module.share.BuildConfig
|
||||
import com.mogo.module.share.bean.event.GetImageSuccessEvent
|
||||
import com.mogo.module.share.bean.event.LatLngStickyEventBus
|
||||
import com.zhidao.cosupload.manager.CosUploadManagerImpl
|
||||
import com.mogo.module.share.BuildConfig
|
||||
import com.mogo.module.share.constant.*
|
||||
import com.mogo.module.share.constant.ShareConstants.TANLU
|
||||
import com.mogo.module.share.utils.*
|
||||
@@ -28,6 +26,8 @@ import com.mogo.module.share.utils.StrategyPreferenceUtil.Companion.clearStrateg
|
||||
import com.mogo.module.share.utils.StrategyPreferenceUtil.Companion.getStrategyFrequency
|
||||
import com.mogo.module.share.utils.StrategyPreferenceUtil.Companion.getStrategyInterval
|
||||
import com.mogo.module.share.utils.StrategyPreferenceUtil.Companion.getStrategyType
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.zhidao.cosupload.manager.CosUploadManagerImpl
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
@@ -56,6 +56,7 @@ class MainService : Service() {
|
||||
|
||||
//是否已经获取过策略
|
||||
var isGetStrategies: Boolean = false
|
||||
|
||||
//1是一次性,2是周期性
|
||||
private var picType: Int = 0
|
||||
private var videoType: Int = 0
|
||||
@@ -167,7 +168,6 @@ class MainService : Service() {
|
||||
CarCorderController.initCarCorderController()
|
||||
mainServiceHttpModel = MainServiceController()
|
||||
registReceiver()
|
||||
// CosCallbackMapController.init(this)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -252,14 +252,12 @@ class MainService : Service() {
|
||||
private fun takePhoto(isInterval: Boolean = false, isCustom: Boolean = false) {
|
||||
Logger.d(TANLU, "takePhoto -----1----->")
|
||||
//判断是否授权
|
||||
// if (isAuthorization(BaseApplication.getAppContext())) {
|
||||
//目前不支持连拍,只能定时2秒拍一张 第一期每次只拍一张
|
||||
Observable.intervalRange(0, 1, 0, 2_000, TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe {
|
||||
CarCorderController.takePhoto(1, 1, false, isCustom, TANLU_ROAD_CURRENT, mainInfoId, fromType, mLongitude, mLatitude, speed, mAddress, mDirection, mAreaCode, mCityCode)
|
||||
}
|
||||
// }
|
||||
|
||||
postPhotoAlarmTask(isInterval)
|
||||
|
||||
@@ -274,9 +272,7 @@ class MainService : Service() {
|
||||
id: Long = 0
|
||||
) {
|
||||
Logger.d(TANLU, "takeVideo --------1----> fromType = $fromType --isCustom = $isCustom")
|
||||
// if (isAuthorization(BaseApplication.getAppContext())) {
|
||||
CarCorderController.takeVideo(1, duration, isCustom, id, shareType, mainInfoId, fromType, mLongitude, mLatitude, speed, mAddress, mDirection, mAreaCode, mCityCode)
|
||||
// }
|
||||
postVideoAlarmTask(isInterval)
|
||||
|
||||
this@MainService.isCustom = isCustom
|
||||
@@ -304,8 +300,7 @@ class MainService : Service() {
|
||||
AbsMogoApplication.getApp().applicationContext,
|
||||
"pic",
|
||||
getStrategyType("pic")
|
||||
)
|
||||
, pendingIntent
|
||||
), pendingIntent
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -336,8 +331,7 @@ class MainService : Service() {
|
||||
AbsMogoApplication.getApp().applicationContext,
|
||||
"video",
|
||||
getStrategyType("video")
|
||||
)
|
||||
, videoPendingIntent
|
||||
), videoPendingIntent
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -345,9 +339,7 @@ class MainService : Service() {
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
unregisterReceiver(mAlarmBroadCast)
|
||||
// unregisterReceiver(mCustomSendBroadCast)
|
||||
CarCorderController.release()
|
||||
// CosCallbackMapController.release()
|
||||
LatLngStickyEventBus.getInstance().unregister(this)
|
||||
LatLngStickyEventBus.getInstance().removeAllStickyEvents()
|
||||
trackNormalEvent(CarNet_MainService_Destory, null)
|
||||
|
||||
Reference in New Issue
Block a user