[6.6.0]修复崩溃

This commit is contained in:
xuxinchao
2024-09-02 11:43:55 +08:00
parent 7f7616b493
commit 906c00da88

View File

@@ -584,6 +584,10 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
if(!BadCaseConfig.alreadyShowOneReport){
//触发一键上报
ThreadUtils.runOnUiThread {
val activity = AppStateManager.currentActivity()
if (activity !is AppCompatActivity) {
return@runOnUiThread
}
if(reportTypeWindow == null){
reportTypeWindow = ReportTypeWindow(activity)
reportTypeWindow?.setClickListener(object: ReportTypeWindow.ClickListener{
@@ -614,6 +618,10 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
if(it.status == AutopilotStatistics.AUTOPILOT_START_STATUS.FAILED){
//触发一键上报
ThreadUtils.runOnUiThread{
val activity = AppStateManager.currentActivity()
if (activity !is AppCompatActivity) {
return@runOnUiThread
}
if(reportTypeWindow == null){
reportTypeWindow = ReportTypeWindow(activity)
reportTypeWindow?.setClickListener(object: ReportTypeWindow.ClickListener{
@@ -655,6 +663,10 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
}else if(state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE ||
state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE){
if(shouldRecord){
val activity = AppStateManager.currentActivity()
if (activity !is AppCompatActivity) {
return
}
val geocodeSearch = GeocodeSearch(activity)
geocodeSearch.setOnGeocodeSearchListener(object: GeocodeSearch.OnGeocodeSearchListener {
override fun onRegeocodeSearched(regeocodeResult: RegeocodeResult?, p1: Int) {