[6.0.0][全量日志] 全量日志添加状态记录,日志中心由【导出全量日志】改为【上传全量日志】
This commit is contained in:
@@ -1381,27 +1381,19 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
v.visibility = View.INVISIBLE
|
||||
logLoadingView?.visibility = View.VISIBLE
|
||||
v.scope.launch(Dispatchers.IO) {
|
||||
val file = CallerDevaToolsManager.logcat()?.export()
|
||||
if (file != null && file.exists()) {
|
||||
withContext(Dispatchers.Main) {
|
||||
var activity = AppStateManager.currentActivity()
|
||||
while (activity == null) {
|
||||
delay(2000)
|
||||
activity = AppStateManager.currentActivity()
|
||||
if (activity != null) {
|
||||
break
|
||||
}
|
||||
}
|
||||
activity?.startActivity(Intent.createChooser(Intent().also {
|
||||
it.action = Intent.ACTION_SEND
|
||||
it.type = "application/zip"
|
||||
it.putExtra(Intent.EXTRA_STREAM, FileProvider.getUriForFile(activity, "${activity.packageName}.fileProvider", file))
|
||||
}, "分享全量日志压缩包到"))
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showShort("全量日志压缩文件生成失败")
|
||||
var isUploadSuccess = false
|
||||
try {
|
||||
CallerDevaToolsManager.logcat()?.upload()
|
||||
isUploadSuccess = true
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
withContext(Dispatchers.Main) {
|
||||
if (isUploadSuccess) {
|
||||
ToastUtils.showShort("上传成功")
|
||||
} else {
|
||||
ToastUtils.showShort("上传失败")
|
||||
}
|
||||
logLoadingView?.visibility = View.INVISIBLE
|
||||
exportAllLogs?.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
@@ -2246,7 +2246,7 @@
|
||||
android:layout_gravity="center">
|
||||
|
||||
<TextView
|
||||
android:text="正在压缩全量日志,请稍候"
|
||||
android:text="正在上传,请稍侯..."
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/black"
|
||||
@@ -2265,7 +2265,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20dip"
|
||||
android:text="导出全量日志"
|
||||
android:text="上传全量日志"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="10dip"
|
||||
android:layout_marginBottom="10dip" />
|
||||
|
||||
Reference in New Issue
Block a user