Merge remote-tracking branch 'origin/dev_MogoAP_eagle-220_211207_8.0.17_merge' into dev_MogoAP_eagle-220_211207_8.0.17_merge
This commit is contained in:
@@ -15,10 +15,11 @@ if (!isAndroidTestBuild()) {
|
||||
logLevel "DEBUG"
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'chain.log.hook'
|
||||
hooklog{
|
||||
enableLoggerToServer true
|
||||
if (!isAndroidTestBuild()) {
|
||||
apply plugin: 'chain.log.hook'
|
||||
hooklog{
|
||||
enableLoggerToServer true
|
||||
}
|
||||
}
|
||||
|
||||
//if (!isAndroidTestBuild()) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import androidx.test.core.app.ActivityScenario
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.filters.LargeTest
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotRecordResult
|
||||
import com.mogo.eagle.core.function.hmi.ui.MoGoHm·iFragment
|
||||
import com.mogo.eagle.core.function.hmi.ui.MoGoHmiFragment
|
||||
import com.mogo.eagle.core.function.main.MainLauncherActivity
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.flow.*
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.mogo.functions.test
|
||||
|
||||
import androidx.test.core.app.ActivityScenario
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.filters.LargeTest
|
||||
import com.mogo.eagle.core.function.hmi.ui.MoGoHmiFragment
|
||||
import com.mogo.eagle.core.function.main.MainLauncherActivity
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.suspendCancellableCoroutine
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import java.util.concurrent.Executors
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.concurrent.TimeUnit.MILLISECONDS
|
||||
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
@LargeTest
|
||||
class TipToastLeakTest {
|
||||
|
||||
|
||||
lateinit var launch: ActivityScenario<MainLauncherActivity>
|
||||
|
||||
@Before
|
||||
fun before() {
|
||||
launch = ActivityScenario.launch(MainLauncherActivity::class.java)
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
fun test() = runBlocking(Dispatchers.Main) {
|
||||
val f = ensureMoGoHmiFragmentShow()
|
||||
var index = 0
|
||||
while (index < 50) {
|
||||
delay(TimeUnit.SECONDS.toMillis(4))
|
||||
TipToast.shortTip("toast-> $index" )
|
||||
index ++
|
||||
}
|
||||
delay(TimeUnit.SECONDS.toMillis(1))
|
||||
f.activity?.finish()
|
||||
delay(TimeUnit.SECONDS.toMillis(2))
|
||||
}
|
||||
|
||||
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiFragment = suspendCancellableCoroutine {
|
||||
launch.onActivity { itx ->
|
||||
val executor = Executors.newSingleThreadScheduledExecutor()
|
||||
executor.scheduleAtFixedRate({
|
||||
var find =
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
||||
while (find == null) {
|
||||
find =
|
||||
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
|
||||
|
||||
}
|
||||
while (!find.isResumed) {
|
||||
Thread.sleep(500)
|
||||
}
|
||||
it.resumeWith(Result.success(find))
|
||||
try {
|
||||
Thread.sleep(500)
|
||||
executor.shutdownNow()
|
||||
} catch (e: Throwable) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}, 50, 500, MILLISECONDS)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,11 @@ import com.mogo.eagle.core.data.chain.ChainConstant.Companion.CHAIN_LINK_LOG_ADA
|
||||
import com.mogo.eagle.core.data.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS
|
||||
import com.mogo.eagle.core.data.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_DATA
|
||||
import com.mogo.eagle.core.data.chain.ChainLogParam
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.devatools.IDevaToolsProvider
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.DeviceUtils
|
||||
import com.mogo.eagle.core.utilcode.util.Utils
|
||||
import com.zhidao.loglib.fw.FileWriteManager
|
||||
@@ -30,13 +32,37 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
|
||||
override fun init(context: Context) {
|
||||
MogoLogCatchManager.init(context)
|
||||
logCheck(context)
|
||||
initTrace(context)
|
||||
}
|
||||
|
||||
private fun logCheck(context: Context) {
|
||||
val logger = SharedPrefsMgr.getInstance(context).getBoolean(MoGoConfig.CATCH_LOG, false)
|
||||
val loggerTime = SharedPrefsMgr.getInstance(context).getLong(MoGoConfig.CATCH_LOG_TIME, 0)
|
||||
val logCatchDuration = (System.currentTimeMillis() - loggerTime) / 1000 / 60
|
||||
if (logger && loggerTime > 0) {
|
||||
val logTime: Int = if (10 - logCatchDuration < 1) {
|
||||
1
|
||||
} else {
|
||||
10 - logCatchDuration.toInt()
|
||||
}
|
||||
MogoLogCatchManager.startCatchLog(logTime)
|
||||
} else {
|
||||
Logger.d(
|
||||
functionName,
|
||||
"logCheck logger : $logger , logCatchDuration : $logCatchDuration"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun startLogCatch() {
|
||||
MogoLogCatchManager.startCatchLog()
|
||||
}
|
||||
|
||||
override fun startLogCatch(duration: Int) {
|
||||
MogoLogCatchManager.startCatchLog(duration)
|
||||
}
|
||||
|
||||
override fun stopLogCatch() {
|
||||
MogoLogCatchManager.stopCatchLog()
|
||||
}
|
||||
@@ -52,8 +78,8 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
fwBuildMap[CHAIN_LINK_LOG_WEB_SOCKET_DATA] =
|
||||
FwBuild(false, pkgName + CHAIN_LINK_LOG_ADAS_MSG, 500)
|
||||
|
||||
traceInfoCache[CHAIN_LINK_LOG_CONNECT_STATUS] = ChainLogParam(true,"ADAS连接状态")
|
||||
traceInfoCache[CHAIN_LINK_LOG_WEB_SOCKET_DATA] = ChainLogParam(false,"ADAS长链数据")
|
||||
traceInfoCache[CHAIN_LINK_LOG_CONNECT_STATUS] = ChainLogParam(true, "ADAS连接状态")
|
||||
traceInfoCache[CHAIN_LINK_LOG_WEB_SOCKET_DATA] = ChainLogParam(false, "ADAS长链数据")
|
||||
FileWriteManager.getInstance()
|
||||
.init(context, MoGoAiCloudClientConfig.getInstance().sn, pkgName, fwBuildMap)
|
||||
}
|
||||
@@ -67,7 +93,7 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
map.forEach { (type, param) ->
|
||||
val fwBuild = this.fwBuildMap[type]
|
||||
fwBuild?.let {
|
||||
Logger.d(functionName,"param : ${param.des} , record : ${param.record}")
|
||||
Logger.d(functionName, "param : ${param.des} , record : ${param.record}")
|
||||
it.isRecord = param.record
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,10 +7,12 @@ import android.os.Message
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||
import com.mogo.eagle.core.network.NetConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
@@ -45,7 +47,6 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
|
||||
MogoApisHandler.getInstance().apis
|
||||
.getSocketManagerApi(AbsMogoApplication.getApp().applicationContext)
|
||||
.registerOnMessageListener(LOG_PUSH_TYPE, this)
|
||||
manualContent.duration = 10
|
||||
manualContent.pkgName = context.packageName
|
||||
}
|
||||
|
||||
@@ -78,12 +79,13 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
|
||||
return false
|
||||
}
|
||||
|
||||
fun startCatchLog() {
|
||||
fun startCatchLog(duration:Int = 10) {
|
||||
if (catchingList.contains(MANUAL_CATCH_PKG_NAME)) {
|
||||
TipToast.shortTip("已经在抓取日志了,请稍后再试")
|
||||
} else {
|
||||
Logger.d(TAG, "开始抓取日志====")
|
||||
Logger.d(TAG, "开始抓取日志==== duration : $duration")
|
||||
manualContent.type = START_CATCH_LOG
|
||||
manualContent.duration = duration
|
||||
startCatchLog(manualContent)
|
||||
}
|
||||
}
|
||||
@@ -99,21 +101,28 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
|
||||
var delay = (content.duration).toLong()
|
||||
handler.removeMessages(MSG_TRY_CLOSE_LOG)
|
||||
if (delay <= 0) {
|
||||
// 如果push 下来的delay小于等于0,那就给个默认最大值一小时
|
||||
// 如果push 下来的delay小于等于0,那就给个默认值
|
||||
delay = 10
|
||||
}
|
||||
handler.sendEmptyMessageDelayed(MSG_TRY_CLOSE_LOG, delay * 1000L * 60)
|
||||
|
||||
openLoggerLevel()
|
||||
|
||||
logInfoManager = LogInfoManagerFactory.createPushLogInfoManager(
|
||||
mContext,
|
||||
MoGoAiCloudClientConfig.getInstance().sn,
|
||||
content,
|
||||
this
|
||||
)
|
||||
|
||||
logInfoManager?.start()
|
||||
logInfoManager?.registerLogOutListener { lineLog ->
|
||||
CallerDevaToolsListenerManager.invokeDevaToolsLogCatchLines(lineLog)
|
||||
}
|
||||
|
||||
SharedPrefsMgr.getInstance(mContext!!).putBoolean(MoGoConfig.CATCH_LOG, true)
|
||||
SharedPrefsMgr.getInstance(mContext!!)
|
||||
.putLong(MoGoConfig.CATCH_LOG_TIME, System.currentTimeMillis())
|
||||
}
|
||||
|
||||
private fun stopCatchLog(content: RemoteLogPushContent) {
|
||||
@@ -124,6 +133,9 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
|
||||
logInfoManager?.stop()
|
||||
logInfoManager = null
|
||||
closeLoggerLevel()
|
||||
|
||||
SharedPrefsMgr.getInstance(mContext!!).putBoolean(MoGoConfig.CATCH_LOG, false)
|
||||
SharedPrefsMgr.getInstance(mContext!!).putLong(MoGoConfig.CATCH_LOG_TIME, 0)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -151,6 +163,10 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
|
||||
|
||||
override fun onClose(pkgName: String?) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
|
||||
SharedPrefsMgr.getInstance(mContext!!).putBoolean(MoGoConfig.CATCH_LOG, false)
|
||||
SharedPrefsMgr.getInstance(mContext!!).putLong(MoGoConfig.CATCH_LOG_TIME, 0)
|
||||
|
||||
CallerDevaToolsListenerManager.invokeDevaToolsLogCatchClose()
|
||||
TipToast.shortTip("日志抓取默认计时结束")
|
||||
}
|
||||
|
||||
@@ -36,11 +36,20 @@ import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.logcatch.ILogViewListener
|
||||
import com.mogo.eagle.core.function.hmi.ui.logcatch.LogInfoView
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.map.MogoMap
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_300
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_CROSS
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_TOP
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.MODE_CLOSE_SIGHT
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.MODE_LONG_SIGHT
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.MODE_MEDIUM_SIGHT
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
import java.util.*
|
||||
|
||||
@@ -55,9 +64,9 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoObuStatusListener,
|
||||
IMoGoAutopilotStatusListener, IMoGoAutopilotCarStateListener,
|
||||
IMoGoMapLocationListener, IMoGoAutopilotIdentifyListener,
|
||||
IMoGoAutopilotPlanningListener {
|
||||
IMoGoAutopilotStatusListener, IMoGoAutopilotCarStateListener,
|
||||
IMoGoMapLocationListener, IMoGoAutopilotIdentifyListener,
|
||||
IMoGoAutopilotPlanningListener {
|
||||
|
||||
private val TAG = "DebugSettingView"
|
||||
|
||||
@@ -76,6 +85,12 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
// 全局路径规划点个数
|
||||
private var mRouteInfoSize = 0
|
||||
|
||||
private val mapUiController by lazy {
|
||||
MogoApisHandler.getInstance().apis?.mapServiceApi?.mapUIController
|
||||
}
|
||||
|
||||
private var lastVisualAngleMode: VisualAngleMode? = null
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_debug_setting, this, true)
|
||||
initView()
|
||||
@@ -205,10 +220,29 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
changesight_top_btn.setOnClickListener {
|
||||
CallerHDMapManager.setMapDAngle(0);
|
||||
lastVisualAngleMode = mapUiController?.currentMapVisualAngle
|
||||
|
||||
changesight_top_btn.onClick {
|
||||
mapUiController?.changeMapVisualAngle(MAP_STYLE_VR_ANGLE_TOP, null)
|
||||
}
|
||||
|
||||
changesight_back_btn?.onClick {
|
||||
mapUiController?.changeMapVisualAngle(MAP_STYLE_VR_ANGLE_300, null)
|
||||
}
|
||||
|
||||
changesight_cross_btn?.onClick {
|
||||
mapUiController?.changeMapVisualAngle(MAP_STYLE_VR_ANGLE_CROSS, null)
|
||||
}
|
||||
|
||||
changesight_far_btn?.onClick {
|
||||
mapUiController?.changeMapVisualAngle(MODE_LONG_SIGHT, null)
|
||||
}
|
||||
|
||||
reset_changesight?.onClick {
|
||||
lastVisualAngleMode?.let {
|
||||
mapUiController?.changeMapVisualAngle(it, null)
|
||||
}
|
||||
}
|
||||
|
||||
tvObuInfo.text = CallerObuListenerManager.getObuStatusInfoJsonString()
|
||||
tvAutopilotInfo.text =
|
||||
@@ -355,10 +389,8 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
tbLogCatch.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) {
|
||||
CallerDevaToolsManager.startCatchLog()
|
||||
SharedPrefsMgr.getInstance(context).putBoolean(MoGoConfig.CATCH_LOG, true)
|
||||
} else {
|
||||
CallerDevaToolsManager.stopCatchLog()
|
||||
SharedPrefsMgr.getInstance(context).putBoolean(MoGoConfig.CATCH_LOG, false)
|
||||
}
|
||||
}
|
||||
CallerDevaToolsListenerManager.registerDevaToolsLogCatchListener(TAG,
|
||||
@@ -438,15 +470,15 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
tvAutopilotInfo.text = GsonUtils.toJson(mAutoPilotStatusInfo)
|
||||
|
||||
tvCarInfo.text =
|
||||
"GPS时间:${mAutoPilotCarStateInfo?.values?.satelliteTime}\n" +
|
||||
"自车经纬度:\n${mAutoPilotCarStateInfo?.values?.lon}\n${mAutoPilotCarStateInfo?.values?.lat}\n"
|
||||
"GPS时间:${mAutoPilotCarStateInfo?.values?.satelliteTime}\n" +
|
||||
"自车经纬度:\n${mAutoPilotCarStateInfo?.values?.lon}\n${mAutoPilotCarStateInfo?.values?.lat}\n"
|
||||
|
||||
tvIdentifyInfo.text =
|
||||
"感知数据个数:${mIdentifyDataSize}"
|
||||
"感知数据个数:${mIdentifyDataSize}"
|
||||
tvTrajectoryInfoSize.text =
|
||||
"引导线点个数:${mTrajectoryInfoSize}"
|
||||
"引导线点个数:${mTrajectoryInfoSize}"
|
||||
tvRouteInfoSize.text =
|
||||
"全局路径规划点个数:${mRouteInfoSize}"
|
||||
"全局路径规划点个数:${mRouteInfoSize}"
|
||||
|
||||
// 用完之后重制为0,防止节点回掉突然没数据,导致页面显示还是之前的数据情况
|
||||
mIdentifyDataSize = 0
|
||||
|
||||
@@ -14,6 +14,8 @@ object MoGoConfig {
|
||||
|
||||
// CMD全量日志抓取
|
||||
const val CATCH_LOG = "CATCH_LOG"
|
||||
// CMD全量日志抓取当时时间
|
||||
const val CATCH_LOG_TIME = "CATCH_LOG_TIME"
|
||||
|
||||
// 是否是演示(美化)模式,会存在SP中,方便做现场恢复
|
||||
const val IS_DEMO_MODE = "IS_DEMO_MODE"
|
||||
|
||||
@@ -10,6 +10,8 @@ interface IDevaToolsProvider : IMoGoFunctionServerProvider {
|
||||
|
||||
fun startLogCatch()
|
||||
|
||||
fun startLogCatch(duration: Int)
|
||||
|
||||
fun stopLogCatch()
|
||||
|
||||
fun getTraceInfo():HashMap<Int, ChainLogParam>
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.eagle.core.data.chain.ChainLogParam
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_DEVA_TOOLS
|
||||
import com.mogo.eagle.core.function.api.devatools.IDevaToolsProvider
|
||||
import com.mogo.eagle.core.utilcode.util.SnackbarUtils
|
||||
|
||||
object CallerDevaToolsManager {
|
||||
|
||||
@@ -18,6 +19,14 @@ object CallerDevaToolsManager {
|
||||
devaToolsProviderApi.startLogCatch()
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始抓取全量日志
|
||||
* duration 分钟数
|
||||
*/
|
||||
fun startCatchLog(duration: Int){
|
||||
devaToolsProviderApi.startLogCatch(duration)
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止抓取全量日志
|
||||
*/
|
||||
|
||||
@@ -17,6 +17,13 @@ import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleEventObserver;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.kotlin.ExtensionsKt;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
|
||||
|
||||
@@ -34,7 +41,7 @@ public final class TipToast {
|
||||
private static ToastViewGenerator sGenerator;
|
||||
|
||||
public static void init( Context context, ToastViewGenerator generator ) {
|
||||
TipToast.sContext = context;
|
||||
TipToast.sContext = context.getApplicationContext();
|
||||
sHandler = new Handler( context.getMainLooper() );
|
||||
sGenerator = generator;
|
||||
}
|
||||
@@ -165,20 +172,21 @@ public final class TipToast {
|
||||
|
||||
sHandler.post(() -> {
|
||||
synchronized ( sSyncObject ) {
|
||||
|
||||
if ( context == null ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( sToast != null ) {
|
||||
sToast.cancel();
|
||||
if ( sToast != null) {
|
||||
View view = sToast.getView();
|
||||
if (view != null && ViewCompat.isAttachedToWindow(view)) {
|
||||
sToast.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
if ( sGenerator == null ) {
|
||||
sToast = Toast.makeText( context, msg, duration );
|
||||
} else {
|
||||
sToast = new Toast( context );
|
||||
final View view = sGenerator.make( context, msg, tipDrawable );
|
||||
|
||||
if ( view != null ) {
|
||||
sToast.setView( view );
|
||||
sToast.setGravity( sGenerator.gravity(), sGenerator.xOffset(), sGenerator.yOffset() );
|
||||
@@ -187,6 +195,15 @@ public final class TipToast {
|
||||
sToast = Toast.makeText( context, msg, duration );
|
||||
}
|
||||
}
|
||||
View view = sToast.getView();
|
||||
if (view != null) {
|
||||
LifecycleOwner lifecycleOwner = ExtensionsKt.getLifecycleOwner(view);
|
||||
lifecycleOwner.getLifecycle().addObserver((LifecycleEventObserver) (source, event) -> {
|
||||
if (event == Lifecycle.Event.ON_DESTROY) {
|
||||
sToast = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
if ( sToast != null ) {
|
||||
sToast.show();
|
||||
}
|
||||
|
||||
@@ -179,13 +179,12 @@ public abstract class AbsMogoApplication extends Application {
|
||||
*/
|
||||
protected void registerSocketHttpDnsTTL(String host) {
|
||||
sApis.addressChangedListener(map -> {
|
||||
Logger.d("TEST-SOCKET", "ttl callBack ,ready to getCache Dns IP");
|
||||
String dnsCacheIp = sApis.getCachedHttpDnsIps(host, HTTP_DNS_ADDRESS_TYPE_HTTP);
|
||||
if (dnsCacheIp == null) {
|
||||
return;
|
||||
}
|
||||
Logger.d("TEST-SOCKET", "获取缓存Dns IP : " + dnsCacheIp + " , 原缓存 IP : " + cacheIp);
|
||||
if (!dnsCacheIp.equals(cacheIp)) {
|
||||
Logger.d("TEST-SOCKET", "获取缓存Dns IP : " + dnsCacheIp + " , 原缓存 IP : " + cacheIp);
|
||||
socketTTL();
|
||||
this.cacheIp = dnsCacheIp;
|
||||
}
|
||||
|
||||
@@ -56,11 +56,11 @@ bytex.forbidUseLenientMutationDuringGetArtifact=true
|
||||
bytex.verifyProguardConfigurationChanged=false
|
||||
bytex.ASM_API=ASM7
|
||||
|
||||
HOOK_LOG_VERSION=1.5.15
|
||||
HOOK_LOG_VERSION=1.5.16
|
||||
SERVICE_CHAIN_VERSION=1.0.52
|
||||
################ 外部依赖引用 ################
|
||||
# loglib
|
||||
LOGLIB_VERSION=1.2.3
|
||||
LOGLIB_VERSION=1.2.8
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 网络请求
|
||||
MOGO_NETWORK_VERSION=1.3.19
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.mogo.map.impl.custom;
|
||||
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_300;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_CROSS;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_TOP;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MODE_CLOSE_SIGHT;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MODE_LONG_SIGHT;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MODE_MEDIUM_SIGHT;
|
||||
@@ -766,6 +769,12 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
return MODE_MEDIUM_SIGHT;
|
||||
case 2:
|
||||
return MODE_LONG_SIGHT;
|
||||
case 3:
|
||||
return MAP_STYLE_VR_ANGLE_300;
|
||||
case 4:
|
||||
return MAP_STYLE_VR_ANGLE_TOP;
|
||||
case 5:
|
||||
return MAP_STYLE_VR_ANGLE_CROSS;
|
||||
default:
|
||||
throw new IllegalStateException("mode is unCorrect");
|
||||
}
|
||||
|
||||
@@ -15,9 +15,25 @@ public enum VisualAngleMode implements IMogoMapVisualAngle {
|
||||
/**
|
||||
* 视距远景
|
||||
*/
|
||||
MODE_LONG_SIGHT(2);
|
||||
MODE_LONG_SIGHT(2),
|
||||
|
||||
private int code;
|
||||
/**
|
||||
* 后方来车300视角
|
||||
*/
|
||||
MAP_STYLE_VR_ANGLE_300(3),
|
||||
|
||||
/**
|
||||
* 顶视角
|
||||
*/
|
||||
MAP_STYLE_VR_ANGLE_TOP(4),
|
||||
|
||||
/**
|
||||
* 十字路口视角
|
||||
*/
|
||||
MAP_STYLE_VR_ANGLE_CROSS(5);
|
||||
|
||||
|
||||
private final int code;
|
||||
|
||||
VisualAngleMode(int code) {
|
||||
this.code = code;
|
||||
|
||||
@@ -31,6 +31,7 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
|
||||
private static final String BYTEAMP_APPID = "302368";
|
||||
|
||||
private static final String TAG = "ApmCrashReportProvider";
|
||||
private static final String MAP_SDK_VERSION = "MAP_SDK_VERSION";
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
@@ -53,6 +54,8 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
|
||||
});
|
||||
crash.config().setChannel("eagle");
|
||||
crash.config().setDeviceId(MoGoAiCloudClientConfig.getInstance().getSn());//可选,可以设置自定义did,不设置会使用内部默认的
|
||||
String mapSDKVersion = AppUtils.getCustomMapSDKVersion(context);
|
||||
crash.addTags(MAP_SDK_VERSION,mapSDKVersion);
|
||||
// crash.setReportUrl("www.xxx.com"); // 私有化部署:私有化部署才配置上报地址
|
||||
// crash.addTags("key", "value"); // 自定义筛选tag, 按需添加、可多次覆盖
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user