优化
This commit is contained in:
@@ -404,6 +404,8 @@ class AudioPlayService : BaseService(),
|
|||||||
}
|
}
|
||||||
if (timeMinute == 0) {
|
if (timeMinute == 0) {
|
||||||
AudioPlay.stop()
|
AudioPlay.stop()
|
||||||
|
postEvent(EventBus.AUDIO_DS, timeMinute)
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
postEvent(EventBus.AUDIO_DS, timeMinute)
|
postEvent(EventBus.AUDIO_DS, timeMinute)
|
||||||
|
|||||||
@@ -396,6 +396,8 @@ abstract class BaseReadAloudService : BaseService(),
|
|||||||
}
|
}
|
||||||
if (timeMinute == 0) {
|
if (timeMinute == 0) {
|
||||||
ReadAloud.stop(this@BaseReadAloudService)
|
ReadAloud.stop(this@BaseReadAloudService)
|
||||||
|
postEvent(EventBus.READ_ALOUD_DS, timeMinute)
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
postEvent(EventBus.READ_ALOUD_DS, timeMinute)
|
postEvent(EventBus.READ_ALOUD_DS, timeMinute)
|
||||||
|
|||||||
@@ -164,11 +164,15 @@ class AboutFragment : PreferenceFragmentCompat() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun copyLogs(doc: FileDoc) {
|
private fun copyLogs(doc: FileDoc) {
|
||||||
val logFiles = File(appCtx.externalCacheDir, "logs")
|
val cacheDir = appCtx.externalCacheDir
|
||||||
val crashFiles = File(appCtx.externalCacheDir, "crash")
|
val logFiles = File(cacheDir, "logs")
|
||||||
|
val crashFiles = File(cacheDir, "crash")
|
||||||
|
val logcatFile = File(cacheDir, "logcat.txt")
|
||||||
|
|
||||||
val zipFile = File(appCtx.externalCacheDir, "logs.zip")
|
dumpLogcat(logcatFile)
|
||||||
ZipUtils.zipFiles(arrayListOf(logFiles, crashFiles), zipFile)
|
|
||||||
|
val zipFile = File(cacheDir, "logs.zip")
|
||||||
|
ZipUtils.zipFiles(arrayListOf(logFiles, crashFiles, logcatFile), zipFile)
|
||||||
|
|
||||||
doc.find("logs.zip")?.delete()
|
doc.find("logs.zip")?.delete()
|
||||||
|
|
||||||
@@ -195,4 +199,15 @@ class AboutFragment : PreferenceFragmentCompat() {
|
|||||||
return true
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user