Merge remote-tracking branch 'origin/dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0' into dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0

This commit is contained in:
yangyakun
2023-02-15 20:10:58 +08:00
43 changed files with 334 additions and 379 deletions

View File

@@ -16,7 +16,6 @@ import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
import com.mogo.eagle.core.function.view.MapBizView;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
@@ -59,9 +58,6 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
@Override
protected void initViews() {
//隐藏小地图
CallerSmpManager.INSTANCE.hidePanel();
mapBizView = findViewById(R.id.mapBizView);
mCurrentArriveStation = findViewById(R.id.bus_p_cur_station_name);
mCurrentArriveStationTitle = findViewById(R.id.bus_p_cur_station_title);

View File

@@ -1,5 +1,7 @@
package com.mogo.och.bus.passenger.callback
import com.mogo.och.bus.passenger.bean.PM2Station
/**
* @author: wangmingjun
* @date: 2023/2/2
@@ -11,4 +13,5 @@ interface DrivingInfoCallback {
fun updateRemainMT(meters : Long, timeInSecond : Long) // 米,秒
fun changeOperationStatus(loginStatus : Boolean)
fun showNoTaskView(isTrue : Boolean)
fun updateLineStations(stations: MutableList<PM2Station>)
}

View File

@@ -90,7 +90,7 @@ class PM2DrivingModel private constructor() {
// 定位监听
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, mMapLocationListener)
CallerChassisLocationGCJ02ListenerManager.setListenerHz(TAG,5)//设置5hz, 1s返回
CallerChassisLocationGCJ02ListenerManager.setListenerHz(TAG,2)//设置2hz, 1s返回2
CallerTelematicListenerManager.addListener(TAG,mReceivedMsgListener)
}
@@ -243,11 +243,12 @@ class PM2DrivingModel private constructor() {
private fun updatePassengerRouteInfo(result: PM2RoutesResult) {
mDrivingInfoCallback?.updateLine(result.name, result.runningDur)
mDrivingInfoCallback?.showNoTaskView(false)
if (result.sites != null) {
mDrivingInfoCallback?.showNoTaskView(false)
val stations: List<PM2Station> = result.sites
mStations.clear()
mStations.addAll(stations)
mDrivingInfoCallback?.updateLineStations(mStations)
for (i in stations.indices) {
val station: PM2Station = stations[i]
if (station.drivingStatus == BusPassengerConst.STATION_STATUS_STOPPED

View File

@@ -3,6 +3,7 @@ package com.mogo.och.bus.passenger.presenter
import androidx.lifecycle.LifecycleOwner
import com.mogo.commons.mvp.Presenter
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.bus.passenger.bean.PM2Station
import com.mogo.och.bus.passenger.callback.AutoPilotStatusCallback
import com.mogo.och.bus.passenger.callback.DrivingInfoCallback
import com.mogo.och.bus.passenger.model.PM2DrivingModel
@@ -65,6 +66,12 @@ class PM2DrivingPresenter(view: PM2DrivingInfoFragment?) :
}
}
override fun updateLineStations(stations: MutableList<PM2Station>) {
UiThreadHandler.post {
mView?.updateLineStations(stations)
}
}
override fun updateAutoStatus(isOpen: Boolean) {
UiThreadHandler.post {
mView?.updateAutoStatus(isOpen)
@@ -72,6 +79,6 @@ class PM2DrivingPresenter(view: PM2DrivingInfoFragment?) :
}
override fun updateAutoStatus(status: Int) {
TODO("Not yet implemented")
}
}

View File

@@ -1,11 +1,14 @@
package com.mogo.och.bus.passenger.ui
import android.graphics.BitmapFactory
import android.os.Bundle
import android.view.View
import androidx.core.content.ContextCompat
import com.amap.api.maps.model.LatLng
import com.mogo.commons.mvp.MvpFragment
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.bean.PM2Station
import com.mogo.och.bus.passenger.presenter.PM2DrivingPresenter
import com.mogo.och.common.module.utils.DateTimeUtil.*
import kotlinx.android.synthetic.m2.p_m2_driving_info_fragment.*
@@ -98,6 +101,8 @@ class PM2DrivingInfoFragment :
line_name_tv.visibility = View.GONE
line_during_tv.visibility = View.GONE
no_line_tv.visibility = View.VISIBLE
overMapView.clearSiteMarkers()
overMapView.clearCustomPolyline()
}
}
@@ -115,6 +120,17 @@ class PM2DrivingInfoFragment :
}
}
fun updateLineStations(stations: MutableList<PM2Station>){
var stationsList = mutableListOf<LatLng>()
for (i in stations.indices){
val station = stations[i]
var latLng = LatLng(station.gcjLat,station.gcjLon)
stationsList.add(latLng)
}
overMapView?.drawSiteMarkers(stationsList,
BitmapFactory.decodeResource(resources,R.drawable.m2_map_staton_icon),0.5f,0.9f)
}
companion object {
private val TAG = PM2DrivingInfoFragment::class.java.simpleName
}

View File

@@ -7,7 +7,6 @@ import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.constraintlayout.widget.ConstraintLayout
import chassis.ChassisStatesOuterClass
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.api.autopilot.IMoGoBatteryManagementSystemListener
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
@@ -15,7 +14,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerBatteryManagementSystem
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
import com.mogo.och.bus.passenger.R
import kotlinx.android.synthetic.m2.p_m2_view_status_bar.view.*
import me.jessyan.autosize.utils.AutoSizeUtils

View File

@@ -1,10 +1,13 @@
package com.mogo.och.bus.passenger.ui.widget.video
import android.annotation.SuppressLint
import android.content.Context
import android.util.AttributeSet
import android.widget.ImageView
import android.widget.RelativeLayout
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
import com.mogo.och.bus.passenger.R
/**
* @author: wangmingjun
@@ -26,7 +29,10 @@ class AdvanceImageView @JvmOverloads constructor(
addView(imageView, LayoutParams(-1, -1))
}
@SuppressLint("CheckResult")
fun setImagePath(path: String){
imageView?.let { Glide.with(context).load(path).into(it) }
imageView?.let { Glide.with(context).load(path)
.apply { RequestOptions().placeholder(R.drawable.m2_p_video_holder).centerCrop() }
.into(it) }
}
}

View File

@@ -6,6 +6,7 @@ import android.view.ViewGroup
import androidx.viewpager.widget.PagerAdapter
import androidx.viewpager.widget.ViewPager
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
/**
* @author: wangmingjun
@@ -48,10 +49,27 @@ class AdvancePagerAdapter(context: Context, viewPager: ViewPager) : PagerAdapter
Logger.d("onPageScrollStateChanged", "第一个是视频")
val video = viewList[mViewPager.currentItem] as AdvanceVideoView
video.setCacheImageView(dataList[mViewPager.currentItem].cacheImgPath)
video.setVideo {
Logger.d("onPageScrollStateChanged", "视频播放完成")
goNextItemView()
}
video.setVideo( object : GSYSampleCallBack() {
override fun onPrepared(url: String?, vararg objects: Any?) {
super.onPrepared(url, *objects)
Logger.d("onPageScrollStateChanged", "onPrepared")
video.setCacheImageViewGone()
}
override fun onAutoComplete(url: String?, vararg objects: Any?) {
Logger.d("onPageScrollStateChanged", "onAutoComplete()")
video.setCacheImageView(dataList[mViewPager.currentItem].cacheImgPath)
mViewPager.setCurrentItem(mViewPager.currentItem + 1, true)
}
override fun onPlayError(url: String?, vararg objects: Any?) {
Logger.d("onPageScrollStateChanged", "onPlayError()")
video.setCacheImageView(dataList[mViewPager.currentItem].cacheImgPath)
mViewPager.setCurrentItem(mViewPager.currentItem + 1, true)
}
})
} else if (viewList[mViewPager.currentItem] is AdvanceImageView) {
Logger.d("onPageScrollStateChanged", "startTimer()_1")
current = 0//换页重新计算时间
@@ -137,10 +155,27 @@ class AdvancePagerAdapter(context: Context, viewPager: ViewPager) : PagerAdapter
if (viewList[mViewPager.currentItem] is AdvanceVideoView) {
val videoView = (viewList[mViewPager.currentItem] as AdvanceVideoView)
videoView.setVideo {
videoView.setCacheImageView(dataList[mViewPager.currentItem].cacheImgPath)
mViewPager.setCurrentItem(mViewPager.currentItem + 1, true)
}
videoView.setVideo(object : GSYSampleCallBack() {
override fun onPrepared(url: String?, vararg objects: Any?) {
super.onPrepared(url, *objects)
Logger.d("onPageScrollStateChanged", "onPrepared")
videoView.setCacheImageViewGone()
}
override fun onAutoComplete(url: String?, vararg objects: Any?) {
super.onAutoComplete(url, *objects)
Logger.d("onPageScrollStateChanged", "onAutoComplete()")
videoView.setCacheImageView(dataList[mViewPager.currentItem].cacheImgPath)
mViewPager.setCurrentItem(mViewPager.currentItem + 1, true)
}
override fun onPlayError(url: String?, vararg objects: Any?) {
super.onPlayError(url, *objects)
Logger.d("onPageScrollStateChanged", "onPlayError()")
videoView.setCacheImageView(dataList[mViewPager.currentItem].cacheImgPath)
mViewPager.setCurrentItem(mViewPager.currentItem + 1, true)
}
})
} else if (viewList[mViewPager.currentItem] is AdvanceImageView) {
Logger.d("onPageScrollStateChanged", "startTimer()")
@@ -166,6 +201,8 @@ class AdvancePagerAdapter(context: Context, viewPager: ViewPager) : PagerAdapter
if (viewList[mViewPager.currentItem] is AdvanceImageView) {
Logger.d("onPageScrollStateChanged", "增加1s")
current += 1000
}else{
break
}
if (current >= time) {
Logger.d("onPageScrollStateChanged", "5s到跳转")

View File

@@ -1,17 +1,17 @@
package com.mogo.och.bus.passenger.ui.widget.video
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Bitmap
import android.graphics.Color
import android.media.MediaMetadataRetriever
import android.media.MediaPlayer
import android.util.AttributeSet
import android.widget.ImageView
import android.widget.RelativeLayout
import android.widget.VideoView
import com.bumptech.glide.Glide
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import java.lang.RuntimeException
import com.bumptech.glide.request.RequestOptions
import com.mogo.och.bus.passenger.R
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
/**
* @author: wangmingjun
@@ -23,7 +23,8 @@ class AdvanceVideoView @JvmOverloads constructor(
private var videoRelativeLayout: RelativeLayout? = null
private var cacheImage: ImageView? = null
private var videoView: VideoView? = null
private var videoViewPlayer: StandardGSYVideoPlayer? = null
private var gsyVideoOptionBuilder: GSYVideoOptionBuilder? = null
private var path: String? = null
init {
@@ -31,33 +32,29 @@ class AdvanceVideoView @JvmOverloads constructor(
}
private fun initView() {
videoRelativeLayout = RelativeLayout(context)
addView(videoRelativeLayout, LayoutParams(-1, -1))
initCacheImgView()
initVideoView()
}
private fun initCacheImgView() {
cacheImage = ImageView(context)
cacheImage?.scaleType = ImageView.ScaleType.FIT_XY
addView(cacheImage, LayoutParams(-1, -1))
}
fun setVideoPath(path: String){
this.path = path
}
private fun initVideoView() {
videoRelativeLayout = RelativeLayout(context)
addView(videoRelativeLayout, LayoutParams(-1, -1))
fun setCacheImageView(imgPath: String){
cacheImage?.visibility = VISIBLE
cacheImage?.let { Glide.with(context).load(imgPath).into(it) }
}
fun setVideo(onCompletionListener : MediaPlayer.OnCompletionListener) {
if (videoView != null){
videoRelativeLayout?.removeView(videoView)
videoView = null
if (videoViewPlayer === null) {
//视频播放控件
videoViewPlayer = StandardGSYVideoPlayer(context)
}
if (gsyVideoOptionBuilder === null) {
gsyVideoOptionBuilder = GSYVideoOptionBuilder()
}
//视频播放控件
videoView = VideoView(context)
videoView?.setVideoPath(path)
videoView?.setBackgroundColor(Color.TRANSPARENT)
videoViewPlayer?.isFocusableInTouchMode = false
var layoutParams = LayoutParams(-1, -1)
//设置videoview占满父view播放
@@ -65,29 +62,48 @@ class AdvanceVideoView @JvmOverloads constructor(
layoutParams.addRule(ALIGN_PARENT_RIGHT)
layoutParams.addRule(ALIGN_PARENT_TOP)
layoutParams.addRule(ALIGN_PARENT_BOTTOM)
videoRelativeLayout?.addView(videoView, layoutParams)
videoView?.setOnCompletionListener(onCompletionListener)
videoView?.start()
videoView?.setOnPreparedListener {
UiThreadHandler.postDelayed({
cacheImage?.visibility = GONE
},500)
videoRelativeLayout?.addView(videoViewPlayer, layoutParams)
}
fun setVideoPath(path: String) {
this.path = path
}
@SuppressLint("CheckResult")
fun setCacheImageView(imgPath: String) {
cacheImage?.visibility = VISIBLE
cacheImage?.let {
Glide.with(context)
.apply { RequestOptions().placeholder(R.drawable.m2_p_video_holder).centerCrop() }
.load(imgPath).into(it)
}
}
videoView?.setOnCompletionListener(onCompletionListener)
fun setVideo(onCompletionListener: GSYSampleCallBack) {
gsyVideoOptionBuilder?.setUrl(path)
?.setBottomProgressBarDrawable(null)
?.build(videoViewPlayer)
videoViewPlayer?.setVideoAllCallBack(onCompletionListener)
videoViewPlayer?.startPlayLogic()
}
fun setCacheImageViewGone() {
cacheImage?.visibility = GONE
}
fun setPause() {
if (videoView != null) {
videoView?.pause()
if (videoViewPlayer !== null) {
videoViewPlayer?.onVideoPause()
}
}
fun setRestart() {
if (videoView != null) {
videoView?.start()
if (videoViewPlayer !== null) {
videoViewPlayer?.startPlayLogic()
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

@@ -11,7 +11,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
app:mapStyleExtraPath="@string/m2_over_map_style_extra_path"
app:mapStylePath="@string/m2_over_map_style_path" />
app:mapStylePath="@string/m2_over_map_style_path"
app:endPointDrawable="@drawable/m2_map_end_icon"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/img_drive_bg"

View File

@@ -1,7 +1,6 @@
package com.mogo.och.bus.bean;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.network.Utils;
public
/**

View File

@@ -1,7 +1,6 @@
package com.mogo.och.bus.bean;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.network.Utils;
/**
* @author: wangmingjun

View File

@@ -1,7 +1,6 @@
package com.mogo.och.bus.bean;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.network.Utils;
/**
* @author congtaowang

View File

@@ -1,7 +1,6 @@
package com.mogo.och.bus.bean;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.network.Utils;
/**
* 查询下车乘客请求参数

View File

@@ -19,7 +19,6 @@ import com.mogo.eagle.core.data.temp.EventLogout;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.map.marker.IMogoMarker;

View File

@@ -18,7 +18,6 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager;
import com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView;
import com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxButtonView;
@@ -93,9 +92,6 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
@Override
protected void initViews() {
hideEagleConfig();
mapBizView = findViewById(R.id.mapBizView);
mAutopilotImage = findViewById(R.id.module_och_autopilot_iv);
mMapswitchBtn = findViewById(R.id.module_och_taxi_swich_map_iv);
@@ -188,14 +184,6 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
mArrivedCheckView.get().setITaxiPassengerCommonValueCallback(phoneTail -> getPresenter().checkAndUpdateStatus(phoneTail));
}
/**
* 隐藏鹰眼原有控件
*/
private void hideEagleConfig() {
//隐藏小地图
CallerSmpManager.INSTANCE.hidePanel();
}
@Override
public void onResume() {
super.onResume();

View File

@@ -37,6 +37,9 @@ project.android.productFlavors {
// 构建的是否是演示(美化)模式
buildConfigField 'boolean', 'IS_DEMO_MODE', 'false'
// 构建的是否要动态更换模型
buildConfigField 'boolean', 'IS_CAR_MODEL_CHANGE', 'true'
// 构建 是否支持多屏异显异交互
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'false'
}

View File

@@ -1,7 +1,6 @@
package com.mogo.launcher.startup
import android.content.Context
import android.util.Log
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig
@@ -10,7 +9,6 @@ import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.deva.net.UrlConfig
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.ProcessUtils
import com.mogo.launcher.BuildConfig
import com.mogo.launcher.R
import com.mogo.test.crashreport.CrashReportConstants
@@ -35,7 +33,6 @@ object ConfigStartUp {
AppConfigInfo.appBuildTime = BuildConfig.APP_BUILD_TIME
// 使用与渠道配置一样的gps提供者提供的数据,app/productFlavors/fPadLenovo.gradle GPS_PROVIDER 0-Android系统1-工控机2-OBU
FunctionBuildConfig.gpsProvider = BuildConfig.GPS_PROVIDER
// FunctionBuildConfig.gpsProvider = 2
// 演示模式,上一次勾选的数据
FunctionBuildConfig.isDemoMode = BuildConfig.IS_DEMO_MODE
// // app安装的身份信息
@@ -43,8 +40,6 @@ object ConfigStartUp {
// 各个module需要的url
FunctionBuildConfig.urlJson = GsonUtils.fromJson(BuildConfig.URLs, UrlConfig::class.java)
Log.d("ConfigStartUp", "ProcessUtils.getCurrentProcessName():" + ProcessUtils.getCurrentProcessName())
// // 这里影响当前Activity的身份信息多进程先保持与原来一样主进程为司机端:passenger 进程为乘客端 TODO 暂时不启用,仅做洱海交付,独立乘客屏+宣传视频
// if (ProcessUtils.getCurrentProcessName().contains(":passenger")) {
// if (AppIdentityModeUtils.isBus(BuildConfig.APP_IDENTITY_MODE)) {
@@ -77,7 +72,6 @@ object ConfigStartUp {
DebugConfig.setSocketAppId(BuildConfig.SOCKET_APP_ID)
DebugConfig.setMapVersion(BuildConfig.MAP_SDK_VERSION)
DebugConfig.setMapOptVersion(BuildConfig.MAP_SDK_OPT_VERSION)
DebugConfig.setNeedUploadCoordinatesInTime(BuildConfig.IS_NEED_UPLOAD_COORDINATES_IN_TIME)
DebugConfig.setMultiDisplay(BuildConfig.IS_MULTI_DISPLAY)
DebugConfig.setCarModelChange(BuildConfig.IS_CAR_MODEL_CHANGE)
}
@@ -109,23 +103,27 @@ object ConfigStartUp {
val mapParams = MapParams.init()
mapParams.setDebugMode(false) //todo 1-使用本地地图数据0-使用在线地图数据
//.setDataFileSource(1)
.setDebugMode(false)
.setCoordinateType(MapParams.COORDINATETYPE_GCJ02)
.setPerspectiveMode(MapParams.MAP_PERSPECTIVE_UP_CAR)
.setHDVisibileArray(intArrayOf(
HDTypes.DIVIDER.type,
HDTypes.ROAD_AREA.type,
HDTypes.STOP_LINE.type,
HDTypes.ARROW.type,
HDTypes.STATION_BRIDGE.type,
HDTypes.ZEBRA_LINE.type,
HDTypes.GREEN_BELT.type,
HDTypes.DIVERSION.type,
HDTypes.SAFE_ISLAND.type,
HDTypes.ALPHANUMERIC.type,
HDTypes.GUARDBAR.type,
HDTypes.TRAFFIC_DEVICE.type,
HDTypes.CABLE.type,
HDTypes.SIGNAL_LINE.type))
.setHDVisibileArray(
intArrayOf(
HDTypes.DIVIDER.type,
HDTypes.ROAD_AREA.type,
HDTypes.STOP_LINE.type,
HDTypes.ARROW.type,
HDTypes.STATION_BRIDGE.type,
HDTypes.ZEBRA_LINE.type,
HDTypes.GREEN_BELT.type,
HDTypes.DIVERSION.type,
HDTypes.SAFE_ISLAND.type,
HDTypes.ALPHANUMERIC.type,
HDTypes.GUARDBAR.type,
HDTypes.TRAFFIC_DEVICE.type,
HDTypes.CABLE.type,
HDTypes.SIGNAL_LINE.type
)
)
// .setZoom( 20 )
// .setPointToCenter( 0.734375f, 0.5f )
//todo 2D模式下需要注意ADAS部分遮挡

View File

@@ -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()

View File

@@ -101,7 +101,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) {

View File

@@ -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
)
}

View File

@@ -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绑定控制
*/

View File

@@ -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
}
}
}

