bug修复: 移除危险的Looper.loop()全局劫持
This commit is contained in:
parent
8bddca4996
commit
a982e54eeb
|
|
@ -98,19 +98,6 @@ object LogManager {
|
|||
onCrashDetected(null, thread.name, throwable)
|
||||
defaultHandler?.uncaughtException(thread, throwable) ?: exitProcess(1)
|
||||
}
|
||||
|
||||
// 2. 捕获主线程 Looper
|
||||
android.os.Handler(android.os.Looper.getMainLooper()).post {
|
||||
while (true) {
|
||||
try {
|
||||
android.os.Looper.loop()
|
||||
} catch (e: Throwable) {
|
||||
onCrashDetected(null, "MainLooper", e)
|
||||
// 如果是 UnsatisfiedLinkError,这种错误无法恢复,必须抛出让系统处理
|
||||
throw e
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun cleanOldLogs(dir: File) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue