Merge branch 'dev_robobus-d_241202_6.8.4' into dev_robobus-d_241202_6.8.4_autopilot

This commit is contained in:
xyz
2025-01-06 14:57:23 +08:00
5 changed files with 116 additions and 85 deletions

View File

@@ -63,65 +63,69 @@ public class MogoApplication extends MainMoGoApplication {
//设置debug模式日志不上传
crashSystem.setDebug(BuildConfig.DEBUG);
if (BuildConfig.DEBUG){
// debug测试用的key
COUNTLY_APP_KEY = "d8cfb7be4679f650a6dc806d289a0d8c1996ed05";
try {
if (BuildConfig.DEBUG) {
// debug测试用的key
COUNTLY_APP_KEY = "d8cfb7be4679f650a6dc806d289a0d8c1996ed05";
}
// 初始化自建APM统计 Countly
CountlyConfig countlyConfig =
// 创建配置对象
new CountlyConfig(
this,
COUNTLY_APP_KEY,
COUNTLY_SERVER_URL
);
// 优先获取设备在 蘑菇平台注册的SN
String devicesID = SharedPrefsMgr.getInstance().getSn();
// 如果拿不到 蘑菇SN则使用设备自己的序列号
if (TextUtils.isEmpty(devicesID)) {
devicesID = DeviceUtils.getDeviceSN();
}
// 设置设备唯一标志
countlyConfig.setDeviceId(devicesID)
// 获取您在 Countly 服务器中设置的一些配置
.enableServerConfiguration()
// 自动视图跟踪
.enableAutomaticViewTracking()
.enableAutomaticViewShortNames()
.enableTemporaryDeviceIdMode()
// 参数篡改保护salt
.setParameterTamperingProtectionSalt("mogo_auto")
// 如果发送到服务器的数据足够短SDK 将使用 HTTP GET 请求。要覆盖该行为,
// 以便在所有情况下都使用 HTTP POST 请求,您需要在 init 配置中将“setHttpPostForced”标志设置为 true。
.setHttpPostForced(true)
// 启用日志记录:
.setLoggingEnabled(true);
// 限制每个线程记录的堆栈跟踪行默认值30 行)
countlyConfig.sdkInternalLimits.setMaxStackTraceLinesPerThread(100);
// 限制每个堆栈跟踪行允许的字符默认200 个字符)
countlyConfig.sdkInternalLimits.setMaxStackTraceLineLength(1000);
// 限制所有用户设置的字符串分段或其等效值值的大小默认值256 个字符)
countlyConfig.sdkInternalLimits.setMaxValueSize(256);
// 限制用户设置的分段键值对的数量默认100 个条目)
countlyConfig.sdkInternalLimits.setMaxSegmentationValues(100);
// 限制可以记录的用户设置痕迹导航的数量默认值100 个条目,超过此值将删除最早的条目)
countlyConfig.sdkInternalLimits.setMaxBreadcrumbCount(100);
// 自动崩溃处理
countlyConfig.crashes.enableCrashReporting();
// 记录所有线程
countlyConfig.crashes.enableRecordAllThreadsWithCrash();
// 初始化Countly SDK配置
Countly.sharedInstance().init(countlyConfig);
// java崩溃报告
Countly.sharedInstance().crashes();
// C++ 崩溃报告
CountlyNative.initNative(this);
} catch (Exception e) {
e.printStackTrace();
}
// 初始化自建APM统计 Countly
CountlyConfig countlyConfig =
// 创建配置对象
new CountlyConfig(
this,
COUNTLY_APP_KEY,
COUNTLY_SERVER_URL
);
// 优先获取设备在 蘑菇平台注册的SN
String devicesID = SharedPrefsMgr.getInstance().getSn();
// 如果拿不到 蘑菇SN则使用设备自己的序列号
if (TextUtils.isEmpty(devicesID)) {
devicesID = DeviceUtils.getDeviceSN();
}
// 设置设备唯一标志
countlyConfig.setDeviceId(devicesID)
// 获取您在 Countly 服务器中设置的一些配置
.enableServerConfiguration()
// 自动视图跟踪
.enableAutomaticViewTracking()
.enableAutomaticViewShortNames()
.enableTemporaryDeviceIdMode()
// 参数篡改保护salt
.setParameterTamperingProtectionSalt("mogo_auto")
// 如果发送到服务器的数据足够短SDK 将使用 HTTP GET 请求。要覆盖该行为,
// 以便在所有情况下都使用 HTTP POST 请求,您需要在 init 配置中将“setHttpPostForced”标志设置为 true。
.setHttpPostForced(true)
// 启用日志记录:
.setLoggingEnabled(true);
// 限制每个线程记录的堆栈跟踪行默认值30 行)
countlyConfig.sdkInternalLimits.setMaxStackTraceLinesPerThread(10000);
// 限制每个堆栈跟踪行允许的字符默认200 个字符)
countlyConfig.sdkInternalLimits.setMaxStackTraceLineLength(10000);
// 限制所有用户设置的字符串分段或其等效值值的大小默认值256 个字符)
countlyConfig.sdkInternalLimits.setMaxValueSize(10000);
// 限制用户设置的分段键值对的数量默认100 个条目)
countlyConfig.sdkInternalLimits.setMaxSegmentationValues(1000);
// 限制可以记录的用户设置痕迹导航的数量默认值100 个条目,超过此值将删除最早的条目)
countlyConfig.sdkInternalLimits.setMaxBreadcrumbCount(1000);
// 自动崩溃处理
countlyConfig.crashes.enableCrashReporting();
// 记录所有线程
countlyConfig.crashes.enableRecordAllThreadsWithCrash();
// 初始化Countly SDK配置
Countly.sharedInstance().init(countlyConfig);
// java崩溃报告
Countly.sharedInstance().crashes();
// C++ 崩溃报告
CountlyNative.initNative(this);
}
@Override

View File

@@ -16,6 +16,8 @@ import com.mogo.eagle.core.function.api.driver.video.IDriveSeatVideoProvider.Eve
import com.mogo.eagle.core.function.api.driver.video.IDriveSeatVideoProvider.Event.Playing
import com.mogo.eagle.core.function.call.datacenter.CallerDataCenterBizListener
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.eagle.core.network.apiCall
import com.mogo.eagle.core.network.request
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.AppStateManager
import com.tencent.liteav.basic.log.TXCLog
@@ -48,9 +50,11 @@ class DriveSeatVideoProviderImpl : IDriveSeatVideoProvider {
private const val TAG = "DriveSeatVideoProvider"
}
@Volatile private var target: WeakReference<TXCloudVideoView>? = null
@Volatile
private var target: WeakReference<TXCloudVideoView>? = null
@Volatile private var timer: Job? = null
@Volatile
private var timer: Job? = null
private val scope by lazy { CoroutineScope(Dispatchers.IO + SupervisorJob()) }
@@ -63,22 +67,40 @@ class DriveSeatVideoProviderImpl : IDriveSeatVideoProvider {
internal interface IVideoLiveUrlApi {
@Headers("Content-Type:application/json;charset=UTF-8")
@GET("/eagleEye-mis/camera/monitor/watch/status")
suspend fun requestVideoLiveUrl(@Query(value = "numberPlate") numberPlate: String, @Query("cameraType") cameraType: Int, @Query("protocolType") protocolType: Int): BaseResponse<VideoUrlData>
suspend fun requestVideoLiveUrl(
@Query(value = "numberPlate") numberPlate: String,
@Query("cameraType") cameraType: Int,
@Query("protocolType") protocolType: Int
): BaseResponse<VideoUrlData>
}
override suspend fun requestVideoInfo(): VideoUrlData? {
override fun requestVideoInfo(onSuccess: (VideoUrlData) -> Unit, onError: (String) -> Unit) {
val plateNumber = CallerDataCenterBizListener.getPlateNumber()
// val plateNumber = "京A40188D"
Log.d(TAG, "requestVideoInfo -> $plateNumber")
if (plateNumber == null || TextUtils.isEmpty(plateNumber)) {
Log.e(TAG, "-- isVideoLiveUsable -- plate number is empty.")
return null
onError.invoke("plate number is empty.")
}
request<BaseResponse<VideoUrlData>> {
loader {
apiCall {
getApi().requestVideoLiveUrl(plateNumber!!, 2, 2)
}
}
onSuccess {
data = it.result
Log.e(
TAG,
"-- isVideoLiveUsable -- receive 请求成功: { msg: ${it.msg}, result: ${it.result}}"
)
onSuccess.invoke(it.result)
}
onError {
Log.e(TAG, "-- isVideoLiveUsable -- receive 请求失败: { msg: ${it.message}")
onError.invoke("请求失败 , ${it.message}")
}
}
val resp = getApi()?.requestVideoLiveUrl(plateNumber, 2, 2) ?: return null
Log.e(TAG, "-- isVideoLiveUsable -- receive response: {code: ${resp.code}, msg: ${resp.msg}, result: ${resp.result}}")
data = resp.result
return resp.result
}
override fun getDriveVideoView(playUrl: String, playCallback: ((Event) -> Unit)?): View? {
@@ -148,7 +170,8 @@ class DriveSeatVideoProviderImpl : IDriveSeatVideoProvider {
}
@OptIn(ExperimentalCoroutinesApi::class) override fun poller(): Flow<Boolean> = channelFlow {
@OptIn(ExperimentalCoroutinesApi::class)
override fun poller(): Flow<Boolean> = channelFlow {
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
throw AssertionError("此方法不支持司机屏使用")
}
@@ -174,13 +197,12 @@ class DriveSeatVideoProviderImpl : IDriveSeatVideoProvider {
Log.d(TAG, "开启定时轮询请求...")
while (true) {
Log.d(TAG, "当次请求开始...")
val result = requestVideoInfo()
if (result != null) {
data = result
requestVideoInfo({
data = it
chl.get()?.trySend(true)
} else {
},{
chl.get()?.trySend(false)
}
})
Log.d(TAG, "当次请求结束...")
delay(5000)
}
@@ -200,7 +222,8 @@ class DriveSeatVideoProviderImpl : IDriveSeatVideoProvider {
return isPlaying.get()
}
private fun getApi(): IVideoLiveUrlApi? {
return MoGoRetrofitFactory.getInstanceNoCallAdapter(HostConst.HOST_RELEASE).create(IVideoLiveUrlApi::class.java)
private fun getApi(): IVideoLiveUrlApi {
return MoGoRetrofitFactory.getInstanceNoCallAdapter(HostConst.HOST_RELEASE)
.create(IVideoLiveUrlApi::class.java)
}
}

View File

@@ -699,7 +699,11 @@ class OperatePanelLayout : LinearLayout {
CallerTelematicListenerManager.addListener(TAG, this)
lifecycleScope.launchWhenResumed {
val p = preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(KEY_DRIVE_SEAT_VIDEO_STREAM)?.also {
it.isEnabled = CallerDevaToolsManager.driveSeatVideoProvider()?.requestVideoInfo()?.livePlayUrl?.isNotEmpty() ?: false
CallerDevaToolsManager.driveSeatVideoProvider()?.requestVideoInfo({ data ->
it.isEnabled = !data.livePlayUrl.isNullOrEmpty()
},{ _ ->
it.isEnabled = false
})
}
if (FunctionBuildConfig.isDriveSeatVideoStream && p?.isEnabled == true) {

View File

@@ -10,7 +10,7 @@ interface IDriveSeatVideoProvider {
* 视频直播是否可用
* @return true: 可用; false: 不可用
*/
suspend fun requestVideoInfo(): VideoUrlData?
fun requestVideoInfo(onSuccess: (VideoUrlData) -> Unit, onError: (String) -> Unit)
/**
* 获取司机位视频展示控件

View File

@@ -64,21 +64,21 @@ bytex.ASM_API=ASM7
LOGLIB_VERSION=1.10.18
######## MogoAiCloudSDK Version ########
# 网络请求LOGLIB_VERSION
MOGO_NETWORK_VERSION=1.4.7.59
MOGO_NETWORK_VERSION=1.4.7.58
# 鉴权
MOGO_PASSPORT_VERSION=1.4.7.59
MOGO_PASSPORT_VERSION=1.4.7.58
# 长链接
MOGO_SOCKET_VERSION=1.4.7.59
MOGO_SOCKET_VERSION=1.4.7.58
# 数据采集
MOGO_REALTIME_VERSION=1.4.7.59
MOGO_REALTIME_VERSION=1.4.7.58
# 直播推流
MOGO_LIVE_VERSION=1.4.7.59
MOGO_LIVE_VERSION=1.4.7.58
# 直播拉流
MOGO_TRAFFICLIVE_VERSION=1.4.7.59
MOGO_TRAFFICLIVE_VERSION=1.4.7.58
# 定位服务
MOGO_LOCATION_VERSION=1.4.7.59
MOGO_LOCATION_VERSION=1.4.7.58
# 远程通讯模块
MOGO_TELEMATIC_VERSION=1.4.7.59
MOGO_TELEMATIC_VERSION=1.4.7.58
# 动态换肤SDK
MOGO_SKIN_VERSION=1.4.7.50
######## MogoAiCloudSDK Version ########