View File

@@ -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
@@ -71,8 +72,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)
}
}
}

View File

@@ -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"

View File

@@ -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"

View File

@@ -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;

View File

@@ -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")

View File

@@ -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
}
}
}

View File

@@ -28,6 +28,7 @@ object AppConfigInfo {
// 高精地图版本
var mapSdkVersion: String? = null
// 高精地图采集版本
var mapSdkOptVersion: String? = null
var adasSdkVersion: String? = null
@@ -40,12 +41,15 @@ object AppConfigInfo {
//车牌号
@Volatile
var plateNumber: String? = null
//工控机MAC地址
@Volatile
var iPCMacAddress: String? = null
//工控机DockerVersion
@Volatile
var dockerVersion: String? = null
//工控机协议版本
var protocolVersionNumber: Int = 0
@@ -168,11 +172,17 @@ object AppConfigInfo {
"<font color='red'>"
}
}${isConnectedNetty}</font><br/>" +
"<font color='red' size='30'>------------------工控机感知&规控数据---------------------</font><br/>"
"<font color='red' size='30'>------------------工控机数据---------------------</font><br/>"+
"车牌:${plateNumber}<br/>" +
"mac${iPCMacAddress}<br/>" +
"docker version${dockerVersion}<br/>" +
"protocol${protocolVersionNumber}<br/>" +
"<font color='red' size='30'>------------------业务信息---------------------</font><br/>"+
"角色:$role , isDriver : $isDriver <br/>"
}
}
fun AppConfigInfo.toConfigUpload():ConfigUpload{
fun AppConfigInfo.toConfigUpload(): ConfigUpload {
val configUpload = ConfigUpload()
configUpload.adasSdkVersion = adasSdkVersion
configUpload.appBuildTime = appBuildTime
@@ -199,12 +209,11 @@ fun AppConfigInfo.toConfigUpload():ConfigUpload{
configUpload.protocolVersionNumber = protocolVersionNumber
configUpload.role = role
configUpload.serverSn = serverSn
configUpload.iPCMacAddress = iPCMacAddress
configUpload.teleTimeStamp = teleTimeStamp
configUpload.timeStamp = System.currentTimeMillis()
configUpload.uniqueDeviceId = uniqueDeviceId
configUpload.widevineIDMd5 = widevineIDMd5
configUpload.workingBranchHash = workingBranchHash
configUpload.workingBranchName = workingBranchName
return configUpload
return configUpload
}

View File

@@ -89,6 +89,14 @@ object FunctionBuildConfig {
@JvmField
var isFusionColor = false
/**
* 是否开启obu rv预警感知物融合功能 , 仅大理,烟台交付项目
* 默认关闭
*/
@Volatile
@JvmField
var isObuWarningFusionUnion = false
/**
* 当前APP的身份模式
*

View File

@@ -2,6 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mogo.eagle.core.utilcode.util">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />

View File

@@ -5,9 +5,11 @@ import static android.Manifest.permission.CHANGE_WIFI_STATE;
import static android.Manifest.permission.INTERNET;
import static android.content.Context.WIFI_SERVICE;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.net.Uri;
@@ -15,7 +17,10 @@ import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.provider.Settings;
import android.telephony.CellLocation;
import android.telephony.TelephonyManager;
import android.telephony.cdma.CdmaCellLocation;
import android.telephony.gsm.GsmCellLocation;
import android.text.TextUtils;
import android.util.Log;
@@ -528,6 +533,41 @@ public final class DeviceUtils {
return prefix + UUID.nameUUIDFromBytes(id.getBytes()).toString().replace("-", "");
}
public static String getCellId() {
TelephonyManager tm = (TelephonyManager) Utils.getApp().getSystemService(Context.TELEPHONY_SERVICE);
if (tm == null) {
return "";
}
PackageManager pm = Utils.getApp().getPackageManager();
boolean accessCoarseLocationPermission = (PackageManager.PERMISSION_GRANTED ==
pm.checkPermission(Manifest.permission.ACCESS_COARSE_LOCATION, Utils.getApp().getPackageName()));
boolean accessFineLocationPermission = (PackageManager.PERMISSION_GRANTED ==
pm.checkPermission(Manifest.permission.ACCESS_FINE_LOCATION, Utils.getApp().getPackageName()));
if (!accessCoarseLocationPermission || !accessFineLocationPermission)
return "noPermission";
CellLocation location = null;
try {
location = tm.getCellLocation();
} catch (Exception e) {
e.printStackTrace();
}
if (location != null) {
// Gsm网络 , 联通移动的网络属于这一套
if (location instanceof GsmCellLocation) {
GsmCellLocation gsmLoc = (GsmCellLocation) location;
int cellid = gsmLoc.getCid();
return String.valueOf(cellid);
// Cdma网络 , 电信网络属于这一种
} else if (location instanceof CdmaCellLocation) {
CdmaCellLocation cdmaLoc = (CdmaCellLocation) location;
return String.valueOf(cdmaLoc.getBaseStationId());
}
}
return "";
}
/**
* 判断用户是否打开系统定位服务
*
@@ -574,10 +614,10 @@ public final class DeviceUtils {
// 中科创达 EB5获取SN
serial = (String) get.invoke(c, "persist.device.sn");
}
if (TextUtils.isEmpty(serial)) {
// 联想PAD 获取SN
serial = (String) get.invoke(c, "ro.odm.lenovo.gsn");
}
// if (TextUtils.isEmpty(serial)) {
// // 联想PAD 获取SN,2022-2023款PAD无法获取暂时不启用
// serial = (String) get.invoke(c, "ro.odm.lenovo.gsn");
// }
} catch (Exception e) {
e.printStackTrace();
}
@@ -609,6 +649,26 @@ public final class DeviceUtils {
return productModel;
}
/**
* @return 获取Fota系统版本
*/
public static String getFotaVersion() {
String fotaVersion = "";
try {
Class<?> c = Class.forName("android.os.SystemProperties");
Method get = c.getMethod("get", String.class);
fotaVersion = (String) get.invoke(c, "ro.fota.version");
if (!TextUtils.isEmpty(fotaVersion)) {
fotaVersion = fotaVersion.trim();
}
} catch (Exception e) {
e.printStackTrace();
}
return fotaVersion;
}
private static String getSerialnoNumbers() {
final String serialnoStr = "[ro.boot.serialno]";
try {
@@ -633,4 +693,29 @@ public final class DeviceUtils {
}
return serialnoStr;
}
public static final String KEY_DEVICE_ID = "deviceId";
/**
* 获取设备SN信息首次获取后会存储SP后续获取都从SP获取
*
* @return 当前的设备SN信息优先使用设备固定的sn
*/
public static String getDeviceSN() {
String devicesSN = SPUtils.getInstance().getString(KEY_DEVICE_ID);
if (TextUtils.isEmpty(devicesSN)) {
// 获取设备唯一SN
devicesSN = getSerialNumber();
// 获取 android id of device
if (TextUtils.isEmpty(devicesSN)) {
devicesSN = getAndroidID();
// 获取随机的设备ID
if (TextUtils.isEmpty(devicesSN)) {
devicesSN = getUniqueDeviceId();
}
}
SPUtils.getInstance().put(KEY_DEVICE_ID, devicesSN);
}
return devicesSN;
}
}

View File

@@ -168,18 +168,6 @@ public class DebugConfig {
return mapOptVersion;
}
/**
* 是否需要实时上报坐标位置
*/
private static boolean sIsNeedUploadCoordinatesInTime = false;
public static boolean isNeedUploadCoordinatesDurationInTime() {
return sIsNeedUploadCoordinatesInTime;
}
public static void setNeedUploadCoordinatesInTime(boolean sIsNeedUploadCoordinatesInTime) {
DebugConfig.sIsNeedUploadCoordinatesInTime = sIsNeedUploadCoordinatesInTime;
}
// 兼容是否支持多屏幕方案
private static boolean isMultiDisplay = false;

View File

@@ -16,7 +16,7 @@ import com.mogo.eagle.core.network.ServerParam;
import com.mogo.eagle.core.network.utils.GsonUtil;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.CommonUtils;
import com.mogo.eagle.core.utilcode.util.DeviceIdUtils;
import com.mogo.eagle.core.utilcode.util.DeviceUtils;
import com.mogo.eagle.core.utilcode.util.WindowUtils;
import java.io.UnsupportedEncodingException;
@@ -38,7 +38,7 @@ public class ParamsUtil {
params.putAll(location);
}
params.put(ServerParam.NET_TYPE, CommonUtils.getNetworkType(AbsMogoApplication.getApp()));
params.put(ServerParam.CELL_ID, Utils.getCellId(AbsMogoApplication.getApp()));
params.put(ServerParam.CELL_ID, DeviceUtils.getCellId());
// params.put( ServerParam.DISPLAY_ID, DeviceUtil.getSystemVersion() );
params.put(ServerParam.SN, MoGoAiCloudClientConfig.getInstance().getSn());
@@ -61,10 +61,10 @@ public class ParamsUtil {
STATIC_PARAMS.put(ServerParam.VERSION_NAME, CommonUtils.getVersionName(AbsMogoApplication.getApp()));
STATIC_PARAMS.put(ServerParam.SCREEN_PIXELS, WindowUtils.getScreenPixels(AbsMogoApplication.getApp()));
STATIC_PARAMS.put(ServerParam.ANDROID_ID, CommonUtils.getAndroidID(AbsMogoApplication.getApp()));
STATIC_PARAMS.put(ServerParam.DEVICE_ID, DeviceIdUtils.getDeviceId(AbsMogoApplication.getApp()));
STATIC_PARAMS.put(ServerParam.DEVICE_ID, DeviceUtils.getDeviceSN());
STATIC_PARAMS.put(ServerParam.IMEI, CommonUtils.getIMEI(AbsMogoApplication.getApp()));
STATIC_PARAMS.put(ServerParam.IMSI, CommonUtils.getIMSI(AbsMogoApplication.getApp()));
STATIC_PARAMS.put(ServerParam.FOTA_VERSION, Utils.getFotaVersion());
STATIC_PARAMS.put(ServerParam.FOTA_VERSION, DeviceUtils.getFotaVersion());
STATIC_PARAMS.put(ServerParam.END_POINT, ServerParam.END_POINT_CAR);
}
@@ -75,7 +75,7 @@ public class ParamsUtil {
public static Map<String, Object> getAnalyticsCustomParams() {
Map<String, Object> map = new ArrayMap<>();
map.put("debug", DebugConfig.isDebug() ? 1 : 0);
String fota = Utils.getFotaVersion();
String fota = DeviceUtils.getFotaVersion();
map.put("systemversion", TextUtils.isEmpty(fota) ? DebugConfig.getProductFlavor() : fota);
map.put("sn", MoGoAiCloudClientConfig.getInstance().getSn());
return map;

View File

@@ -1,90 +0,0 @@
package com.mogo.commons.network;
import android.Manifest;
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 com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.utilcode.util.DeviceIdUtils;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/**
* Created by congtaowang on 2018/3/29.
*/
public class Utils {
public static String getCellId(Context context) {
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
if (tm == null) {
return "";
}
PackageManager pm = context.getPackageManager();
boolean accessCoarseLocationPermission = (PackageManager.PERMISSION_GRANTED ==
pm.checkPermission(Manifest.permission.ACCESS_COARSE_LOCATION, context.getPackageName()));
boolean accessFineLocationPermission = (PackageManager.PERMISSION_GRANTED ==
pm.checkPermission(Manifest.permission.ACCESS_FINE_LOCATION, context.getPackageName()));
if (!accessCoarseLocationPermission || !accessFineLocationPermission)
return "noPermission";
CellLocation location = null;
try {
location = tm.getCellLocation();
} catch (Exception e) {
e.printStackTrace();
}
if (location != null) {
// Gsm网络 , 联通移动的网络属于这一套
if (location instanceof GsmCellLocation) {
GsmCellLocation gsmLoc = (GsmCellLocation) location;
int cellid = gsmLoc.getCid();
return String.valueOf(cellid);
// Cdma网络 , 电信网络属于这一种
} else if (location instanceof CdmaCellLocation) {
CdmaCellLocation cdmaLoc = (CdmaCellLocation) location;
return String.valueOf(cdmaLoc.getBaseStationId());
}
}
return "";
}
public static final String GET = "get";
public static final String GSM_SERIAL = "gsm.serial";
public static final String BYD_SERIAL = "ro.serialno";
public static final String FOTA_VERSION = "ro.fota.version";
public static final String PROPERTIES = "android.os.SystemProperties";
public static String getDevicesId() {
if (DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
return DeviceIdUtils.getDeviceId(AbsMogoApplication.getApp());
}
return getSystemProperties(GSM_SERIAL);
}
public static String getFotaVersion() {
return getSystemProperties(FOTA_VERSION);
}
public static String getSystemProperties(String name) {
String value = "";
try {
Class<?> c = Class.forName(PROPERTIES);
Method get = c.getMethod(GET, String.class);
value = (String) get.invoke(c, name);
} catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException var3) {
var3.printStackTrace();
}
return value;
}
}

View File

@@ -1,42 +0,0 @@
package com.mogo.map;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.map.uicontroller.AMapUIController;
import com.mogo.map.uicontroller.IMogoMapUIController;
/**
* @author congtaowang
* @since 2020/12/9
* <p>
* 描述
*/
public class CustomMapApiBuilder {
private static final String TAG = "CustomMapApiBuilder";
private static CustomMapApiBuilder sApiBuilder;
private static CustomMapApiBuilder getApiBuilder() {
if (sApiBuilder == null) {
synchronized (CustomMapApiBuilder.class) {
if (sApiBuilder == null) {
CallerLogger.INSTANCE.d(TAG, "init");
sApiBuilder = new CustomMapApiBuilder();
}
}
}
return sApiBuilder;
}
public IMogoMapUIController getMapUIController() {
return AMapUIController.getInstance();
}
public static IMogoMapUIController getMapUIControllerDelegate() {
return getApiBuilder().getMapUIController();
}
public static void destroy() {
}
}

View File

@@ -8,6 +8,7 @@ import com.mogo.eagle.core.data.map.CenterLine;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.map.uicontroller.AMapUIController;
import com.mogo.map.uicontroller.CarCursorOption;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.MapCameraPosition;
@@ -37,7 +38,7 @@ public class MogoMapUIController implements IMogoMapUIController {
private void initDelegate() {
if (mDelegate == null) {
mDelegate = CustomMapApiBuilder.getMapUIControllerDelegate();
mDelegate = AMapUIController.getInstance();
}
}

View File

@@ -755,7 +755,9 @@ public class ObuManager {
trackedObjectBuilder.setAltitude(vehBasics.getElevation());
trackedObjectBuilder.setSpeed(vehBasics.getSpeed());
trackedObjectBuilder.setHeading(vehBasics.getHeading());
trackedObjectBuilder.addTrackedSource(MessagePad.TrackedSource.newBuilder().setSource(2));
MessagePad.TrackedSource source = MessagePad.TrackedSource.newBuilder().setSource(2)
.addSubSource(MessagePad.SubSource.newBuilder().setSource(1).setId(vehBasics.getId())).build();
trackedObjectBuilder.addTrackedSource(source);
/**
* 0 未知车辆
* 1 特殊用途车辆

View File

@@ -1,7 +1,6 @@
package com.mogo.test.crashreport.apm;
import android.content.Context;
import android.util.Log;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.apm.insight.AttachUserData;
@@ -16,9 +15,8 @@ import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.data.bindingcar.CarInfo;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.AppUtils;
import com.mogo.eagle.core.utilcode.util.CommonUtils;
import com.mogo.eagle.core.utilcode.util.DeviceIdUtils;
import com.mogo.eagle.core.utilcode.util.DeviceUtils;
import com.mogo.eagle.core.utilcode.util.GsonUtils;
import com.mogo.test.crashreport.CrashReportConstants;
import com.mogo.test.crashreport.ITestCrashReportProvider;
@@ -92,7 +90,7 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
if (sn != null && !sn.isEmpty()) {
crash.config().setDeviceId(sn);
} else {
crash.config().setDeviceId(DeviceIdUtils.getDeviceId(context));
crash.config().setDeviceId(DeviceUtils.getDeviceSN());
}
crash.addTags(MAP_SDK_VERSION, mapSDKVersion);
crash.addTags("CITYCODE", mCityCode);
@@ -104,7 +102,7 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
HashMap<String, String> dimension = new HashMap<>();
//维度值
dimension.put("Devices_SN_DeviceId", sn + "__" + DeviceIdUtils.getDeviceId(context));
dimension.put("Devices_SN_DeviceId", sn + "__" + DeviceUtils.getDeviceSN());
// dimension.put("Devices_SN_WidevineID_MD5", sn + "__" + DeviceIdUtils.getWidevineIDWithMd5(context));
// dimension.put("Devices_SN_WidevineID", sn + "__" + DeviceIdUtils.getWidevineID(context));
dimension.put(MAP_SDK_VERSION, mapSDKVersion);