Modify change empty mark for AppErrorsInfoBean in AppErrorsInfoBean, FrameworkHooker

This commit is contained in:
2023-01-19 12:57:02 +08:00
parent cf1796b7cb
commit c48a23f07d
2 changed files with 6 additions and 9 deletions

View File

@@ -63,12 +63,6 @@ data class AppErrorsInfoBean(
companion object {
/**
* 创建一个空的 [AppErrorsInfoBean]
* @return [AppErrorsInfoBean]
*/
fun createEmpty() = AppErrorsInfoBean().apply { isEmpty = true }
/**
* 从 [ApplicationErrorReport.CrashInfo] 克隆
* @param pid APP 进程 ID
@@ -101,8 +95,11 @@ data class AppErrorsInfoBean(
}
}
/** 标识当前内容是否为空 */
var isEmpty = false
/**
* 获取当前内容是否为空
* @return [Boolean]
*/
val isEmpty get() = pid == -1 && userId == -1 && timestamp == -1L
/**
* 获取生成的 Json 文件名

View File

@@ -186,7 +186,7 @@ object FrameworkHooker : YukiBaseHooker() {
onPushAppErrorInfoData {
AppErrorsRecordData.allData.firstOrNull { e -> e.pid == it } ?: run {
loggerW(msg = "Cannot received crash application data --pid $it")
AppErrorsInfoBean.createEmpty()
AppErrorsInfoBean()
}
}
onPushAppErrorsInfoData { AppErrorsRecordData.allData.toArrayList() }