This commit is contained in:
lixiaopeng
2020-11-13 12:31:47 +08:00
parent 65d0041066
commit 7667cb0a48
461 changed files with 13255 additions and 112 deletions

View File

@@ -146,20 +146,9 @@ class CosStatusController : CosStatusCallback {
Log.d(TAG, "videoAndThumbMap.size == 2 ")
var locationInfo = LocationUtil.getInstance().getLocationInfo()
val locationStr: String = Gson().toJson(locationInfo)
Log.d(TAG, "locationStr = " + locationStr)
//如果失败,需要提示失败弹框
// if (locationInfo.address.isNullOrEmpty() || locationInfo.cityName.isNullOrEmpty() || locationInfo.cityCode.isNullOrEmpty()
// || locationInfo.latitude == 0.0 || locationInfo.areaName.isNullOrEmpty() || locationInfo.street.isNullOrEmpty()
// || locationInfo.areaCode.isNullOrEmpty() || locationInfo.provinceName.isNullOrEmpty()
// ) {
// if (entity?.isCustom && mFromType != UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO) {
// sendGetInfoFailedReceiver("100")
// }
// } else {
Log.d(TAG, "locationStr = $locationStr")
//上传录像以及缩略图成功
sendInformation(INFO_TYPE_VIDEO, videoAndThumbMap)
// }
} else {
trackUploadCos(5)
}

View File

@@ -295,7 +295,6 @@ class MainService : Service() {
Log.d("MainService", "takePhoto -----1----->")
//判断是否授权
// if (isAuthorization(BaseApplication.getAppContext())) {
// log(TAG, "takePhoto -----2----->")
//目前不支持连拍只能定时2秒拍一张 第一期每次只拍一张
Observable.intervalRange(0, 1, 0, 2_000, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
@@ -316,9 +315,8 @@ class MainService : Service() {
isCustom: Boolean = false,
id: Long = 0
) {
Log.d("MainService", "takeVideo --------1---->")
Log.d("MainService", "takeVideo --------1----> fromType = $fromType")
// if (isAuthorization(BaseApplication.getAppContext())) {
// log(TAG, "takeVideo --------2---->")
CarCorderController.takeVideo(1, duration, isCustom, id, shareType, mainInfoId, fromType, mLongitude, mLatitude, speed)
// }
postVideoAlarmTask(isInterval)

View File

@@ -126,101 +126,6 @@ class MainServiceController {
}
}
// fun getAuthorization() {
// request<BaseResponse<Any>> {
// loader {
// strategyeModel.getAuthorization()
// }
// onSuccess {
// it.let {
// var jsonObject = JSONObject(it.result.toString())
// setAuthorization(
// AbsMogoApplication.getApp().applicationContext,
// jsonObject.getBoolean("enable")
// )
// Log.d("MainServiceController", "MainServiceController getAuthorization onSuccess enable=" + jsonObject.getBoolean("enable"))
// }
// }
// onError {
// Log.d("MainServiceController", "getAuthorization error")
// }
// }
// }
// fun getNeedAuth(authStatus: ((Boolean) -> Unit)? = null) {
// request<BaseResponse<CommonConfig>> {
// loader {
// strategyeModel.getAllConfig()
// }
// onSuccess {
// it.let {
// var config = it.result
// config.auth?.let { auth ->
// authStatus?.invoke(auth.isNeedAuth == 1)
// }
// if (config.isActiveNonNull()) {
// //保存运营活动webUrl、imgUrl SP
// setActiveWebUrl(config.active.webUrl)
// setActiveImgUrl(config.active.imageUrl)
// setActiveStatus(config.active.status)
// } else {
// //清除运营活动配置SP
// clearActiveInfo()
// }
//
// }
// }
// onError {
// Log.d("MainServiceController", "getAuthorization error")
// }
// }
//
// //获取加载页面配置
// getSplashConfig()
// }
/**
* 获取加载页面配置
*/
// fun getSplashConfig() {
// request<BaseResponse<SplashConfig>> {
// loader {
// strategyeModel.getSplashConfig()
// }
// onSuccess {
// it.let {
// var splashConfig = it.result
// val timeFlag = getLong(TIME_QUANTUM, 0)
// if (splashConfig != null && !TextUtils.isEmpty(splashConfig.image)) {
// //保存倒计时时间
// Log.d(TAG, "splashConfig.displayTime =" + splashConfig.displayTime)
// putInt(COUNT_DOWN_TIME, splashConfig.displayTime)
// //保存语音播报
// putCommonString(VOICE_TEXT, splashConfig.content)
// //下载图片
// if (!TextUtils.isEmpty(splashConfig.image)) {
// Log.d(TAG, "splashConfig.effectiveFlag =" + splashConfig.effectiveFlag + "-->timeFlag=" + timeFlag)
// if (timeFlag != splashConfig.effectiveFlag) {
// ImageFactory.downloadPic(splashConfig.image)
// }
// }
//
// //保存时间戳
// putLong(TIME_QUANTUM, splashConfig.effectiveFlag)
// } else {
// putCommonString(VOICE_TEXT, "")
// putInt(COUNT_DOWN_TIME, 0)
// putCommonBoolean(IS_SAVE_SPLASH, false)
// }
// }
// }
// onError {
// Log.d(TAG, "getSplashConfig error it.printStackTrace()=" + it.printStackTrace())
// }
// }
// }
//上传情报数据
fun sendInformationMessage(
type: Int,
@@ -252,7 +157,6 @@ class MainServiceController {
customSend
)
}
}
//如果address为空则逆地理编码