Merge remote-tracking branch 'origin/dev' into dev
@@ -581,7 +581,11 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
// mMyLocationMarker.startAnimation();
|
||||
// }
|
||||
// });
|
||||
mMyLocationMarker.startAnimation();
|
||||
try {
|
||||
mMyLocationMarker.startAnimation();
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -342,10 +342,16 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
ScaleAnimation animationScale = new ScaleAnimation( fromX, toX, fromY, toY );
|
||||
animationScale.setDuration( duration );
|
||||
animationScale.setFillMode( Animation.FILL_MODE_FORWARDS );
|
||||
animationScale.setInterpolator( interpolator );
|
||||
if ( interpolator != null ) {
|
||||
animationScale.setInterpolator( interpolator );
|
||||
}
|
||||
|
||||
mMarker.setAnimation( animationScale );
|
||||
mMarker.startAnimation();
|
||||
try {
|
||||
mMarker.startAnimation();
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -357,7 +363,9 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
ScaleAnimation animationScale = new ScaleAnimation( fromX, toX, fromY, toY );
|
||||
animationScale.setDuration( duration );
|
||||
animationScale.setFillMode( Animation.FILL_MODE_FORWARDS );
|
||||
animationScale.setInterpolator( interpolator );
|
||||
if ( interpolator != null ) {
|
||||
animationScale.setInterpolator( interpolator );
|
||||
}
|
||||
animationScale.setAnimationListener( new Animation.AnimationListener() {
|
||||
@Override
|
||||
public void onAnimationStart() {
|
||||
@@ -398,7 +406,9 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
|
||||
AnimationSet animationSet = new AnimationSet( true );
|
||||
animationSet.setDuration( duration );
|
||||
animationSet.setInterpolator( interpolator );
|
||||
if ( interpolator != null ) {
|
||||
animationSet.setInterpolator( interpolator );
|
||||
}
|
||||
animationSet.setAnimationListener( new Animation.AnimationListener() {
|
||||
@Override
|
||||
public void onAnimationStart() {
|
||||
@@ -422,7 +432,11 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
} );
|
||||
|
||||
mMarker.setAnimation( animationSet );
|
||||
mMarker.startAnimation();
|
||||
try {
|
||||
mMarker.startAnimation();
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 25 KiB |
@@ -126,7 +126,6 @@ public class AutoNaviReceiver extends BroadcastReceiver {
|
||||
if ( state == -1 ) {
|
||||
return;
|
||||
}
|
||||
Logger.d( TAG, "map status: state = %d", state );
|
||||
switch ( state ) {
|
||||
case MapStateValue.START_NAVI:
|
||||
case MapStateValue.START_EMULATOR_NAVI:
|
||||
|
||||
@@ -135,7 +135,8 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
mainInfoId,
|
||||
mLongitude,
|
||||
mLatitude,
|
||||
mSpeed
|
||||
mSpeed,
|
||||
mFromType
|
||||
)
|
||||
|
||||
//地图上打点
|
||||
@@ -175,7 +176,8 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
mainInfoId,
|
||||
mLongitude,
|
||||
mLatitude,
|
||||
mSpeed
|
||||
mSpeed,
|
||||
mFromType
|
||||
)
|
||||
}
|
||||
|
||||
@@ -350,7 +352,8 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
mainInfoId,
|
||||
mLongitude,
|
||||
mLatitude,
|
||||
mSpeed
|
||||
mSpeed,
|
||||
mFromType
|
||||
)
|
||||
|
||||
//地图上打点
|
||||
@@ -424,9 +427,9 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
mainInfoId,
|
||||
mLongitude,
|
||||
mLatitude,
|
||||
mSpeed
|
||||
mSpeed,
|
||||
mFromType
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
//获取图片
|
||||
|
||||
@@ -146,7 +146,8 @@ class CosStatusController : CosStatusCallback {
|
||||
mainInfoId,
|
||||
mLongitude,
|
||||
mLatitude,
|
||||
mSpeed
|
||||
mSpeed,
|
||||
mFromType
|
||||
)
|
||||
}
|
||||
Log.d(TAG, "delete file: $localPath")
|
||||
@@ -161,7 +162,7 @@ class CosStatusController : CosStatusCallback {
|
||||
// CosCallbackMapController.mainService?.sendCustomResult(it)
|
||||
// }
|
||||
// } else {
|
||||
sendInformationDirectly(type, map, mType, entity, mainInfoId, mLongitude, mLatitude, mSpeed)
|
||||
sendInformationDirectly(type, map, mType, entity, mainInfoId, mLongitude, mLatitude, mSpeed,mFromType)
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -176,13 +177,14 @@ class CosStatusController : CosStatusCallback {
|
||||
mainInfoId: Long,
|
||||
longitude: Double,
|
||||
latitude: Double,
|
||||
speed: Float
|
||||
speed: Float,
|
||||
fromType: String
|
||||
) {
|
||||
Log.d(TAG, "sendInformationDirectly poiType= $poiType ---- mainInfoId= $mainInfoId --- isCustom = ${entity?.isCustom}")
|
||||
Log.d(TAG, "sendInformationDirectly poiType= $poiType --fromType =$fromType ---- mainInfoId= $mainInfoId --- isCustom = ${entity?.isCustom}")
|
||||
//开始上传
|
||||
entity?.isCustom?.let {
|
||||
mainServiceHttpModel.sendInformationMessage(
|
||||
fromType = mFromType,
|
||||
fromType = fromType,
|
||||
type = type,
|
||||
url = map,
|
||||
isCustom = it,
|
||||
|
||||
@@ -75,15 +75,8 @@ class MainService : Service() {
|
||||
private var mLatitude: Double = 0.0
|
||||
lateinit var serviceApis: IMogoServiceApis
|
||||
|
||||
//发送主动上报结果广播给外部
|
||||
// fun sendCustomResult(result: Boolean) {
|
||||
// var intent = Intent(customResultAction)
|
||||
// intent.putExtra("isSuccess", result)
|
||||
// sendBroadcast(intent)
|
||||
// }
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
Log.d(TAG, "onStartCommand -----------> ")
|
||||
//清理多媒体资源和sp策略数据
|
||||
clearStrategyType(this)
|
||||
//初始化埋点
|
||||
@@ -95,7 +88,7 @@ class MainService : Service() {
|
||||
VoiceController.initVoice()
|
||||
serviceApis = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(this) as IMogoServiceApis
|
||||
speed = serviceApis.getMapServiceApi().getSingletonLocationClient(this).getLastKnowLocation().getSpeed()
|
||||
Log.d(TAG, "onStartCommand speed = $speed" )
|
||||
Log.d(TAG, "onStartCommand speed = $speed")
|
||||
if (intent != null) {
|
||||
params = intent.getParcelableExtra("params")
|
||||
params?.let {
|
||||
@@ -105,18 +98,12 @@ class MainService : Service() {
|
||||
mLongitude = it.lon
|
||||
mLatitude = it.lat
|
||||
Log.d(TAG, "onStartCommand shareType = $shareType --fromType = $fromType --mainInfoId = $mainInfoId -- mLongitude = $mLongitude --mLatitude = $mLatitude --it.duration = ${it.duration} ")
|
||||
// if (shareType == TANLU_ROAD_CONGESTION || shareType == TANLU_TRAFFIC_CHECK || shareType == TANLU_ROAD_CLOSURE || shareType == TANLU_ROAD_CURRENT
|
||||
// || shareType == TANLU_ROAD_PONDING || shareType == TANLU_ROAD_ICING || shareType == TANLU_ROAD_HEAVY_FOG
|
||||
// || shareType == TANLU_ROAD_ACCIDENT || shareType == TANLU_ROAD_WORK
|
||||
// ) {
|
||||
// takePhoto(1, false, true)
|
||||
if (fromType == UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO || fromType == UPLOAD_FROM_STRATEGY_BLOCK_AUTO) {
|
||||
// 如果是策略上报,isCustom = false
|
||||
takeVideo(it.duration)
|
||||
} else {
|
||||
takeVideo(it.duration, isCustom = true, id = id)
|
||||
}
|
||||
// }
|
||||
if (fromType == UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO || fromType == UPLOAD_FROM_STRATEGY_BLOCK_AUTO) {
|
||||
// 如果是策略上报,isCustom = false
|
||||
takeVideo(it.duration)
|
||||
} else {
|
||||
takeVideo(it.duration, isCustom = true, id = id)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.e(TAG, "intent == null ")
|
||||
@@ -210,20 +197,6 @@ class MainService : Service() {
|
||||
// )
|
||||
}
|
||||
|
||||
// private fun sendMarkerInfoReceiver(lat: Double, lon: Double, imageUrl: String?, type: String?) {
|
||||
// Log.e("MainService", "sendMarkerInfoReceiver ------> type = $type ")
|
||||
// Log.e("MainService", "sendMarkerInfoReceiver ------> fromType = $fromType ")
|
||||
// Log.e("MainService", "sendMarkerInfoReceiver ------> isCustom = $isCustom ")
|
||||
// var intent = Intent()
|
||||
// intent.action = "com.zhidao.roadcondition.marker.info"
|
||||
// intent.putExtra("type", type)
|
||||
// intent.putExtra("imageUrl", imageUrl)
|
||||
// intent.putExtra("lat", lat)
|
||||
// intent.putExtra("lon", lon)
|
||||
// intent.putExtra("custom", isCustom)
|
||||
// intent.putExtra("fromType", fromType)
|
||||
// sendBroadcast(intent)
|
||||
// }
|
||||
|
||||
/**
|
||||
* 初始化定位监听
|
||||
@@ -290,7 +263,7 @@ class MainService : Service() {
|
||||
}
|
||||
|
||||
//获取图片
|
||||
private fun takePhoto( isInterval: Boolean = false, isCustom: Boolean = false) {
|
||||
private fun takePhoto(isInterval: Boolean = false, isCustom: Boolean = false) {
|
||||
Log.d("MainService", "takePhoto -----1----->")
|
||||
//判断是否授权
|
||||
// if (isAuthorization(BaseApplication.getAppContext())) {
|
||||
@@ -388,7 +361,7 @@ class MainService : Service() {
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
unregisterReceiver(mAlarmBroadCast)
|
||||
unregisterReceiver(mCustomSendBroadCast)
|
||||
// unregisterReceiver(mCustomSendBroadCast)
|
||||
CarCorderController.release()
|
||||
CosCallbackMapController.release()
|
||||
LatLngStickyEventBus.getInstance().unregister(this)
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.zhidao.roadcondition.service
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.zhidao.auto.platform.voice.VoiceClient
|
||||
import java.lang.Exception
|
||||
|
||||
/**
|
||||
* @description 声音控制类
|
||||
@@ -45,7 +46,11 @@ object VoiceController {
|
||||
* @param customType 命令
|
||||
*/
|
||||
fun unRegisterCustomWakeupCmd(customType: String) {
|
||||
voiceClient.unRegisterCustomWakeupCmd(customType)
|
||||
try {
|
||||
voiceClient.unRegisterCustomWakeupCmd(customType)
|
||||
} catch (e:Exception){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||