Commit 869dcb6b by 严久程

声网日志文件和路径更改

parent a18c9d6a
......@@ -42,7 +42,7 @@ ext {
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.48.7.17",
"m-confide" : "0.0.48.7.19",
"m-consultant" : "0.0.57.4",
"m-fm" : "0.0.29.3",
"m-user" : "0.0.60.1",
......@@ -75,7 +75,7 @@ ext {
"ydl-webview" : "0.0.38.24",
"ydl-media" : "0.0.20",
"ydl-pay" : "0.0.17",
"m-audioim" : "0.0.48.3.6",
"m-audioim" : "0.0.48.3.8",
"ydl-flutter-base": "0.0.10.9",
//以下 几乎不会动
......@@ -121,7 +121,7 @@ ext {
"ydl-webview" : "0.0.38.24",
"ydl-media" : "0.0.20",
"ydl-pay" : "0.0.17",
"m-audioim" : "0.0.48.3.6",
"m-audioim" : "0.0.48.3.8",
"ydl-flutter-base": "0.0.10.9",
//以下 几乎不会动
......
......@@ -75,7 +75,7 @@ dependencies {
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
api "com.alibaba:arouter-api:$arouter_api"
api ('com.ydl:ydl-av:1.2.1@aar'){
api ('com.ydl:ydl-av:1.2.4@aar'){
transitive = true
}
......
......@@ -40,6 +40,7 @@ import com.ydl.webview.NewH5Activity
import com.ydl.webview.RefreshWebEvent
import com.ydl.ydl_av.chat.bean.AudioMessageBean
import com.ydl.ydl_av.messge_service.YDLRTMClient
import com.ydl.ydl_av.messge_service.callback.CancelCallStatusListener
import com.ydl.ydl_av.voice.listener.IYDLVoiceEventHandler
import com.ydl.ydl_av.voice.manager.YDLVoiceManager
import com.ydl.ydl_image.config.SimpleImageOpConfiger
......@@ -413,7 +414,7 @@ class AudioHomeActivity :
Observable.create<Any> {
try {
val content = Gson().toJson(logBean)
AudioLogUtils.writeAgoraLog(content)
AudioLogUtils.writeAgoraLog(content,"confide")
} catch (e: Exception) {
}
}.subscribeOn(Schedulers.io())
......@@ -639,20 +640,27 @@ class AudioHomeActivity :
}
}, {
LogUtil.d(it.message)
}, {
}) {
waittingStatus()
if (!isConnectSuccess) {
//关闭音乐
stopPlaying()
//提示切换传统线路
//发送消息通知专家用户已挂断
YDLRTMClient.instances.cancelCall(listenerUid, channelId)
YDLRTMClient.instances.cancelCall(listenerUid, channelId,object :CancelCallStatusListener{
override fun onFailure(errorMsg: String?, errorCode: Int) {
YDLRTMClient.instances.cancelCall(listenerUid, channelId,null)
}
override fun onSuccess() {
}
})
//通话结束或挂断时,上传日志文件
uploadLog()
showChooseDialog(2)
}
})
}
//双重保险:加入频道成功,通过服务端发推送给专家
noticeServerPush(true)
......@@ -695,7 +703,15 @@ class AudioHomeActivity :
*/
private fun userCloseCalling() {
//发送消息通知专家用户已挂断
YDLRTMClient.instances.cancelCall(listenerUid, channelId)
//发送消息通知专家用户已挂断
YDLRTMClient.instances.cancelCall(listenerUid, channelId,object :CancelCallStatusListener{
override fun onFailure(errorMsg: String?, errorCode: Int) {
YDLRTMClient.instances.cancelCall(listenerUid, channelId,null)
}
override fun onSuccess() {
}
})
//通话结束或挂断时,上传日志文件
uploadLog()
handler!!.postDelayed({
......@@ -780,7 +796,15 @@ class AudioHomeActivity :
} else {
//未连接成功,切换axb时:需发送消息通知专家端用户已挂断
//发送消息通知专家用户已挂断
YDLRTMClient.instances.cancelCall(listenerUid, channelId)
//发送消息通知专家用户已挂断
YDLRTMClient.instances.cancelCall(listenerUid, channelId,object :CancelCallStatusListener{
override fun onFailure(errorMsg: String?, errorCode: Int) {
YDLRTMClient.instances.cancelCall(listenerUid, channelId,null)
}
override fun onSuccess() {
}
})
leaveChannel()
}
}
......
......@@ -29,10 +29,10 @@ class AudioLogUtils {
@SuppressLint("SimpleDateFormat")
private val format = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
fun writeAgoraLog(content: String) {
fun writeAgoraLog(content: String, fileName: String) {
Observable.create<Any> {
try {
writeLog(content)
writeLog(content, fileName)
if (BuildConfig.DEBUG) {
LogUtil.d("writeLog_complete")
}
......@@ -42,10 +42,10 @@ class AudioLogUtils {
.subscribe()
}
private fun writeLog(content: String) {
private fun writeLog(content: String, fileName: String) {
try {
val folder = getLogFolder()
val file = File(folder, "AgoraInfoLog")
val file = File(folder, fileName)
if (!file.exists() || !file.isFile) {
file.createNewFile()
}
......
......@@ -137,6 +137,8 @@ class ConsultantAudioHomeActivity :
//5s倒计时,5s后还是连接中,则直接关闭页面
connectingStatusWaitingTimeCount()
tv_tips.visibility=View.INVISIBLE
}
}
......@@ -897,7 +899,7 @@ class ConsultantAudioHomeActivity :
private fun writeAgoraLog(content: String) {
Observable.create<Any> {
try {
AudioLogUtils.writeAgoraLog(content)
AudioLogUtils.writeAgoraLog(content,"consult")
} catch (e: Exception) {
}
}.subscribeOn(Schedulers.io())
......
......@@ -226,12 +226,12 @@ class LogHelper private constructor() {
//获取声网日志
private fun getAgoraLog(context: Context): File {
val agora = FileUtils.getSDDirectory() + "/" + context.packageName + "/agorasdk.log"
// val agora = FileUtils.getSDDirectory() + "/" + context.packageName + "/agorasdk.log"
val filePath = context.filesDir.path + "/agorasdk.log"
return File(agora)
return File(filePath)
}
private object Holder {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment