Merge branch 'dev_arch_opt_3.0' of gitlab.zhidaoauto.com:zhjt/AndroidApp/MoGoEagleEye into dev_arch_opt_3.0
This commit is contained in:
@@ -587,6 +587,8 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
|
||||
ttsContent =
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
|
||||
|
||||
// ObuManager.getInstance().obuRvToTrackedObject(info) //todo emArrow
|
||||
}
|
||||
|
||||
//交叉路口碰撞预警
|
||||
@@ -734,7 +736,6 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
}, direction
|
||||
)
|
||||
}
|
||||
// ObuManager.getInstance().obuRvToTrackedObject(info)
|
||||
//更新周边车辆进行预警颜色变换,车辆实时移动和变色 ,UUID不需要匹配了
|
||||
TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let {
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
|
||||
@@ -104,7 +104,7 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
|
||||
}
|
||||
|
||||
fun modifyCarInfo(callBack: (ModifyBindingcarInfo) -> Unit) {
|
||||
BindingCarNetWorkManager.instance.modifyBindingcar(mContext!!, mAddress, mWidevineIDWithMd5, callBack, screenType)
|
||||
BindingCarNetWorkManager.instance.modifyBindingCar(mContext!!, mAddress, mWidevineIDWithMd5, callBack, screenType)
|
||||
}
|
||||
|
||||
private fun driverScreen(macAddress: String, widevineIDWithMd5: String) {
|
||||
|
||||
@@ -74,12 +74,10 @@ class BindingCarNetWorkManager private constructor() {
|
||||
override fun onSubscribe(d: Disposable) {}
|
||||
override fun onNext(info: BindingCarInfo) {
|
||||
if (info != null && info.getData() != null) {
|
||||
d(SceneConstant.M_BINDING + TAG, "getBindingcarInfo data =" + info.getData().toString())
|
||||
//根据车辆类型切换不同的车辆模型,只针对红旗做处理,当mac地址不一致,切换模型
|
||||
d(SceneConstant.M_BINDING + TAG, "getBindingCarInfo data =" + info.getData().toString())
|
||||
if (!SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.MAC_ADDRESS).equals(macAddress) && DebugConfig.isCarModelChange()) {
|
||||
updateCarVrIconRes(info.getData().brandId)
|
||||
updateCarVrIconRes(info.getData().brandId);
|
||||
}
|
||||
|
||||
when (info.getData().compare) {
|
||||
"0" -> showBindingCarDialog()
|
||||
"3" -> showModifyBindingCarDialog()
|
||||
@@ -93,7 +91,7 @@ class BindingCarNetWorkManager private constructor() {
|
||||
override fun onError(e: Throwable) {
|
||||
e(
|
||||
SceneConstant.M_BINDING + TAG,
|
||||
"getBindingcarInfo onError e = " + e.toString() + "---e.getMessage = " + e.message
|
||||
"getBindingCarInfo onError e = " + e.toString() + "---e.getMessage = " + e.message
|
||||
)
|
||||
}
|
||||
|
||||
@@ -105,7 +103,7 @@ class BindingCarNetWorkManager private constructor() {
|
||||
* 绑定和修改绑定车辆
|
||||
* mac: 48:b0:2d:3a:9c:19
|
||||
*/
|
||||
fun modifyBindingcar(
|
||||
fun modifyBindingCar(
|
||||
context: Context,
|
||||
macAddress: String?,
|
||||
widevineIDWithMd5: String?,
|
||||
@@ -133,12 +131,11 @@ class BindingCarNetWorkManager private constructor() {
|
||||
callBack.invoke(info)
|
||||
d(
|
||||
SceneConstant.M_BINDING + TAG,
|
||||
"modifyBindingcar onNext code = " + info.code + "---msg = " + info.msg + "--info.toString() = " + info.toString()
|
||||
"modifyBindingCar onNext code = " + info.code + "---msg = " + info.msg + "--info.toString() = " + info.toString()
|
||||
)
|
||||
if (!SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.MAC_ADDRESS).equals(macAddress) && DebugConfig.isCarModelChange()) {
|
||||
updateCarVrIconRes(info.data.brandId)
|
||||
updateCarVrIconRes(info.data.brandId);
|
||||
}
|
||||
|
||||
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.MAC_ADDRESS, macAddress)
|
||||
}
|
||||
}
|
||||
@@ -146,7 +143,7 @@ class BindingCarNetWorkManager private constructor() {
|
||||
override fun onError(e: Throwable) {
|
||||
e(
|
||||
SceneConstant.M_BINDING + TAG,
|
||||
"modifyBindingcar onError e = " + e.toString() + "---e.getMessage = " + e.message
|
||||
"modifyBindingCar onError e = " + e.toString() + "---e.getMessage = " + e.message
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.graphics.Color
|
||||
import android.os.Build
|
||||
import android.text.Html
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.annotation.RequiresApi
|
||||
@@ -607,7 +608,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
tbIsDemoMode.visibility = View.GONE
|
||||
}
|
||||
|
||||
|
||||
// 雨天模式,上一次勾选的数据
|
||||
tbIsRainMode.isChecked = FunctionBuildConfig.isRainMode
|
||||
//雨天模式
|
||||
@@ -624,36 +624,30 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
//感知优化模式
|
||||
tbBeautyMode.setOnCheckedChangeListener { _, isChecked ->
|
||||
FunctionBuildConfig.isBeautyMode = isChecked
|
||||
if (!FunctionBuildConfig.isBeautyMode) {
|
||||
tbBeautyMode.isChecked = false
|
||||
}
|
||||
}
|
||||
|
||||
tbV2NFromCar.isChecked = FunctionBuildConfig.isV2NFromCar
|
||||
//v2n车端预警
|
||||
tbV2NFromCar.setOnCheckedChangeListener { _, isChecked ->
|
||||
FunctionBuildConfig.isV2NFromCar = isChecked
|
||||
if (!FunctionBuildConfig.isV2NFromCar) {
|
||||
tbV2NFromCar.isChecked = false
|
||||
}
|
||||
}
|
||||
|
||||
tbDrawAiCloudFusion.isChecked = FunctionBuildConfig.isDrawAiCloudFusion
|
||||
//云端感知绘制
|
||||
tbDrawAiCloudFusion.setOnCheckedChangeListener { _, isChecked ->
|
||||
FunctionBuildConfig.isDrawAiCloudFusion = isChecked
|
||||
if (!FunctionBuildConfig.isDrawAiCloudFusion) {
|
||||
tbDrawAiCloudFusion.isChecked = false
|
||||
}
|
||||
}
|
||||
|
||||
tbDrawRomaMode.isChecked = FunctionBuildConfig.isRomaMode
|
||||
//roma
|
||||
tbDrawRomaMode.setOnCheckedChangeListener { _, isChecked ->
|
||||
FunctionBuildConfig.isRomaMode = isChecked
|
||||
if (!FunctionBuildConfig.isRomaMode) {
|
||||
tbDrawRomaMode.isChecked = false
|
||||
}
|
||||
}
|
||||
|
||||
tbObuWarningFusionUnion.isChecked = FunctionBuildConfig.isObuWarningFusionUnion
|
||||
//ObuWarningFusionUnion
|
||||
tbObuWarningFusionUnion.setOnCheckedChangeListener { _, isChecked ->
|
||||
FunctionBuildConfig.isObuWarningFusionUnion = isChecked
|
||||
}
|
||||
|
||||
//重启工控机所有节点
|
||||
@@ -749,12 +743,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
FunctionBuildConfig.isDrawUnknownIdentifyData = isChecked
|
||||
}
|
||||
|
||||
// // 初始化 OBU感知数据是否绘制 选择情况
|
||||
// tbIsDrawOBUIdentifyData.isChecked = FunctionBuildConfig.isDrawObuIdentifyData
|
||||
// tbIsDrawOBUIdentifyData.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
// FunctionBuildConfig.isDrawObuIdentifyData = isChecked
|
||||
// }
|
||||
|
||||
//TODO
|
||||
tbIsDrawPath.setOnCheckedChangeListener { _, isChecked ->
|
||||
|
||||
@@ -1062,18 +1050,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
* 设置Hmi点击监听
|
||||
*/
|
||||
private fun setHmiCheckedChangeListener() {
|
||||
|
||||
/**
|
||||
* 隐藏、显示小地图
|
||||
*/
|
||||
tbControlView.setOnCheckedChangeListener { _, isChecked ->
|
||||
// if (isChecked) {
|
||||
// CallerSmpManager.hidePanel()
|
||||
// } else {
|
||||
// CallerSmpManager.showPanel()
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* sn绑定控制
|
||||
*/
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.Utils
|
||||
import kotlinx.android.synthetic.main.view_steering_brake.view.*
|
||||
|
||||
@@ -73,13 +74,16 @@ class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayo
|
||||
//can数据转发 转向灯状态 0是正常 1是左转 2是右转
|
||||
if (lightSwitch != null) {
|
||||
CallerLogger.d("$M_HMI$TAG", "---lightSwitch.getNumber() = " + lightSwitch.number)
|
||||
if (lightSwitch.number == 1 || lightSwitch.number == 2) {
|
||||
isShowTurnLight = true
|
||||
brakeView.visibility = View.VISIBLE
|
||||
brakeView.setBrakeLight(0)
|
||||
} else {
|
||||
brakeView.visibility = View.GONE
|
||||
isShowTurnLight = false
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (lightSwitch.number == 1 || lightSwitch.number == 2) {
|
||||
isShowTurnLight = true
|
||||
brakeView.visibility = View.VISIBLE
|
||||
brakeView.setBrakeLight(0)
|
||||
} else {
|
||||
brakeView.visibility = View.GONE
|
||||
isShowTurnLight = false
|
||||
}
|
||||
turnLightView.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.mogo.eagle.core.function.api.map.angle.Turning
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import kotlinx.android.synthetic.main.view_steering_brake.view.*
|
||||
import kotlinx.android.synthetic.main.view_turn_light_status.view.*
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -40,6 +41,9 @@ open class TurnLightViewStatus @JvmOverloads constructor(
|
||||
|
||||
private val visible: Boolean
|
||||
|
||||
@Volatile
|
||||
private var isVisualAngleChanged: Boolean = false
|
||||
|
||||
init {
|
||||
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.TurnLightView)
|
||||
val dayLight = typedArray.getBoolean(R.styleable.TurnLightView_day_light_mode, false)
|
||||
@@ -71,8 +75,10 @@ open class TurnLightViewStatus @JvmOverloads constructor(
|
||||
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
|
||||
super.onAutopilotLightSwitchData(lightSwitch)
|
||||
lightSwitch?.let {
|
||||
turnLightView.visibility = View.VISIBLE
|
||||
setTurnLight(it)
|
||||
ThreadUtils.runOnUiThread {
|
||||
turnLightView.visibility = View.VISIBLE
|
||||
setTurnLight(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +93,10 @@ open class TurnLightViewStatus @JvmOverloads constructor(
|
||||
//根据左右进行显示和隐藏,实际要判断每个来的时间和频度
|
||||
when (directionLight) {
|
||||
Chassis.LightSwitch.LIGHT_LEFT -> { //左转向
|
||||
CallerVisualAngleManager.changeAngle(Turning(true))
|
||||
if (!isVisualAngleChanged) {
|
||||
isVisualAngleChanged = true
|
||||
CallerVisualAngleManager.changeAngle(Turning(true))
|
||||
}
|
||||
showNormalAnimation()
|
||||
left_select_image.visibility = View.VISIBLE
|
||||
right_select_image.visibility = View.GONE
|
||||
@@ -95,7 +104,10 @@ open class TurnLightViewStatus @JvmOverloads constructor(
|
||||
setAnimation(left_select_image)
|
||||
}
|
||||
Chassis.LightSwitch.LIGHT_RIGHT -> { //右转向
|
||||
CallerVisualAngleManager.changeAngle(Turning(true))
|
||||
if (!isVisualAngleChanged) {
|
||||
isVisualAngleChanged = true
|
||||
CallerVisualAngleManager.changeAngle(Turning(true))
|
||||
}
|
||||
showNormalAnimation()
|
||||
left_select_image.visibility = View.GONE
|
||||
right_select_image.visibility = View.VISIBLE
|
||||
@@ -103,7 +115,10 @@ open class TurnLightViewStatus @JvmOverloads constructor(
|
||||
setAnimation(right_select_image)
|
||||
}
|
||||
else -> { //消失
|
||||
CallerVisualAngleManager.changeAngle(Turning(false))
|
||||
if (isVisualAngleChanged) {
|
||||
isVisualAngleChanged = false
|
||||
CallerVisualAngleManager.changeAngle(Turning(false))
|
||||
}
|
||||
animationDisappear()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,6 +278,18 @@
|
||||
android:textOn="关闭漫游模式"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbObuWarningFusionUnion"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:padding="@dimen/dp_20"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="开启obu预警融合"
|
||||
android:textOn="关闭obu预警融合"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbMojie"
|
||||
android:layout_width="match_parent"
|
||||
@@ -1310,18 +1322,6 @@
|
||||
app:layout_constraintLeft_toRightOf="@+id/tbChangeCurrentCarIcon"
|
||||
app:layout_constraintTop_toTopOf="@id/tbChangeCurrentCarIcon" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbControlView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_margin="2dp"
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/dp_20"
|
||||
android:textOff="隐藏「小地图」"
|
||||
android:textOn="显示「小地图」"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbOpenSnBinding"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.widget.RelativeLayout
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.MainThread
|
||||
import ch.hsr.geohash.GeoHash
|
||||
import com.amap.api.maps.AMap
|
||||
import com.amap.api.maps.CameraUpdate
|
||||
@@ -71,7 +72,7 @@ class OverMapView @JvmOverloads constructor(
|
||||
private val zoomLevel = 15
|
||||
private var mCameraUpdate: CameraUpdate? = null
|
||||
private var mContext: Context? = null
|
||||
private val mTilt = 60f
|
||||
private var mTilt = 0f
|
||||
private var overLayerView: TextView? = null
|
||||
|
||||
// 全局路径规划中的GeoHash网格
|
||||
@@ -99,6 +100,7 @@ class OverMapView @JvmOverloads constructor(
|
||||
private var isFirstLocation = true
|
||||
var mCustomMapStyleOptions: CustomMapStyleOptions? = null
|
||||
var currMarkerList: ArrayList<Marker>? = null
|
||||
var siteMarkerList: ArrayList<Marker>? = null
|
||||
|
||||
companion object {
|
||||
const val TAG = "OverMapView"
|
||||
@@ -155,18 +157,56 @@ class OverMapView @JvmOverloads constructor(
|
||||
}
|
||||
// =================必须通知高德地图生命周期的变化=================
|
||||
|
||||
/**
|
||||
* 隐藏右下角的重置View
|
||||
*/
|
||||
fun hideResetView() {
|
||||
overLayerView?.visibility = View.GONE
|
||||
}
|
||||
|
||||
/**
|
||||
* siteLatLngs: 高德坐标集合
|
||||
* bitmap: Marker对应的图片
|
||||
* (anchorX,anchorY)为锚点坐标,各自取值范围为[0,1],默认值为(0.5,1)
|
||||
*/
|
||||
@MainThread
|
||||
fun drawSiteMarkers(siteLatLngs: List<LatLng>?, bitmap: Bitmap, anchorX: Float, anchorY: Float) {
|
||||
if (siteLatLngs.isNullOrEmpty()) return
|
||||
clearSiteMarkers()
|
||||
val markerOptionsList = ArrayList<MarkerOptions>()
|
||||
for (latLng in siteLatLngs) {
|
||||
val markerOption = MarkerOptions()
|
||||
markerOption.position(latLng)
|
||||
markerOption.anchor(anchorX, anchorY)
|
||||
markerOption.icon(
|
||||
BitmapDescriptorFactory.fromBitmap(bitmap)
|
||||
)
|
||||
markerOptionsList.add(markerOption)
|
||||
}
|
||||
siteMarkerList = mAMap!!.addMarkers(markerOptionsList, false)
|
||||
}
|
||||
|
||||
@MainThread
|
||||
fun clearSiteMarkers() {
|
||||
if (siteMarkerList != null) {
|
||||
for (marker in siteMarkerList!!) {
|
||||
marker.destroy()
|
||||
}
|
||||
siteMarkerList = null
|
||||
}
|
||||
}
|
||||
|
||||
private fun initView(context: Context) {
|
||||
mContext = context
|
||||
val smpView = LayoutInflater.from(context).inflate(R.layout.module_overview_map_view, this)
|
||||
mMapView = smpView.findViewById(R.id.aMapView)
|
||||
overLayerView = findViewById(R.id.overLayer)
|
||||
overLayerView?.background = resources.getDrawable(if (resetDrawable != -1) resetDrawable else R.drawable.amap_reset)
|
||||
arrivedBitmap = BitmapDescriptorFactory.fromResource(if (arrivedDrawable != -1) arrivedDrawable else R.drawable.taxi_map_arrow_arrived)
|
||||
unArrivedBitmap = BitmapDescriptorFactory.fromResource(if (unArrivedDrawable != -1) unArrivedDrawable else R.drawable.taxi_map_arrow_un_arrive)
|
||||
overLayerView?.background =
|
||||
resources.getDrawable(if (resetDrawable != -1) resetDrawable else R.drawable.amap_reset)
|
||||
arrivedBitmap =
|
||||
BitmapDescriptorFactory.fromResource(if (arrivedDrawable != -1) arrivedDrawable else R.drawable.taxi_map_arrow_arrived)
|
||||
unArrivedBitmap =
|
||||
BitmapDescriptorFactory.fromResource(if (unArrivedDrawable != -1) unArrivedDrawable else R.drawable.taxi_map_arrow_un_arrive)
|
||||
CallerPlanningRottingListenerManager.addListener(TAG, this)
|
||||
initAMapView(context)
|
||||
// 注册定位监听
|
||||
@@ -177,6 +217,7 @@ class OverMapView @JvmOverloads constructor(
|
||||
|
||||
private fun initAMapView(context: Context) {
|
||||
Log.d(TAG, "initAMapView")
|
||||
mTilt = 30f
|
||||
mCameraUpdate = CameraUpdateFactory.zoomTo(zoomLevel.toFloat())
|
||||
mAMap = mMapView!!.map
|
||||
mCustomMapStyleOptions = CustomMapStyleOptions()
|
||||
@@ -197,6 +238,8 @@ class OverMapView @JvmOverloads constructor(
|
||||
}
|
||||
// 实时路况图层关闭,必须添加在loaded结束之后,其他位置不生效
|
||||
mAMap?.isTrafficEnabled = false
|
||||
mAMap?.showBuildings(true)
|
||||
mAMap?.animateCamera(CameraUpdateFactory.changeTilt(mTilt))
|
||||
}
|
||||
setUpMap()
|
||||
customOptions()
|
||||
@@ -350,7 +393,7 @@ class OverMapView @JvmOverloads constructor(
|
||||
return bitmap
|
||||
}
|
||||
|
||||
fun clearV2XMarkers() {
|
||||
private fun clearV2XMarkers() {
|
||||
if (currMarkerList != null) {
|
||||
for (marker in currMarkerList!!) {
|
||||
marker.destroy()
|
||||
@@ -428,6 +471,7 @@ class OverMapView @JvmOverloads constructor(
|
||||
bitmap
|
||||
)
|
||||
)
|
||||
markerOption.anchor(0.18f, 0.98f)
|
||||
markerOption.zIndex(2f)
|
||||
posInfMap[latLng] = structureList
|
||||
markerOptionsList.add(markerOption)
|
||||
@@ -448,8 +492,8 @@ class OverMapView @JvmOverloads constructor(
|
||||
val marker = MakerWithCount(context)
|
||||
marker.setCount(count)
|
||||
marker.measure(
|
||||
MeasureSpec.makeMeasureSpec(116, MeasureSpec.EXACTLY),
|
||||
MeasureSpec.makeMeasureSpec(116, MeasureSpec.EXACTLY)
|
||||
MeasureSpec.makeMeasureSpec(AutoSizeUtils.dp2px(mContext, 116f), MeasureSpec.EXACTLY),
|
||||
MeasureSpec.makeMeasureSpec(AutoSizeUtils.dp2px(mContext, 116f), MeasureSpec.EXACTLY)
|
||||
)
|
||||
marker.layout(0, 0, marker.measuredWidth, marker.measuredHeight)
|
||||
val bitmap = Bitmap.createBitmap(marker.width, marker.height, Bitmap.Config.ARGB_8888)
|
||||
@@ -486,7 +530,7 @@ class OverMapView @JvmOverloads constructor(
|
||||
} else {
|
||||
//设置希望展示的地图缩放级别
|
||||
val cameraPosition = CameraPosition.Builder()
|
||||
.target(mCarMarker!!.position).tilt(0f).zoom(zoomLevel.toFloat()).build()
|
||||
.target(mCarMarker!!.position).tilt(mTilt).zoom(zoomLevel.toFloat()).build()
|
||||
mAMap!!.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ import com.mogo.commons.constants.SharedPrefsConstants
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.network.NetConfigUtils
|
||||
import com.mogo.commons.network.Utils
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_CONNECT_FAIL
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_CONNECT_LOST
|
||||
@@ -32,10 +31,7 @@ import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ProcessUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadPoolService
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.rousetime.android_startup.AndroidStartup
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD
|
||||
@@ -114,9 +110,9 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
|
||||
// TODO 现在这块逻辑因为网约车业务那后台的限制,还没有更换,条件成熟后替换为 DeviceIdUtils.getWidevineIDWithMd5(context)
|
||||
// 这里影响当前Activity的身份信息,多进程先保持与原来一样,主进程为司机端,:passenger 进程为乘客端
|
||||
if (ProcessUtils.getCurrentProcessName().contains(":passenger")) {
|
||||
clientConfig.thirdPartyDeviceId = Utils.getDevicesId() + "_passenger"
|
||||
clientConfig.thirdPartyDeviceId = DeviceUtils.getDeviceSN() + "_passenger"
|
||||
} else {
|
||||
clientConfig.thirdPartyDeviceId = Utils.getDevicesId()
|
||||
clientConfig.thirdPartyDeviceId = DeviceUtils.getDeviceSN()
|
||||
}
|
||||
//设置长链接的secretKey 通过SHA1和包名找中台服务生成,后续包名分渠道,需要做对应操作
|
||||
clientConfig.secretKey = "YMj2VFDFxJ3Q4gNoZceJ"
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity;
|
||||
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity;
|
||||
import com.mogo.eagle.core.data.v2x.V2XOptimalRouteDataRes;
|
||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerResponse
|
||||
import com.mogo.eagle.core.function.v2x.internal.http.api.V2XApiService
|
||||
import com.mogo.eagle.core.function.v2x.internal.http.body.V2XRefreshEntity
|
||||
import com.mogo.eagle.core.function.v2x.internal.http.callback.IV2XRefreshCallback
|
||||
import com.mogo.eagle.core.function.v2x.internal.utils.DeviceUtils
|
||||
import com.mogo.eagle.core.utilcode.util.DeviceUtils
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
@@ -64,7 +64,7 @@ internal class V2XRefreshModel {
|
||||
handled
|
||||
})
|
||||
this["netType"] = CommonUtils.getNetworkType(config.context)
|
||||
this["cellId"] = DeviceUtils.getCellId(config.context) ?: ""
|
||||
this["cellId"] = DeviceUtils.getCellId() ?: ""
|
||||
this["sn"] = config.aiCloudConfig.sn
|
||||
this["ticket"] = config.aiCloudConfig.token
|
||||
this["sig"] = SignUtil.createSign(this, "JGjZx6")
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
package com.mogo.eagle.core.function.v2x.internal.utils
|
||||
|
||||
import android.Manifest
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.pm.PackageManager
|
||||
import android.telephony.CellLocation
|
||||
import android.telephony.TelephonyManager
|
||||
import android.telephony.cdma.CdmaCellLocation
|
||||
import android.telephony.gsm.GsmCellLocation
|
||||
import java.lang.Exception
|
||||
|
||||
internal class DeviceUtils {
|
||||
|
||||
companion object {
|
||||
|
||||
@SuppressLint("MissingPermission")
|
||||
@JvmStatic
|
||||
fun getCellId(context: Context): String? {
|
||||
val tm = context.getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager
|
||||
val pm = context.packageManager
|
||||
val accessCoarseLocationPermission = PackageManager.PERMISSION_GRANTED ==
|
||||
pm.checkPermission(Manifest.permission.ACCESS_COARSE_LOCATION, context.packageName)
|
||||
val accessFineLocationPermission = PackageManager.PERMISSION_GRANTED ==
|
||||
pm.checkPermission(Manifest.permission.ACCESS_FINE_LOCATION, context.packageName)
|
||||
if (!accessCoarseLocationPermission || !accessFineLocationPermission) return "noPermission"
|
||||
var location: CellLocation? = null
|
||||
try {
|
||||
location = tm.cellLocation
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
if (location != null) {
|
||||
// Gsm网络 , 联通移动的网络属于这一套
|
||||
if (location is GsmCellLocation) {
|
||||
val cellid = location.cid
|
||||
return cellid.toString()
|
||||
// Cdma网络 , 电信网络属于这一种
|
||||
} else if (location is CdmaCellLocation) {
|
||||
return location.baseStationId.toString()
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user