mirror of
https://github.com/gedoor/legado.git
synced 2025-01-07 03:06:58 +08:00
优化
This commit is contained in:
parent
7825050f91
commit
8ccd05070c
@ -404,6 +404,8 @@ class AudioPlayService : BaseService(),
|
||||
}
|
||||
if (timeMinute == 0) {
|
||||
AudioPlay.stop()
|
||||
postEvent(EventBus.AUDIO_DS, timeMinute)
|
||||
break
|
||||
}
|
||||
}
|
||||
postEvent(EventBus.AUDIO_DS, timeMinute)
|
||||
|
@ -396,6 +396,8 @@ abstract class BaseReadAloudService : BaseService(),
|
||||
}
|
||||
if (timeMinute == 0) {
|
||||
ReadAloud.stop(this@BaseReadAloudService)
|
||||
postEvent(EventBus.READ_ALOUD_DS, timeMinute)
|
||||
break
|
||||
}
|
||||
}
|
||||
postEvent(EventBus.READ_ALOUD_DS, timeMinute)
|
||||
|
@ -164,11 +164,15 @@ class AboutFragment : PreferenceFragmentCompat() {
|
||||
}
|
||||
|
||||
private fun copyLogs(doc: FileDoc) {
|
||||
val logFiles = File(appCtx.externalCacheDir, "logs")
|
||||
val crashFiles = File(appCtx.externalCacheDir, "crash")
|
||||
val cacheDir = appCtx.externalCacheDir
|
||||
val logFiles = File(cacheDir, "logs")
|
||||
val crashFiles = File(cacheDir, "crash")
|
||||
val logcatFile = File(cacheDir, "logcat.txt")
|
||||
|
||||
val zipFile = File(appCtx.externalCacheDir, "logs.zip")
|
||||
ZipUtils.zipFiles(arrayListOf(logFiles, crashFiles), zipFile)
|
||||
dumpLogcat(logcatFile)
|
||||
|
||||
val zipFile = File(cacheDir, "logs.zip")
|
||||
ZipUtils.zipFiles(arrayListOf(logFiles, crashFiles, logcatFile), zipFile)
|
||||
|
||||
doc.find("logs.zip")?.delete()
|
||||
|
||||
@ -195,4 +199,15 @@ class AboutFragment : PreferenceFragmentCompat() {
|
||||
return true
|
||||
}
|
||||
|
||||
private fun dumpLogcat(file: File) {
|
||||
try {
|
||||
val process = Runtime.getRuntime().exec("logcat -d")
|
||||
file.outputStream().use {
|
||||
process.inputStream.copyTo(it)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
AppLog.put("保存Logcat失败\n$e", e)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user