Merge branch 'dev_robotaxi-d-app-module_2110_220915_2.11.0' into 'test_robotaxi-d-app-module_2110_220915_2.11.0.1'

Dev robotaxi d app module 2110 220915 2.11.0

See merge request zhjt/AndroidApp/MoGoEagleEye!229
This commit is contained in:
wangmingjun
2022-09-29 11:21:38 +00:00
24 changed files with 244 additions and 118 deletions

View File

@@ -459,7 +459,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
IMogoMarker marker = MogoMarkerManager.getInstance(AbsMogoApplication.getApp()) .addMarker(uuid, options);
CenterLine centerLine = CallerHDMapManager.INSTANCE.getCenterLineInfo(
longi,lat,-1);
if (null != centerLine){ // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致
if (null != centerLine && marker != null) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空
marker.setRotateAngle(centerLine.getAngle().floatValue());
}
}

View File

@@ -326,15 +326,16 @@ public class BusOrderModel {
//是否到站的围栏判断 离站状态并且自动驾驶还未触发到站
if (isGoingToNextStation && !isArrivedStation){
judgeStartStation(location);
judgeArrivedStation(location);
}
}
};
//根据围栏判断,是否到达
private void judgeStartStation(Location location) {
//根据围栏判断,是否到达
private void judgeArrivedStation(Location location) {
if (backgroundCurrentStationIndex +1 > stationList.size() - 1 ){
CallerLogger.INSTANCE.e( M_BUS + TAG, "到站数组越界" );
return;
}
BusStationBean upcomingStation = stationList.get( backgroundCurrentStationIndex +1);
@@ -345,13 +346,8 @@ public class BusOrderModel {
startLon, startLat,
location.getLongitude(), location.getLatitude() );
CallerLogger.INSTANCE.d(M_BUS + TAG,"judgeStartStation() distance = " + distance);
if ( distance > BusConst.ARRIVE_AT_END_STATION_DISTANCE ) {
distance = CoordinateUtils.calculateLineDistance(startLon, startLat,
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(),
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat());
}
CallerLogger.INSTANCE.d(M_BUS + TAG,"judgeArrivedStation() distance = " + distance
+" to " + upcomingStation.getName());
if ( distance <= BusConst.ARRIVE_AT_END_STATION_DISTANCE ) {
onArriveAt(null); //无自动驾驶到站信息传null
@@ -493,9 +489,12 @@ public class BusOrderModel {
*/
private void startAutopilot(boolean isRestart) {
if (backgroundCurrentStationIndex +1 > stationList.size() - 1 || !isGoingToNextStation){
return;
}
triggerStartServiceEvent(isRestart, false);
isArrivedStation = false;
BusStationBean currentStation = stationList.get( backgroundCurrentStationIndex);
BusStationBean nextStation = stationList.get( backgroundCurrentStationIndex + 1);

View File

@@ -6,9 +6,10 @@ import androidx.fragment.app.DialogFragment
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
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.util.AppStateManager.currentActivity
import com.mogo.eagle.core.utilcode.util.ClickUtils
import com.mogo.och.common.module.biz.callback.ILoginCallback
import com.mogo.och.common.module.biz.callback.ILoginViewCallback
import com.mogo.och.common.module.biz.constant.LoginStatusManager
@@ -57,7 +58,7 @@ class LoginServiceImpl : LoginService,ILoginViewCallback {
if(uiModel) {
fragment?.let {
CallerHmiManager.hideToolsView()
val parentFragmentManager = it.parentFragmentManager
val parentFragmentManager = it.childFragmentManager
val fragmentByTag: Fragment? = parentFragmentManager.findFragmentByTag(TAG)
if (fragmentByTag is DialogFragment) {
if (fragmentByTag.dialog != null && fragmentByTag.dialog!!.isShowing) {
@@ -65,7 +66,7 @@ class LoginServiceImpl : LoginService,ILoginViewCallback {
}
if (fragmentByTag.dialog != null && fragmentByTag.isAdded) {
if (currentActivity() == null) { // 没有在当前应用内 在启动页面关闭应用
d(SceneConstant.M_TAXI + TAG, "showLoginDialogFragment 权限验证")
CallerLogger.d(SceneConstant.M_TAXI + TAG, "showLoginDialogFragment 权限验证")
return
}
}
@@ -83,18 +84,22 @@ class LoginServiceImpl : LoginService,ILoginViewCallback {
parentFragmentManager.beginTransaction().remove(taxiLoginDialog)
.commitAllowingStateLoss()
}
d(SceneConstant.M_TAXI + TAG, "showLoginDialogFragment 展示登录界面")
taxiLoginDialog.show(parentFragmentManager, TAG)
taxiLoginDialog.setOnDismissListener(DialogInterface.OnDismissListener { dialog: DialogInterface? ->
taxiLoginDialogFragment?.clear()
presenter?.queryLoginStatus()
})
if (ClickUtils.isFastClick()) {
taxiLoginDialog.show(parentFragmentManager, TAG)
taxiLoginDialog.setOnDismissListener(DialogInterface.OnDismissListener { dialog: DialogInterface? ->
taxiLoginDialogFragment?.clear()
presenter?.queryLoginStatus()
})
CallerLogger.d(SceneConstant.M_TAXI + TAG, "showLoginDialogFragment 展示登录界面")
}else{
CallerLogger.d(SceneConstant.M_TAXI + TAG, "showLoginDialogFragment 展示登录界面 1s内执行一次")
}
}
}
}
}
override fun hideLoginDialogFragment() {
d(SceneConstant.M_TAXI + TAG, "hideLoginDialogFragment 隐藏登录界面")
CallerLogger.d(SceneConstant.M_TAXI + TAG, "hideLoginDialogFragment 隐藏登录界面")
if (taxiLoginDialogFragment?.get() != null) {
taxiLoginDialogFragment?.get()?.dismissAllowingStateLoss()
}

View File

@@ -261,6 +261,9 @@ class TaxiLoginDialogFragment : MvpDialogFragment<TaxiLoginDialogFragment?, OchC
} catch (e: Exception) {
Log.e("DialogFragment", "show", e.fillInStackTrace())
}
if (isAdded) { //解决方法就是添加这行代码如果已经添加了就移除掉然后再show就不会出现Fragment already added的错误了。
return
}
val ft: FragmentTransaction = manager.beginTransaction()
ft.add(this, tag)
ft.commitAllowingStateLoss()

View File

@@ -3,6 +3,7 @@ package com.mogo.och.taxi.passenger.ui.leftmenu
import android.annotation.SuppressLint
import android.content.ContentResolver
import android.database.Cursor
import android.os.DeadObjectException
import android.os.IBinder
import android.os.RemoteCallbackList
import android.os.RemoteException
@@ -27,6 +28,7 @@ import com.mogo.och.taxi.passenger.ui.video.VideoActivity
import org.greenrobot.eventbus.EventBus
import rx.Observable
import rx.Observer
import rx.exceptions.OnCompletedFailedException
import rx.schedulers.Schedulers
import java.util.*
@@ -43,8 +45,6 @@ object LeftMenuOpen {
private var open: ((view: View, windowManager: WindowManager?) -> Unit)? = null
private var cu: Cursor? = null
// 两部分主进程和子进程
private var dragList = mutableSetOf<View>()
@@ -85,11 +85,8 @@ object LeftMenuOpen {
this.windowManager = null
this.wl = null
cu?.let {
it.close()
cu = null
orderService = null
}
orderService = null
val iterator = dragList.iterator()
while (iterator.hasNext()) {
val next = iterator.next()
@@ -208,11 +205,19 @@ object LeftMenuOpen {
Observable.empty<String?>().subscribeOn(Schedulers.io())
.subscribe(object : Observer<String?> {
override fun onCompleted() {
CallerLogger.d(M_TAXI_P + TAG, "tran--transmissionIndex---$index")
if (orderService == null) {
registerC()
try {
CallerLogger.d(M_TAXI_P + TAG, "tran--transmissionIndex---$index")
if (orderService == null) {
registerC()
}
orderService?.transmissionIndex(index)
}catch (ill:IllegalStateException){
ill.printStackTrace()
}catch (onCo: OnCompletedFailedException){
onCo.printStackTrace()
}catch (deadobjectexception: DeadObjectException){
deadobjectexception.printStackTrace()
}
orderService?.transmissionIndex(index)
}
override fun onError(e: Throwable?) {}
override fun onNext(t: String?) {}
@@ -250,13 +255,22 @@ object LeftMenuOpen {
Observable.empty<String?>().subscribeOn(Schedulers.io())
.subscribe(object : Observer<String?> {
override fun onCompleted() {
CallerLogger.d(M_TAXI_P + TAG, "tran--registerCallback--注册")
if (orderService == null) {
registerC()
}
cb?.let {
orderService?.registerCallback(it)
}
try {
CallerLogger.d(M_TAXI_P + TAG, "tran--registerCallback--注册")
if (orderService == null) {
registerC()
}
cb?.let {
orderService?.registerCallback(it)
}
}catch (ill:IllegalStateException){
ill.printStackTrace()
}catch (onCo: OnCompletedFailedException){
onCo.printStackTrace()
}catch (deadobjectexception: DeadObjectException){
deadobjectexception.printStackTrace()
}
}
override fun onError(e: Throwable?) {}
override fun onNext(t: String?) {}
@@ -272,7 +286,15 @@ object LeftMenuOpen {
override fun onCompleted() {
CallerLogger.d(M_TAXI_P + TAG, "tran--unregisterCallback--反注册")
cb?.let {
orderService?.unRegisterCallback(it)
try {
orderService?.unRegisterCallback(it)
}catch (ill:IllegalStateException){
ill.printStackTrace()
}catch (onCo: OnCompletedFailedException){
onCo.printStackTrace()
}catch (deadobjectexception: DeadObjectException){
deadobjectexception.printStackTrace()
}
}
}
override fun onError(e: Throwable?) {}
@@ -350,7 +372,7 @@ object LeftMenuOpen {
CallerLogger.d(M_TAXI_P + TAG, "tran--registerC--获取jni")
val resolver: ContentResolver = Utils.getApp().contentResolver
cu = resolver.query(
val cu = resolver.query(
BinderProvider.CONTENT_URI,
null,
null,
@@ -358,13 +380,22 @@ object LeftMenuOpen {
null
) ?: return
val binder: IBinder = getBinder(cu!!)
val binder: IBinder = getBinder(cu)
try {
orderService = ILeftMenuService.Stub.asInterface(binder)
try {
orderService = ILeftMenuService.Stub.asInterface(binder)
}catch (ill:IllegalStateException){
ill.printStackTrace()
}catch (onCo: OnCompletedFailedException){
onCo.printStackTrace()
}catch (deadobjectexception: DeadObjectException){
deadobjectexception.printStackTrace()
}
} catch (e: RemoteException) {
e.printStackTrace()
cu?.close()
cu = null
} finally {
cu.close()
}
}

View File

@@ -909,17 +909,17 @@ public class TaxiModel {
startLon, startLat,
location.getLongitude(), location.getLatitude());
if (DebugConfig.isDebug() && mCurrentOCHOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToStart.getCode()) {
// ToastUtils.showShort("距离上车点:" + Double.valueOf(distance).intValue());
}
// if (DebugConfig.isDebug() && mCurrentOCHOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToStart.getCode()) {
// // ToastUtils.showShort("距离上车点:" + Double.valueOf(distance).intValue());
// }
CallerLogger.INSTANCE.i(M_TAXI + TAG, "judgeStartStation() distance = " + distance);
if (distance > TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) {
distance = CoordinateUtils.calculateLineDistance(startLon, startLat,
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(),
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat());
}
// if (distance > TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) {
// distance = CoordinateUtils.calculateLineDistance(startLon, startLat,
// CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(),
// CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat());
// }
if (distance <= TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) {
arrivedStartPoint();
@@ -1007,11 +1007,11 @@ public class TaxiModel {
CallerLogger.INSTANCE.i(M_TAXI + TAG, "judgeEndStation() distance = " + distance);
if (distance > TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) {
distance = CoordinateUtils.calculateLineDistance(startLon, startLat,
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(),
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat());
}
// if (distance > TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) {
// distance = CoordinateUtils.calculateLineDistance(startLon, startLat,
// CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(),
// CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat());
// }
if (distance <= TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) {
if (!checkCurrentOCHOrder()

View File

@@ -283,7 +283,9 @@ public class TaxiPersonalDialogFragment extends DialogFragment implements View.O
}
serverHadNoData = false;
orders.addAll(ordersList);
mAdapter.notifyDataSetChanged();
if(mAdapter!=null) {
mAdapter.notifyDataSetChanged();
}
mNextPage = mNextPage +1;
}

View File

@@ -45,6 +45,7 @@ import com.zhidao.support.adas.high.AdasManager;
import com.zhidao.support.adas.high.AdasOptions;
import com.zhidao.support.adas.high.OnAdasConnectStatusListener;
import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.bean.AutopilotAbility;
import com.zhidao.support.adas.high.bean.VersionCompatibility;
import com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS;
import com.zhidao.support.adas.high.common.CupidLogUtils;
@@ -804,4 +805,9 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
break;
}
}
@Override
public void onAutopilotAbility(AutopilotAbility ability) {
}
}

View File

@@ -81,7 +81,7 @@ public class UpgradeAppNetWorkManager {
CallerLogger.INSTANCE.d(TAG, "UpgradeAppInfo url = " + info.result.getAppUrl() + "----code = " + info.result.getVersionCode());
Log.d(TAG, "UpgradeAppInfo url = " + info.result.getAppUrl() + "----code = " + info.result.getVersionCode() + "--versionCode =" + versionCode + "--info.result = " + info.result);
if (info.result.getVersionCode() > versionCode) {
CallerHmiManager.INSTANCE.showUpgradeDialog(info.result.getAppUrl().substring(info.result.getAppUrl().lastIndexOf("/")+1), info.result.getAppUrl(), info.result.getInstallTitle(), info.result.getInstallContent());
CallerHmiManager.INSTANCE.showUpgradeDialog(info.result.getAppUrl().substring(info.result.getAppUrl().lastIndexOf("/")+1), info.result.getAppUrl(), info.result.getInstallTitle(), info.result.getInstallContent(), info.result.getInstallType());
}
} else {
Log.e(TAG, "onNext info == null");

View File

@@ -1304,11 +1304,12 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
/**
* 升级app弹框
*/
override fun showUpgradeDialog(name: String, url: String, title: String, content: String) {
override fun showUpgradeDialog(name: String, url: String, title: String, content: String, installType: String) {
if (upgradeAppDialog == null) {
upgradeAppDialog = UpgradeAppDialog(requireContext())
}
upgradeAppDialog!!.showUpgradeAppDialog(name, url, title, content)
upgradeAppDialog!!.setCanceledOnTouchOutside(false)
upgradeAppDialog!!.showUpgradeAppDialog(name, url, title, content, installType)
}
/**

View File

@@ -1,7 +1,9 @@
package com.mogo.eagle.core.function.hmi.ui.bindingcar
import android.content.Context
import android.opengl.Visibility
import android.util.Log
import android.view.View
import android.widget.TextView
import androidx.lifecycle.LifecycleObserver
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
@@ -23,6 +25,8 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
private var cancleTv: TextView? = null
private var upgradeTitleTv: TextView? = null
private var upgradeContentTv: TextView? = null
private var verticalLineView: View? = null
private var confirmForceTv: TextView? = null
private var tag: String? = null
private var downloarUrl: String? = null
@@ -34,6 +38,8 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
upgradeContentTv = findViewById(R.id.tv_upgrade_content)
confirmTv = findViewById(R.id.tv_upgrade_confirm)
cancleTv = findViewById(R.id.tv_upgrade_cancel)
verticalLineView = findViewById(R.id.view_vertical_line)
confirmForceTv = findViewById(R.id.tv_upgrade_confirm_force)
confirmTv?.setOnClickListener {
downloadApp()
@@ -42,6 +48,11 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
cancleTv?.setOnClickListener {
dismiss()
}
confirmForceTv?.setOnClickListener {
downloadApp()
}
}
/**
@@ -58,16 +69,31 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
super.dismiss()
}
fun showUpgradeAppDialog(name: String, url: String, title: String, content: String) {
// 升级类型 1:提示升级 2:静默升级 3:强制升级
fun showUpgradeAppDialog(name: String, url: String, title: String, content: String, installType: String) {
if (isShowing) {
return
}
tag = name
downloarUrl = url
upgradeTitleTv?.text = title
upgradeContentTv?.text = content
if (installType.equals("1")) {
confirmForceTv?.visibility = View.GONE
confirmTv?.visibility = View.VISIBLE
cancleTv?.visibility = View.VISIBLE
verticalLineView?.visibility = View.VISIBLE
} else if (installType.equals("3")) {
confirmTv?.visibility = View.GONE
cancleTv?.visibility = View.GONE
verticalLineView?.visibility = View.GONE
confirmForceTv?.visibility = View.VISIBLE
} else if (installType.equals("2")) {
//静默安装
}
show()
}

View File

@@ -304,7 +304,12 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
.setLoopInterval(50000)
.setMonitorThreshold(16)
.setNativeHeapAllocatedThreshold(0)
.setIgnoredSoList(new String[]{"libart", "libc"})
.setSelectedSoList(new String[]{"libhdmap", "libmap",
"libAMapSDK_NAVI_v8_0_1", "librouting", "libZegoExpressEngine",
"libUtils", "libcommon", "libcntts", "libduiutils",
"libdatamgr", "libdatascript", "libguidance", "libndsprovider",
"libndssqlite", "libpbjni", "libsearch"
})
.setEnableLocalSymbolic(BuildConfig.DEBUG)
.setLeakListener(leaks -> {
StringBuilder stringBuilder = new StringBuilder();

View File

@@ -76,17 +76,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
}
private void queryAppUpgrade() {
// UiThreadHandler.postDelayed(new Runnable() {
// @Override
// public void run() {
// CallerLogger.INSTANCE.d("Upgrade","queryAppUpgrade isConnectAutopilot = " + AppConfigInfo.INSTANCE.isConnectAutopilot());
// Log.e("Upgrade", "queryAppUpgrade isConnectAutopilot = " + AppConfigInfo.INSTANCE.isConnectAutopilot());
// if (AppConfigInfo.INSTANCE.isConnectAutopilot()) {
// MoGoHandAdasMsgManager.getInstance(getBaseContext()).getConfig();
// }
// }
// },9000);
UiThreadHandler.postDelayed(new Runnable() {
@Override
public void run() {

View File

@@ -93,5 +93,18 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/view_horizontal_line" />
<TextView
android:id="@+id/tv_upgrade_confirm_force"
android:layout_width="match_parent"
android:layout_height="100px"
android:gravity="center"
android:text="@string/confirm"
android:textColor="#FFFFFFFF"
android:textSize="46px"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/view_vertical_line"
app:layout_constraintTop_toBottomOf="@id/view_horizontal_line" />
</com.mogo.eagle.core.widget.RoundConstraintLayout>

View File

@@ -22,6 +22,7 @@ import com.mogo.eagle.core.function.overview.InfStructureManager;
import com.mogo.eagle.core.function.overview.ViewModelExtKt;
import com.mogo.eagle.core.function.overview.vm.OverViewModel;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.IMogoMap;
import com.mogo.map.IMogoUiSettings;
import com.mogo.map.MogoMapView;
@@ -213,7 +214,9 @@ public class MapFragment extends MvpFragment<MapView, MapPresenter>
@Override
public void onAutopilotRotting(@Nullable MessagePad.GlobalPathResp globalPathResp) {
InfStructureManager.INSTANCE.savePlanningData(globalPathResp.getWayPointsList());
UiThreadHandler.post(() -> {
InfStructureManager.INSTANCE.savePlanningData(globalPathResp.getWayPointsList());
});
}
@Override

View File

@@ -322,13 +322,14 @@ public class AMapCustomView
* @param locationList
*/
private void drawInfrastructureMarkers(List<MessagePad.Location> locationList) {
if (locationList == null) return;
if (!pathMap.isEmpty()) {
pathMap.clear();
}
String geoHash;
ArrayList<Infrastructure> infList;
for (MessagePad.Location location : locationList) {
LatLng latLng = MarkerDrawerManager.INSTANCE.coordinateConverterWgsToGcj(mContext, location);
for (int i = 0; i < locationList.size(); i++) {
LatLng latLng = MarkerDrawerManager.INSTANCE.coordinateConverterWgsToGcj(mContext, locationList.get(i));
geoHash = GeoHash.withCharacterPrecision(latLng.latitude, latLng.longitude, 7).toBase32();
// 网格内的轨迹点只取一次s
if (!pathMap.containsKey(geoHash)) {

View File

@@ -14,7 +14,7 @@ public class AppInfo implements Serializable {
private String screenType;
private String installTitle;
private String installContent;
private String installType;
private String installType; // 升级类型 1:提示升级 2:静默升级 3:强制升级
private String beginTime;
private String endTime;

View File

@@ -28,7 +28,7 @@ enum class TrafficTypeEnum(
"",
R.raw.traffic_people,
R.raw.xingren,
R.raw.xingren
R.raw.xingren_night
),
TYPE_TRAFFIC_ID_BICYCLE(
2,

View File

@@ -222,7 +222,7 @@ interface IMoGoWaringProvider : IMoGoHmiViewProxy {
/**
* 展示升级app弹框
*/
fun showUpgradeDialog(name: String, url: String, title: String, content: String)
fun showUpgradeDialog(name: String, url: String, title: String, content: String, installType: String)
/**
* 呈现工控机升级确认框

View File

@@ -292,8 +292,8 @@ object CallerHmiManager : CallerBase() {
waringProviderApi?.showModifyBindingcarDialog()
}
fun showUpgradeDialog(name: String, url: String, title: String, content: String) {
waringProviderApi?.showUpgradeDialog(name, url, title, content)
fun showUpgradeDialog(name: String, url: String, title: String, content: String, installType: String) {
waringProviderApi?.showUpgradeDialog(name, url, title, content, installType)
}
/**

Binary file not shown.

View File

@@ -13,7 +13,6 @@ import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_LINK_LOG_CONNEC
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -44,7 +43,9 @@ import com.zhidao.support.adas.high.thread.DispatchHandler;
import com.zhjt.service.chain.ChainLog;
import com.zhjt.service.chain.TracingConstants;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.Timer;
import java.util.TimerTask;
@@ -67,13 +68,11 @@ import okio.ByteString;
*/
public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnectListener, IPCFixationIPHelper.IIPCFixationIPListener, DispatchHandler.OnDispatchHandlerListener, SubscribeInterface.OnSubscribeInterfaceListener {
private static final String TAG = AdasChannel.class.getSimpleName();
private static final String THREAD_NAME_DISPATCH_EVENT = "IPCEventDispatchHandler";//除点云单独拆分线程以外都是用此名称
private static final String THREAD_NAME_DISPATCH_POINT_CLOUD = "IPCPointCloudDispatchHandler";
private FpgaSocket mSocket;
private RawUnpack rawUnpack;//业务数据拆包
private RawPack rawPack;//数据打包
private DispatchHandler dispatchHandler;//分发
private DispatchHandler dispatchHandlerPointCloud;//原始的点云数据分发
private DispatchHandler defaultDispatchHandler;//默认分发线程分发
private final Map<MessagePad.MessageType, DispatchHandler> dispatchHandlers = new HashMap<>();//其他分发线程
private Timer checkCompatibilityTimer;//检查版本兼容性定时器 连接成功后5秒内等待工控机发送配置信息
/**
* 与工控机链接状态
@@ -166,8 +165,53 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
//消息工厂
myMessageFactory = new MyMessageFactory();
//启用线程分发
dispatchHandler = new DispatchHandler(THREAD_NAME_DISPATCH_EVENT, this);
dispatchHandlerPointCloud = new DispatchHandler(THREAD_NAME_DISPATCH_POINT_CLOUD, this);
defaultDispatchHandler = new DispatchHandler(MessagePad.MessageType.MsgTypeDefault, this);//默认分发线程 不要添加到Map中
initOtherDispatchHandler();
}
/**
* 初始化其他分发线程
*/
private void initOtherDispatchHandler() {
//点云透传
dispatchHandlers.put(MessagePad.MessageType.MsgTypePointCloud, new DispatchHandler(MessagePad.MessageType.MsgTypePointCloud, this));
//车前引导线
// dispatchHandlers.put(MessagePad.MessageType.MsgTypeTrajectory, new DispatchHandler(MessagePad.MessageType.MsgTypeTrajectory, this));
//障碍物信息
dispatchHandlers.put(MessagePad.MessageType.MsgTypeTrackedObjects, new DispatchHandler(MessagePad.MessageType.MsgTypeTrackedObjects, this));
//惯导信息
// dispatchHandlers.put(MessagePad.MessageType.MsgTypeGnssInfo, new DispatchHandler(MessagePad.MessageType.MsgTypeGnssInfo, this));
//底盘信息
// dispatchHandlers.put(MessagePad.MessageType.MsgTypeVehicleState, new DispatchHandler(MessagePad.MessageType.MsgTypeVehicleState, this));
//自动驾驶状态
// dispatchHandlers.put(MessagePad.MessageType.MsgTypeAutopilotState, new DispatchHandler(MessagePad.MessageType.MsgTypeAutopilotState, this));
//监控事件报告
// dispatchHandlers.put(MessagePad.MessageType.MsgTypeReportMessage, new DispatchHandler(MessagePad.MessageType.MsgTypeReportMessage, this));
//感知红绿灯
// dispatchHandlers.put(MessagePad.MessageType.MsgTypePerceptionTrafficLight, new DispatchHandler(MessagePad.MessageType.MsgTypePerceptionTrafficLight, this));
//他车轨迹预测
// dispatchHandlers.put(MessagePad.MessageType.MsgTypePredictionObstacleTrajectory, new DispatchHandler(MessagePad.MessageType.MsgTypePredictionObstacleTrajectory, this));
//Planning障碍物
// dispatchHandlers.put(MessagePad.MessageType.MsgTypePlanningObjects, new DispatchHandler(MessagePad.MessageType.MsgTypePlanningObjects, this));
//自动驾驶设备基础信息请求
// dispatchHandlers.put(MessagePad.MessageType.MsgTypeBasicInfoReq, new DispatchHandler(MessagePad.MessageType.MsgTypeBasicInfoReq, this));
//车机基础信息应答
// dispatchHandlers.put(MessagePad.MessageType.MsgTypeCarConfigResp, new DispatchHandler(MessagePad.MessageType.MsgTypeCarConfigResp, this));
//数据采集结果
// dispatchHandlers.put(MessagePad.MessageType.MsgTypeRecordResult, new DispatchHandler(MessagePad.MessageType.MsgTypeRecordResult, this));
//自动驾驶路径应答
// dispatchHandlers.put(MessagePad.MessageType.MsgTypeGlobalPathResp, new DispatchHandler(MessagePad.MessageType.MsgTypeGlobalPathResp, this));
//预警数据
// dispatchHandlers.put(MessagePad.MessageType.MsgTypeWarn, new DispatchHandler(MessagePad.MessageType.MsgTypeWarn, this));
//到站提醒
// dispatchHandlers.put(MessagePad.MessageType.MsgTypeArrivalNotification, new DispatchHandler(MessagePad.MessageType.MsgTypeArrivalNotification, this));
//状态查询应答
// dispatchHandlers.put(MessagePad.MessageType.MsgTypeStatusQueryResp, new DispatchHandler(MessagePad.MessageType.MsgTypeStatusQueryResp, this));
//数据采集配置
// dispatchHandlers.put(MessagePad.MessageType.MsgTypeRecordDataConfigResp, new DispatchHandler(MessagePad.MessageType.MsgTypeRecordDataConfigResp, this));
//Planning决策状态
// dispatchHandlers.put(MessagePad.MessageType.MsgTypePlanningDecisionState, new DispatchHandler(MessagePad.MessageType.MsgTypePlanningDecisionState, this));
}
/**
@@ -292,14 +336,12 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
if (!adasOptions.isClient())
ReceiveTimeoutManager.getInstance().refreshLast(header.getTimestamp());
// CupidLogUtils.w("--->websocket byte read header = " + messageType.toString());
//判断是否是司机屏幕,是否切换分发线程
if (header.getMsgType() == MessageType.TYPE_RECEIVE_POINT_CLOUD.typeCode) {
if (dispatchHandlerPointCloud != null) {
dispatchHandlerPointCloud.sendRawMessage(raw);
}
DispatchHandler handler = dispatchHandlers.get(header.getMsgType());
if (handler != null) {
handler.sendRawMessage(raw);
} else {
if (dispatchHandler != null)
dispatchHandler.sendRawMessage(raw);
if (defaultDispatchHandler != null)
defaultDispatchHandler.sendRawMessage(raw);
}
} else {
callError(raw.getProtocolStatus(), byteString.toByteArray());
@@ -317,15 +359,15 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
* @param raw
*/
@Override
public void onDispatchRaw(String threadName, RawData raw) {
public void onDispatchRaw(MessagePad.MessageType type, RawData raw) {
// CupidLogUtils.i(TAG, "onDispatchRaw=" + Thread.currentThread().getName() + " TID=" + android.os.Process.myTid());
try {
//分发点云原始数据
if (THREAD_NAME_DISPATCH_POINT_CLOUD.equals(threadName)) {
if (type == MessagePad.MessageType.MsgTypePointCloud) {
int len = raw.getPackageLengthValue() - raw.getOffsetValue();
byte[] bytes = new byte[len];
System.arraycopy(raw.originalData.toByteArray(), raw.getOffsetValue(), bytes, 0, len);
mAdasListener.onPointCloud(bytes);
CupidLogUtils.i(TAG, "收到点云数据" + raw.getPackageLengthValue());
} else {
if (rawUnpack != null) {
if (raw.getProtocolStatus() == ProtocolStatus.SUCCEED) {
@@ -527,11 +569,14 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
@Override
public void stopDispatchHandler() {
if (dispatchHandler != null) {
dispatchHandler.stop();
if (defaultDispatchHandler != null) {
defaultDispatchHandler.stop();
}
if (dispatchHandlerPointCloud != null) {
dispatchHandlerPointCloud.stop();
for (Map.Entry<MessagePad.MessageType, DispatchHandler> entry : dispatchHandlers.entrySet()) {
DispatchHandler dispatchHandler = entry.getValue();
if (dispatchHandler != null) {
dispatchHandler.stop();
}
}
}

View File

@@ -18,7 +18,7 @@ public class CupidLogUtils {
* @param isEnableLog true开启 false关闭
*/
public static void setEnableLog(boolean isEnableLog) {
// mIsEnableLog = isEnableLog; TODO 临时注释
mIsEnableLog = isEnableLog;
}
public static boolean isEnableLog() {

View File

@@ -11,24 +11,25 @@ import com.zhidao.support.adas.high.protocol.RawData;
import java.lang.ref.WeakReference;
import mogo.telematics.pad.MessagePad;
/**
* 将WebSocket线程分发到工作线程
*/
public class DispatchHandler {
public static final int WHAT_DISPATCH_RAW = 0x01;//分发消息 what
private final String name;
private final MessagePad.MessageType messageType;
private final OnDispatchHandlerListener listener;
private HandlerThread mThread;
private BaseHandler mBaseHandler;
public interface OnDispatchHandlerListener {
void onDispatchRaw(String threadName, RawData raw);
void onDispatchRaw(MessagePad.MessageType name, RawData raw);
}
public DispatchHandler(String name, @NonNull OnDispatchHandlerListener listener) {
public DispatchHandler(MessagePad.MessageType messageType, @NonNull OnDispatchHandlerListener listener) {
this.listener = listener;
this.name = name;
this.messageType = messageType;
}
public void stop() {
@@ -44,12 +45,12 @@ public class DispatchHandler {
public void sendRawMessage(RawData raw) {
if (mThread == null) {
String name = "Dispatch-" + messageType.name().replace("MsgType", "");
mThread = new HandlerThread(name);
mThread.start();
initHandler(mThread.getLooper());
}
Message msg = Message.obtain();
msg.what = WHAT_DISPATCH_RAW;
msg.obj = raw;
mBaseHandler.sendMessage(msg);
}
@@ -63,11 +64,7 @@ public class DispatchHandler {
* @param msg
*/
protected void handleMessage(Message msg) {
if (msg.what == WHAT_DISPATCH_RAW) {
if (listener != null) {
listener.onDispatchRaw(name, (RawData) msg.obj);
}
}
listener.onDispatchRaw(messageType, (RawData) msg.obj);
}
/**