Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
018badf8
Commit
018badf8
authored
Apr 02, 2021
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 组件阿里云埋点改用platform增加丰富参数埋点,方便后续定位问题
parent
cb4f68c6
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
320 additions
and
321 deletions
+320
-321
config.gradle
config.gradle
+13
-13
AudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
+54
-53
YDLavManager.kt
m-audioim/src/main/java/com/ydl/audioim/YDLavManager.kt
+44
-44
ConsultantAudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/consultantim/ConsultantAudioHomeActivity.kt
+14
-14
AVChatKit.java
m-im/src/main/java/com/yidianling/avchatkit/AVChatKit.java
+3
-3
AVChatActivity.java
m-im/src/main/java/com/yidianling/avchatkit/activity/AVChatActivity.java
+48
-48
NetworkUtil.java
m-im/src/main/java/com/yidianling/avchatkit/common/util/NetworkUtil.java
+4
-4
AVChatController.java
m-im/src/main/java/com/yidianling/avchatkit/controll/AVChatController.java
+28
-28
TeamAVChatActivity.java
m-im/src/main/java/com/yidianling/avchatkit/teamavchat/activity/TeamAVChatActivity.java
+7
-7
IMChatUtil.kt
m-im/src/main/java/com/yidianling/im/helper/IMChatUtil.kt
+2
-2
NimUIKit.java
m-im/src/main/java/com/yidianling/uikit/api/NimUIKit.java
+2
-2
YDLP2PMessageActivity.java
m-im/src/main/java/com/yidianling/uikit/business/session/activity/YDLP2PMessageActivity.java
+2
-2
YDLMessageFragment.java
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
+5
-5
LoginUtils.kt
m-user/src/main/java/com/yidianling/user/LoginUtils.kt
+6
-6
SmsLoginActivity.kt
m-user/src/main/java/com/yidianling/user/ui/SmsLoginActivity.kt
+5
-5
OneKeyLoginHelp.kt
m-user/src/main/java/com/yidianling/user/ui/login/OneKeyLoginHelp.kt
+4
-4
RegisterAndLoginActivity.kt
m-user/src/main/java/com/yidianling/user/ui/login/RegisterAndLoginActivity.kt
+0
-2
InputPassWordPresenterImpl.kt
m-user/src/main/java/com/yidianling/user/ui/login/presenter/InputPassWordPresenterImpl.kt
+6
-6
LoginPresenterImpl.kt
m-user/src/main/java/com/yidianling/user/ui/login/presenter/LoginPresenterImpl.kt
+11
-11
CommonPayDialog.kt
ydl-pay/src/main/java/com/yidianling/ydl_pay/common/CommonPayDialog.kt
+25
-25
PayActivity.kt
ydl-pay/src/main/java/com/yidianling/ydl_pay/pay/PayActivity.kt
+19
-19
RxPay.kt
ydl-pay/src/main/java/com/yidianling/ydl_pay/pay/RxPay.kt
+4
-4
PayDialog.kt
ydl-pay/src/main/java/com/yidianling/ydl_pay/pay/payDialog/PayDialog.kt
+6
-6
NewH5Activity.java
ydl-webview/src/main/java/com/ydl/webview/NewH5Activity.java
+8
-8
No files found.
config.gradle
View file @
018badf8
...
...
@@ -8,9 +8,9 @@ ext {
"m-confide"
:
"0.0.49.05"
,
"m-consultant"
:
"0.0.59.68"
,
"m-fm"
:
"0.0.30.01"
,
"m-user"
:
"0.0.61.2
4
"
,
"m-user"
:
"0.0.61.2
5
"
,
"m-home"
:
"0.0.22.59"
,
"m-im"
:
"0.0.18.4
6
"
,
"m-im"
:
"0.0.18.4
7
"
,
"m-dynamic"
:
"0.0.7.19"
,
"m-article"
:
"0.0.0.6"
,
...
...
@@ -33,13 +33,13 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.39.9
7
"
,
"ydl-platform"
:
"0.0.39.9
9
"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.
38
"
,
"ydl-webview"
:
"0.0.38.
40
"
,
"ydl-media"
:
"0.0.21.6"
,
"ydl-pay"
:
"0.0.18.1
6
"
,
"m-audioim"
:
"0.0.49.29.3
4
"
,
"ydl-pay"
:
"0.0.18.1
7
"
,
"m-audioim"
:
"0.0.49.29.3
5
"
,
"ydl-flutter-base"
:
"0.0.14.20"
,
//以下 几乎不会动
...
...
@@ -88,12 +88,12 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide"
:
"0.0.49.0
4
"
,
"m-confide"
:
"0.0.49.0
5
"
,
"m-consultant"
:
"0.0.59.68"
,
"m-fm"
:
"0.0.30.01"
,
"m-user"
:
"0.0.61.2
4
"
,
"m-user"
:
"0.0.61.2
5
"
,
"m-home"
:
"0.0.22.59"
,
"m-im"
:
"0.0.18.4
6
"
,
"m-im"
:
"0.0.18.4
7
"
,
"m-dynamic"
:
"0.0.7.19"
,
"m-article"
:
"0.0.0.6"
,
...
...
@@ -115,13 +115,13 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.39.9
7
"
,
"ydl-platform"
:
"0.0.39.9
9
"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.
38
"
,
"ydl-webview"
:
"0.0.38.
40
"
,
"ydl-media"
:
"0.0.21.6"
,
"ydl-pay"
:
"0.0.18.1
6
"
,
"m-audioim"
:
"0.0.49.29.3
4
"
,
"ydl-pay"
:
"0.0.18.1
7
"
,
"m-audioim"
:
"0.0.49.29.3
5
"
,
"ydl-flutter-base"
:
"0.0.14.20"
,
//以下 几乎不会动
...
...
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
View file @
018badf8
...
...
@@ -50,10 +50,10 @@ import com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.Utils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import
com.ydl.ydlcommon.utils.log.LogHelper
import
com.ydl.ydlcommon.utils.remind.ToastHelper
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.user.api.service.IUserService
import
de.greenrobot.event.EventBus
...
...
@@ -214,8 +214,8 @@ class AudioHomeActivity :
uploadException
(
"mRtcEventHandler-onWarning:warnCode--%${warn}"
,
callback
=
null
)
LogUtil
.
e
(
"[agora]发生警告回调$warn"
)
writeAgoraLog
(
"声网警告回调($warn)"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"声网警告回调($warn)"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"声网警告回调($warn)"
)
//103:没有可用的频道资源。可能是因为服务端没法分配频道资源
//104:查找频道超时。在加入频道时 SDK 先要查找指定的频道,出现该警告一般是因为网络太差,连接不到服务器
//105:查找频道请求被服务器拒绝。服务器可能没有办法处理这个请求或请求是非法的
...
...
@@ -244,8 +244,8 @@ class AudioHomeActivity :
super
.
onError
(
err
)
uploadException
(
"mRtcEventHandler-onError:errorCode--%${err}"
,
callback
=
null
)
writeAgoraLog
(
"声网错误回调errorCode--%${err}"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"声网错误回调errorCode--%${err}"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"声网错误回调errorCode--%${err}"
)
//3:SDK 初始化失败。Agora 建议尝试以下处理方法
//7:SDK 尚未初始化,就调用其 API。请确认在调用 API 之前已创建 RtcEngine 对象并完成初始化
//10:API 调用超时。有些 API 调用需要 SDK 返回结果,如果 SDK 处理时间过长,超过 10 秒没有返回,会出现此错误
...
...
@@ -289,15 +289,16 @@ class AudioHomeActivity :
override
fun
onApiCallExecuted
(
error
:
Int
,
api
:
String
?,
result
:
String
?)
{
super
.
onApiCallExecuted
(
error
,
api
,
result
)
// LogUtil.e("[agora]$api 已执行回调 $result")
AliYunLogHelper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"$api 已执行回调 $result"
)
//注销原因,产生大量无效数据,会被频繁调用
// AliYunRichLogsHelper.getInstance()
// .sendLog(AliYunLogConfig.AGORA, "$api 已执行回调 $result")
}
override
fun
onJoinChannelSuccess
(
channel
:
String
?,
uid
:
Int
,
elapsed
:
Int
)
{
super
.
onJoinChannelSuccess
(
channel
,
uid
,
elapsed
)
LogUtil
.
e
(
"[agora]$uid 用户声网加入频道成功:channel=$channel"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"$uid 用户声网加入频道成功:channel=$channel"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"$uid 用户声网加入频道成功:channel=$channel"
)
//更新ui
// onJoinChannelSuccess()
...
...
@@ -313,8 +314,8 @@ class AudioHomeActivity :
override
fun
onRejoinChannelSuccess
(
channel
:
String
?,
uid
:
Int
,
elapsed
:
Int
)
{
super
.
onRejoinChannelSuccess
(
channel
,
uid
,
elapsed
)
LogUtil
.
e
(
"[agora]$uid 用户声网重新加入频道成功:channel=$channel"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"$uid 用户声网重新加入频道成功:channel=$channel"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"$uid 用户声网重新加入频道成功:channel=$channel"
)
runOnUiThread
{
//自己加入频道成功
if
(!
isConnectSuccess
)
{
...
...
@@ -328,8 +329,8 @@ class AudioHomeActivity :
override
fun
onRtcStats
(
stats
:
IRtcEngineEventHandler
.
RtcStats
?)
{
super
.
onRtcStats
(
stats
)
writeAgoraLog
(
"声网onRtcStats:users:${stats?.users}"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"声网onRtcStats:users:${stats?.users}"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"声网onRtcStats:users:${stats?.users}"
)
// 不需要移动端做离开房间逻辑,服务端会判断进行踢人逻辑
//因为用户端直接加入了频道,防止该回调执行时,专家还未加入频道,因此在连接成功之后,才进行频道人数判断
// if (isConnectSuccess && null != stats?.users && stats.users == 1) {
...
...
@@ -346,8 +347,8 @@ class AudioHomeActivity :
// 3 网络连接被服务器中止 该情况现在是因为后端踢人逻辑
if
(
reason
==
3
)
{
writeAgoraLog
(
"通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason})"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason})"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason})"
)
// com.yidianling.common.tools.ToastUtil.toastShort("专家已挂断")
//通话结束或挂断时,上传日志文件
uploadLog
()
...
...
@@ -359,8 +360,8 @@ class AudioHomeActivity :
override
fun
onLeaveChannel
(
stats
:
IRtcEngineEventHandler
.
RtcStats
?)
{
super
.
onLeaveChannel
(
stats
)
LogUtil
.
e
(
"[agora]离开频道回调"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"离开频道回调"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"离开频道回调"
)
//通话结束或挂断时,上传日志文件
uploadLog
()
}
...
...
@@ -369,16 +370,16 @@ class AudioHomeActivity :
override
fun
onUserJoined
(
uid
:
Int
,
elapsed
:
Int
)
{
super
.
onUserJoined
(
uid
,
elapsed
)
LogUtil
.
e
(
"[agora]远端用户/主播加入频道回调"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"远端用户/主播加入频道回调"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"远端用户/主播加入频道回调"
)
}
override
fun
onUserOffline
(
uid
:
Int
,
elapsed
:
Int
)
{
super
.
onUserOffline
(
uid
,
elapsed
)
LogUtil
.
e
(
"[agora]远端用户$uid 离开频道回调"
)
writeAgoraLog
(
"接通后通话结束:对方已挂断"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"接通后通话结束:对方已挂断"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"接通后通话结束:对方已挂断"
)
//通话结束或挂断时,上传日志文件
uploadLog
()
showToast
(
"专家已挂断"
)
...
...
@@ -452,8 +453,8 @@ class AudioHomeActivity :
//页面传递数据初始化
initIntentData
()
writeAgoraLog
(
"通话页面打开的时候,RTM登录状态码:${YDLavManager.sdkStatus}"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
RTM
,
"通话页面打开的时候,RTM登录状态码:${YDLavManager.sdkStatus}"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
RTM
,
"通话页面打开的时候,RTM登录状态码:${YDLavManager.sdkStatus}"
)
if
(
YDLavManager
.
sdkStatus
!=
Constants
.
CONNECTION_STATE_CONNECTED
)
{
//再次登录声网,确保声网登录状态
reLoginRTM
()
...
...
@@ -510,8 +511,8 @@ class AudioHomeActivity :
commentUrl
=
intent
.
getStringExtra
(
IntentConstants
.
INTENT_COMMENT_URL
)
dialStatus
=
intent
.
getStringExtra
(
IntentConstants
.
INTENT_DIALSTATUS
)
writeAgoraLog
(
"专家的通话状态dialStatus:$dialStatus"
,
false
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"专家的通话状态dialStatus:$dialStatus"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"专家的通话状态dialStatus:$dialStatus"
)
isShowAXB
=
intent
.
getBooleanExtra
(
IntentConstants
.
INTENT_ISSHOWAXB
,
true
)
val
logBean
=
AgoraLogInfoBean
(
...
...
@@ -526,8 +527,8 @@ class AudioHomeActivity :
)
val
content
=
Gson
().
toJson
(
logBean
)
writeAgoraLog
(
"主叫方发送的邀请通话消息内容:$content"
,
true
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"主叫方发送的邀请通话消息内容:$content"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"主叫方发送的邀请通话消息内容:$content"
)
localRemainTime
=
remainTime
?.
toInt
()
handler
=
Handler
()
vibrator
=
getSystemService
(
Service
.
VIBRATOR_SERVICE
)
as
Vibrator
?
...
...
@@ -535,8 +536,8 @@ class AudioHomeActivity :
private
fun
reLoginRTM
()
{
writeAgoraLog
(
"RMT状态:${YDLavManager.sdkStatus},重新登录RMT"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
RTM
,
"RMT状态:${YDLavManager.sdkStatus},重新登录RMTt"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
RTM
,
"RMT状态:${YDLavManager.sdkStatus},重新登录RMTt"
)
val
uid
=
YdlCommonRouterManager
.
getYdlCommonRoute
().
getUid
().
toString
()
YDLavManager
.
instances
.
login
(
uid
)
{
_isSuccess
,
_msg
->
// writeAgoraLog("拨打电话界面打开RTM重新登录,uid=${uid}")
...
...
@@ -547,8 +548,8 @@ class AudioHomeActivity :
private
fun
initView
()
{
writeAgoraLog
(
"用户拨打电话界面开启"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"用户拨打电话界面开启"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"用户拨打电话界面开启"
)
tv_change_route
.
isEnabled
=
false
//水波纹view初始化
wave_view
.
setDuration
(
6000
)
...
...
@@ -594,8 +595,8 @@ class AudioHomeActivity :
}
if
(
isConnectSuccess
)
{
writeAgoraLog
(
"已接通:主叫主动挂断"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"已接通:主叫主动挂断"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"已接通:主叫主动挂断"
)
updateExpertStatus
(
false
,
1
)
leaveChannel
()
uploadLog
()
...
...
@@ -644,8 +645,8 @@ class AudioHomeActivity :
when
{
permission
.
granted
->
{
writeAgoraLog
(
"请求音频权限通过"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"请求音频权限通过"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"请求音频权限通过"
)
init
()
}
permission
.
shouldShowRequestPermissionRationale
->
{
...
...
@@ -655,8 +656,8 @@ class AudioHomeActivity :
// 拒绝权限操作发送给服务端
uploadException
(
"AudioNotAuth"
,
"zhu"
,
YDLavManager
.
AUDIO_NO_AUTH_ERROR_CODE
,
null
)
writeAgoraLog
(
"拒绝请求音频权限"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"拒绝请求音频权限"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"拒绝请求音频权限"
)
uploadLog
()
ToastHelper
.
show
(
getString
(
R
.
string
.
audioim_need_storage_permission_hint
))
...
...
@@ -719,8 +720,8 @@ class AudioHomeActivity :
//关闭音乐
stopPlaying
()
writeAgoraLog
(
"未接通挂断:50s等待倒计时结束挂断"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"未接通挂断:50s等待倒计时结束挂断"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"未接通挂断:50s等待倒计时结束挂断"
)
//提示切换传统线路
//发送消息通知专家用户已挂断
YDLavManager
.
instances
.
cancelCall
(
...
...
@@ -729,8 +730,8 @@ class AudioHomeActivity :
sendDoctocrMsg
!!
)
{
msg
,
code
->
writeAgoraLog
(
"未接听时:主叫(用户)主动挂断失败,msg=$msg($code),再次挂断"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"未接听时:主叫(用户)主动挂断失败,msg=$msg($code),再次挂断"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"未接听时:主叫(用户)主动挂断失败,msg=$msg($code),再次挂断"
)
}
//通话结束或挂断时,上传日志文件
uploadLog
()
...
...
@@ -766,8 +767,8 @@ class AudioHomeActivity :
*/
fun
joinChannel
()
{
writeAgoraLog
(
"对方(专家)接受了通话邀请,主叫(用户)开始加入频道:$channelId"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"对方(专家)接受了通话邀请,主叫(用户)开始加入频道:$channelId"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"对方(专家)接受了通话邀请,主叫(用户)开始加入频道:$channelId"
)
voiceManage
!!
.
getVoiceApi
().
joinChannel
(
token
!!
,
channelId
!!
,
...
...
@@ -783,8 +784,8 @@ class AudioHomeActivity :
*/
private
fun
userCloseCalling
()
{
writeAgoraLog
(
"未接听时:主叫(用户)主动挂断,取消呼叫"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"未接听时:主叫(用户)主动挂断,取消呼叫"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"未接听时:主叫(用户)主动挂断,取消呼叫"
)
LogUtil
.
e
(
"未接听挂断"
)
//发送消息通知专家用户已挂断
YDLavManager
.
instances
.
cancelCall
(
...
...
@@ -793,8 +794,8 @@ class AudioHomeActivity :
sendDoctocrMsg
!!
)
{
msg
,
code
->
writeAgoraLog
(
"未接听时:主叫(用户)主动挂断失败,msg=$msg($code),再次挂断"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"未接听时:主叫(用户)主动挂断失败,msg=$msg($code),再次挂断"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"未接听时:主叫(用户)主动挂断失败,msg=$msg($code),再次挂断"
)
}
//通话结束或挂断时,上传日志文件
uploadLog
()
...
...
@@ -840,8 +841,8 @@ class AudioHomeActivity :
val
dialog
=
AxbConfirmDialog
(
mContext
,
type
,
object
:
AxbConfirmDialog
.
OnClickEnsureListener
{
override
fun
onClickEnsure
()
{
writeAgoraLog
(
"主叫点击切换AXB按钮"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"主叫点击切换AXB按钮"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"主叫点击切换AXB按钮"
)
switchAXB
()
}
...
...
@@ -864,8 +865,8 @@ class AudioHomeActivity :
uploadException
(
""
,
"zhu"
,
"108"
,
object
:
YDLavManager
.
UploadExceptionCallback
{
override
fun
onSuccess
()
{
writeAgoraLog
(
"离开房间成功,主叫切换AXB之后"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"离开房间成功,主叫切换AXB之后"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"离开房间成功,主叫切换AXB之后"
)
mPresenter
.
getAXBPhone
(
ConnectCommand
(
listenId
!!
,
"1"
))
}
...
...
@@ -899,8 +900,8 @@ class AudioHomeActivity :
sendDoctocrMsg
!!
)
{
msg
,
code
->
writeAgoraLog
(
"未接听时:主叫主动挂断失败,msg=$msg($code),再次挂断"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"未接听时:主叫主动挂断失败,msg=$msg($code),再次挂断"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"未接听时:主叫主动挂断失败,msg=$msg($code),再次挂断"
)
}
leaveChannel
()
}
...
...
m-audioim/src/main/java/com/ydl/audioim/YDLavManager.kt
View file @
018badf8
...
...
@@ -25,9 +25,9 @@ import com.ydl.ydl_av.messge_service.response.CallRemoteResponse
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.utils.ActivityManager
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import
com.ydl.ydlcommon.utils.log.LogHelper
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.im.api.bean.IMRegisterObserverCustomNotificationCallBack
import
com.yidianling.im.api.bean.IMSendCustomNotificationResultCallBack
...
...
@@ -92,7 +92,7 @@ class YDLavManager {
override
fun
onCallRecivedByPeer
(
response
:
CallLocalResponse
?)
{
//返回给主叫:被叫已收到呼叫邀请
LogUtil
.
e
(
"[agora]${response?.calleeId}已收到呼叫邀请,频道号${response?.ChannelId}"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"${response?.calleeId}已收到呼叫邀请,频道号${response?.ChannelId}"
)
...
...
@@ -109,7 +109,7 @@ class YDLavManager {
override
fun
onCallAccepted
(
response
:
CallLocalResponse
?,
msg
:
String
?)
{
//返回给主叫
LogUtil
.
e
(
"[agora]${response?.calleeId}已接收呼叫邀请"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"${response?.calleeId}已接收呼叫邀请"
)
...
...
@@ -125,7 +125,7 @@ class YDLavManager {
override
fun
onCallRefused
(
response
:
CallLocalResponse
?,
msg
:
String
?)
{
//返回给主叫
LogUtil
.
e
(
"[agora]${response?.calleeId}已拒绝呼叫邀请"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"${response?.calleeId}已拒绝呼叫邀请"
)
...
...
@@ -146,7 +146,7 @@ class YDLavManager {
override
fun
onCallCanceled
(
response
:
CallLocalResponse
?)
{
//返回给主叫
LogUtil
.
e
(
"[agora]主叫已取消呼叫邀请"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"主叫已取消呼叫邀请"
)
...
...
@@ -162,7 +162,7 @@ class YDLavManager {
override
fun
onCallFailure
(
response
:
CallLocalResponse
?,
errorCode
:
Int
)
{
//返回给主叫
LogUtil
.
e
(
"[agora]呼叫${response?.calleeId}用户失败:${response?.response}"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"呼叫${response?.calleeId}用户失败:${response?.response}"
)
...
...
@@ -193,7 +193,7 @@ class YDLavManager {
override
fun
onRemoteInvitationReceived
(
response
:
CallRemoteResponse
?)
{
//返回给被叫
LogUtil
.
e
(
"[agora]收到来自${response?.callerId}的呼叫邀请"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"收到来自${response?.callerId}的呼叫邀请"
)
...
...
@@ -203,7 +203,7 @@ class YDLavManager {
override
fun
onRemoteInvitationAccepted
(
response
:
CallRemoteResponse
?)
{
//返回给被叫
LogUtil
.
e
(
"[agora]接受来自${response?.callerId}的呼叫成功"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"接受来自${response?.callerId}的呼叫成功"
)
...
...
@@ -212,7 +212,7 @@ class YDLavManager {
override
fun
onRemoteInvitationRefused
(
response
:
CallRemoteResponse
?)
{
//返回给被叫
LogUtil
.
e
(
"[agora]已拒绝来自${response?.callerId}的呼叫"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"已拒绝来自${response?.callerId}的呼叫"
)
...
...
@@ -226,7 +226,7 @@ class YDLavManager {
callEndStatusUpdate
(
response
?.
ChannelId
!!
,
1
,
"主叫取消呼叫"
)
//返回给被叫
LogUtil
.
e
(
"[agora]主叫${response?.callerId}已取消呼叫邀请"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"主叫${response?.callerId}已取消呼叫邀请"
)
...
...
@@ -247,7 +247,7 @@ class YDLavManager {
//返回给被叫
LogUtil
.
e
(
"[agora]来自主叫${response?.callerId}的呼叫邀请进程失败:${response?.response}"
)
if
(
errorCode
==
RtmStatusCode
.
RemoteInvitationError
.
REMOTE_INVITATION_ERR_INVITATION_EXPIRE
)
{
//呼叫邀请过期
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"呼叫邀请被取消:用户未接听"
)
...
...
@@ -263,7 +263,7 @@ class YDLavManager {
writeAgoraLog
(
"呼叫邀请被取消:错误原因(${errorCode})"
,
FILE_NAME
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"呼叫邀请被取消:错误原因(${errorCode})"
)
...
...
@@ -281,7 +281,7 @@ class YDLavManager {
"confide.log"
,
true
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"声网发送通话邀请成功"
)
...
...
@@ -294,7 +294,7 @@ class YDLavManager {
}
", "
confide
.
log
", true
)
LogHelper
.
getInstance
().
uploadLog
(
false
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"声网发送通话邀请失败${error}"
)
...
...
@@ -410,7 +410,7 @@ class YDLavManager {
override
fun
onException
(
throwable
:
Throwable
)
{
// writeAgoraLog("云信发送通话邀请异常${throwable.message}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}", "confide.log", true)
// LogHelper.getInstance().uploadLog(false)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"云信发送通话邀请异常${throwable.message}"
)
...
...
@@ -419,7 +419,7 @@ class YDLavManager {
override
fun
onFailed
(
code
:
Int
)
{
// writeAgoraLog("云信发送通话邀请失败${code}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}", "confide.log", true)
// LogHelper.getInstance().uploadLog(false)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"云信发送通话邀请失败${code}"
)
...
...
@@ -431,7 +431,7 @@ class YDLavManager {
"confide.log"
,
true
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"云信发送通话邀请成功"
)
...
...
@@ -451,7 +451,7 @@ class YDLavManager {
if
(
TextUtils
.
isEmpty
(
userId
)
||
userId
?:
"0"
<=
"0"
)
{
//如果uid为空或小于等于0 ,则不进行登录,因为uid为0也会登录成功,会导致后面uid正确时无法登录
LogUtil
.
e
(
"[agora]login-uid:$userId"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
AGORA
,
"uid为空或小于等于0 ,则不进行登录 login-uid:$userId"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"uid为空或小于等于0 ,则不进行登录 login-uid:$userId"
)
return
}
isOnlineRtm
=
true
...
...
@@ -467,8 +467,8 @@ class YDLavManager {
override
fun
onSuccess
()
{
//登陆成功,发起呼叫
LogUtil
.
e
(
"[agora]实时消息登录成功"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"声网rtm登录成功,uid:$userId"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"声网rtm登录成功,uid:$userId"
)
writeAgoraLog
(
"声网rtm登录成功,uid:$userId-------Time:${
AudioLogUtils
.
format
.
format
(
...
...
@@ -488,8 +488,8 @@ class YDLavManager {
)
}
", "
confide
.
log
", true
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"声网rtm登录失败:$msg"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"声网rtm登录失败:$msg"
)
event
(
false
,
msg
)
}
...
...
@@ -498,7 +498,7 @@ class YDLavManager {
LogUtil
.
e
(
"声网token获取失败uid:"
+
userId
+
" error:"
+
it
.
msg
)
LogHelper
.
getInstance
()
.
writeLogSync
(
"声网token获取失败uid:"
+
userId
+
" error:"
+
it
.
msg
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"声网token获取失败uid"
+
userId
+
" error:"
+
it
.
msg
)
...
...
@@ -506,7 +506,7 @@ class YDLavManager {
}
},
{
LogUtil
.
e
(
"声网token获取异常uid:"
+
userId
+
" error:"
+
it
.
message
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"声网token获取异常uid:"
+
userId
+
" error:"
+
it
.
message
)
...
...
@@ -536,8 +536,8 @@ class YDLavManager {
)
}
", FILE_NAME, false
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"收到主叫方通话邀请($from)"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"收到主叫方通话邀请($from)"
)
LogHelper
.
getInstance
().
uploadLog
(
false
)
//邀请加入频道消息,跳转通话界面
...
...
@@ -554,8 +554,8 @@ class YDLavManager {
}
", FILE_NAME, false
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"收到主叫方通话邀请,但界面实例已存在($from)"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"收到主叫方通话邀请,但界面实例已存在($from)"
)
LogHelper
.
getInstance
().
uploadLog
(
false
)
}
}
else
{
...
...
@@ -567,8 +567,8 @@ class YDLavManager {
)
}
", FILE_NAME, false
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"收到主叫方通话邀请,但response==null($from)"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"收到主叫方通话邀请,但response==null($from)"
)
LogHelper
.
getInstance
().
uploadLog
(
false
)
}
}
...
...
@@ -605,8 +605,8 @@ class YDLavManager {
override
fun
onSuccess
()
{
//退出登陆成功
LogUtil
.
d
(
"[agora]实时消息退出成功"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"实时消息退出成功"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"实时消息退出成功"
)
if
(
isReLogin
)
{
login
(
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
).
getUserInfo
()
?.
uid
...
...
@@ -616,8 +616,8 @@ class YDLavManager {
override
fun
onFailure
(
msg
:
String
?)
{
LogUtil
.
d
(
"[agora]实时消息退出失败:$msg"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"实时消息退出失败:$msg"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"实时消息退出失败:$msg"
)
}
})
}
...
...
@@ -643,8 +643,8 @@ class YDLavManager {
callback
?.
onSuccess
()
},
{
LogUtil
.
e
(
"agora"
,
"声网上传异常与错误日志接口调用失败:"
+
it
.
message
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"声网上传异常与错误日志接口调用失败: + ${it.message}"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"声网上传异常与错误日志接口调用失败: + ${it.message}"
)
})
}
...
...
@@ -665,8 +665,8 @@ class YDLavManager {
},
{
LogUtil
.
d
(
"callEndStatusUpdate error: ${it.message}"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"callEndStatusUpdate error: ${it.message}"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"callEndStatusUpdate error: ${it.message}"
)
})
}
...
...
@@ -676,8 +676,8 @@ class YDLavManager {
private
val
listener
=
object
:
InitListener
{
override
fun
onTokenExpired
()
{
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"onTokenExpired"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"onTokenExpired"
)
LogUtil
.
e
(
"[agora]onTokenExpired"
)
instances
.
login
(
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
).
getUserInfo
()
?.
uid
...
...
@@ -686,8 +686,8 @@ class YDLavManager {
override
fun
onMessageReceived
(
message
:
RTMMesssage
,
userId
:
Int
)
{
LogUtil
.
i
(
"[agora]onMessageReceived:${message.text} -->uid:$userId"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"onMessageReceived:${message.text} -->uid:$userId"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"onMessageReceived:${message.text} -->uid:$userId"
)
}
override
fun
onConnectionStateChanged
(
state
:
Int
,
reason
:
Int
)
{
...
...
@@ -698,8 +698,8 @@ class YDLavManager {
true
)
LogUtil
.
i
(
"[agora]onConnectionStateChanged:state:${state} -->reason:$reason"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"声网rtm登录状态:${state}"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"声网rtm登录状态:${state}"
)
/*
* 当reason=CONNECTION_CHANGE_REASON_REMOTE_LOGIN的时候,是远端用户以相同UID登录RTM
* 如果正在通话中,则不进行退出操作
...
...
m-audioim/src/main/java/com/ydl/consultantim/ConsultantAudioHomeActivity.kt
View file @
018badf8
...
...
@@ -47,10 +47,10 @@ import com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.Utils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import
com.ydl.ydlcommon.utils.log.LogHelper
import
com.ydl.ydlcommon.utils.remind.ToastHelper
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
import
com.yidianling.user.api.service.IUserService
import
de.greenrobot.event.EventBus
import
io.agora.rtc.Constants
...
...
@@ -139,7 +139,7 @@ class ConsultantAudioHomeActivity :
super
.
onJoinChannelSuccess
(
channel
,
uid
,
elapsed
)
LogUtil
.
e
(
"[agora]$uid 加入频道回调"
)
writeAgoraLog
(
"被叫(用户)加入声网($channel)频道成功"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
AGORA
,
"被叫(用户)加入声网($channel)频道成功"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"被叫(用户)加入声网($channel)频道成功"
)
runOnUiThread
{
// 加入频道后再通知用户已接受
// YDLRTMClient.instances.acceptCall(mAudioMessageBean?.channelId)
...
...
@@ -167,8 +167,8 @@ class ConsultantAudioHomeActivity :
super
.
onRejoinChannelSuccess
(
channel
,
uid
,
elapsed
)
LogUtil
.
e
(
"[agora]$uid 重新加入频道回调"
)
writeAgoraLog
(
"被叫(用户)重新加入声网频道($channel)成功"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"被叫(用户)重新加入声网频道($channel)成功"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"被叫(用户)重新加入声网频道($channel)成功"
)
runOnUiThread
{
if
(!
isConnectSuccess
)
{
...
...
@@ -187,7 +187,7 @@ class ConsultantAudioHomeActivity :
super
.
onUserJoined
(
uid
,
elapsed
)
LogUtil
.
e
(
"[agora]远端用户加入频道回调"
)
writeAgoraLog
(
"主叫(专家)加入声网频道成功"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
AGORA
,
"主叫(专家)加入声网频道成功"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"主叫(专家)加入声网频道成功"
)
//另一方加入频道成功
runOnUiThread
{
...
...
@@ -230,7 +230,7 @@ class ConsultantAudioHomeActivity :
override
fun
onLeaveChannel
(
stats
:
IRtcEngineEventHandler
.
RtcStats
?)
{
super
.
onLeaveChannel
(
stats
)
LogUtil
.
e
(
"[agora]自己离开频道回调"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
AGORA
,
"自己离开频道回调"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"自己离开频道回调"
)
//通知php 通话已结束
close
(
RESULT_ANSWERED_CODE
,
""
)
...
...
@@ -258,7 +258,7 @@ class ConsultantAudioHomeActivity :
)
showToast
(
"对方已挂断"
)
writeAgoraLog
(
"通话接通后挂断:主叫(专家)离开频道"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
AGORA
,
"通话接通后挂断:主叫(专家)离开频道"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"通话接通后挂断:主叫(专家)离开频道"
)
if
(
null
!=
totalDisposable
)
{
totalDisposable
!!
.
dispose
()
...
...
@@ -276,7 +276,7 @@ class ConsultantAudioHomeActivity :
}
LogUtil
.
e
(
"[agora]发生警告回调=$warn"
)
writeAgoraLog
(
"声网警告回调码:($warn)"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
AGORA
,
"声网警告回调码:($warn)"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"声网警告回调码:($warn)"
)
//103:没有可用的频道资源。可能是因为服务端没法分配频道资源
//104:查找频道超时。在加入频道时 SDK 先要查找指定的频道,出现该警告一般是因为网络太差,连接不到服务器
...
...
@@ -303,7 +303,7 @@ class ConsultantAudioHomeActivity :
uploadException
(
"mRtcEventHandler-onError:errorCode--%${err}"
)
LogUtil
.
e
(
"[agora] 发生错误回调 =$err"
)
writeAgoraLog
(
"声网错误回调errorCode--%${err}"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
AGORA
,
"声网错误回调errorCode--%${err}"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"声网错误回调errorCode--%${err}"
)
//3:SDK 初始化失败。Agora 建议尝试以下处理方法
//7:SDK 尚未初始化,就调用其 API。请确认在调用 API 之前已创建 RtcEngine 对象并完成初始化
...
...
@@ -524,7 +524,7 @@ class ConsultantAudioHomeActivity :
override
fun
channelTokenResponse
(
token
:
String
?,
needJoinChannel
:
Boolean
)
{
if
(
TextUtils
.
isEmpty
(
token
))
{
LogUtil
.
e
(
"[agora]token not null"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
AGORA
,
"token isEmpty "
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"token isEmpty "
)
showToast
(
"通话频道不存在"
)
finish
()
...
...
@@ -599,7 +599,7 @@ class ConsultantAudioHomeActivity :
val
account
=
YdlCommonRouterManager
.
getYdlCommonRoute
().
getUid
()
if
(!
TextUtils
.
isEmpty
(
mAudioMessageBean
?.
channelId
))
{
LogUtil
.
e
(
"[agora] joinChannel:$account"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
AGORA
,
"joinChannel:$account"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"joinChannel:$account"
)
voiceManage
?.
getVoiceApi
()
?.
joinChannel
(
channelToken
...
...
@@ -825,8 +825,8 @@ class ConsultantAudioHomeActivity :
fun
close
(
code
:
Int
,
msg
:
String
)
{
runOnUiThread
{
LogUtil
.
e
(
"[agora]close(code:$code,msg:$msg)"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
AGORA
,
"close(code:$code,msg:$msg)"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
AGORA
,
"close(code:$code,msg:$msg)"
)
//上传日志文件
uploadLog
()
...
...
@@ -858,7 +858,7 @@ class ConsultantAudioHomeActivity :
}
ActivityManager
.
getInstance
().
removeStack
(
activity
=
this
)
LogUtil
.
e
(
"[agora]页面移除"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
AGORA
,
"页面移除"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
AGORA
,
"页面移除"
)
finish
()
}
}
...
...
m-im/src/main/java/com/yidianling/avchatkit/AVChatKit.java
View file @
018badf8
...
...
@@ -10,8 +10,8 @@ import com.netease.nimlib.sdk.avchat.AVChatManager;
import
com.netease.nimlib.sdk.avchat.constant.AVChatControlCommand
;
import
com.netease.nimlib.sdk.avchat.model.AVChatData
;
import
com.ydl.ydlcommon.base.BaseActivityMgr
;
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
;
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
;
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
;
import
com.yidianling.avchatkit.activity.AVChatActivity
;
import
com.yidianling.avchatkit.common.log.ILogUtil
;
import
com.yidianling.avchatkit.common.log.LogUtil
;
...
...
@@ -151,7 +151,7 @@ public class AVChatKit {
*/
public
static
void
outgoingCall
(
Context
context
,
String
account
,
String
displayName
,
int
callType
,
int
source
)
{
AVChatActivity
.
outgoingCall
(
context
,
account
,
displayName
,
callType
,
source
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"outgoingCall 发起音视频通话呼叫"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"outgoingCall 发起音视频通话呼叫"
);
}
...
...
@@ -166,7 +166,7 @@ public class AVChatKit {
*/
public
static
void
outgoingTeamCall
(
Context
context
,
boolean
receivedCall
,
String
teamId
,
String
roomId
,
ArrayList
<
String
>
accounts
,
String
teamName
)
{
TeamAVChatActivity
.
startActivity
(
context
,
receivedCall
,
teamId
,
roomId
,
accounts
,
teamName
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"outgoingTeamCall 发起群组音视频通话呼叫"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"outgoingTeamCall 发起群组音视频通话呼叫"
);
}
/**
...
...
m-im/src/main/java/com/yidianling/avchatkit/activity/AVChatActivity.java
View file @
018badf8
...
...
@@ -26,8 +26,8 @@ import com.netease.nimlib.sdk.avchat.model.AVChatData;
import
com.netease.nimlib.sdk.avchat.model.AVChatOnlineAckEvent
;
import
com.netease.nimlib.sdk.avchat.model.AVChatVideoFrame
;
import
com.tbruyelle.rxpermissions2.RxPermissions
;
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
;
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
;
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
;
import
com.yidianling.avchatkit.AVChatKit
;
import
com.yidianling.avchatkit.AVChatProfile
;
import
com.yidianling.avchatkit.common.activity.AVChatBaseUI
;
...
...
@@ -349,15 +349,15 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
public
void
onJoinedChannel
(
int
code
,
String
audioFile
,
String
videoFile
,
int
i
)
{
LogUtil
.
d
(
TAG
,
"audioFile -> "
+
audioFile
+
" videoFile -> "
+
videoFile
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"audioFile -> "
+
audioFile
+
" videoFile -> "
+
videoFile
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"audioFile -> "
+
audioFile
+
" videoFile -> "
+
videoFile
);
handleWithConnectServerResult
(
code
);
}
@Override
public
void
onUserJoined
(
String
account
)
{
LogUtil
.
d
(
TAG
,
"onUserJoin -> "
+
account
);
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"onUserJoin -> "
+
account
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"onUserJoin -> "
+
account
);
if
(
state
==
AVChatType
.
VIDEO
.
getValue
())
{
avChatVideoUI
.
initLargeSurfaceView
(
account
);
...
...
@@ -368,8 +368,8 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
public
void
onUserLeave
(
String
account
,
int
event
)
{
LogUtil
.
d
(
TAG
,
"onUserLeave -> "
+
account
);
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"onUserLeave -> "
+
account
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"onUserLeave -> "
+
account
);
manualHangUp
(
AVChatExitCode
.
HANGUP
);
finish
();
}
...
...
@@ -378,8 +378,8 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
public
void
onCallEstablished
()
{
LogUtil
.
d
(
TAG
,
"onCallEstablished"
);
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"onCallEstablished"
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"onCallEstablished"
);
//移除超时监听
AVChatTimeoutObserver
.
getInstance
().
observeTimeoutNotification
(
timeoutObserver
,
false
,
mIsInComingCall
);
if
(
avChatController
.
getTimeBase
()
==
0
)
{
...
...
@@ -415,8 +415,8 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
avChatData
=
avChatController
.
getAvChatData
();
if
(
avChatData
!=
null
&&
avChatData
.
getChatId
()
==
avChatHangUpInfo
.
getChatId
())
{
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"callHangupObserver 通话过程中,收到对方挂断电话"
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"callHangupObserver 通话过程中,收到对方挂断电话"
);
hangUpByOther
(
AVChatExitCode
.
HANGUP
);
cancelCallingNotifier
();
// 如果是incoming call主叫方挂断,那么通知栏有通知
...
...
@@ -435,16 +435,16 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
AVChatData
info
=
avChatController
.
getAvChatData
();
if
(
info
!=
null
&&
info
.
getChatId
()
==
ackInfo
.
getChatId
())
{
if
(
ackInfo
.
getEvent
()
==
AVChatEventType
.
CALLEE_ACK_BUSY
)
{
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"callAckObserver 呼叫时,被叫方正在忙"
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"callAckObserver 呼叫时,被叫方正在忙"
);
hangUpByOther
(
AVChatExitCode
.
PEER_BUSY
);
}
else
if
(
ackInfo
.
getEvent
()
==
AVChatEventType
.
CALLEE_ACK_REJECT
)
{
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"callAckObserver 呼叫时,被叫方拒绝通话"
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"callAckObserver 呼叫时,被叫方拒绝通话"
);
hangUpByOther
(
AVChatExitCode
.
REJECT
);
}
else
if
(
ackInfo
.
getEvent
()
==
AVChatEventType
.
CALLEE_ACK_AGREE
)
{
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"callAckObserver 呼叫时,被叫方同意通话"
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"callAckObserver 呼叫时,被叫方同意通话"
);
AVChatSoundPlayer
.
instance
().
stop
();
avChatController
.
isCallEstablish
.
set
(
true
);
}
...
...
@@ -459,8 +459,8 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
// 来电超时,自己未接听
if
(
mIsInComingCall
)
{
activeMissCallNotifier
();
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"timeoutObserver 来电超时,自己未接听"
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"timeoutObserver 来电超时,自己未接听"
);
}
finish
();
}
...
...
@@ -481,39 +481,39 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
}
switch
(
notification
.
getControlCommand
())
{
case
AVChatControlCommand
.
SWITCH_AUDIO_TO_VIDEO
:
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"handleCallControl 音频切换到视频"
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"handleCallControl 音频切换到视频"
);
incomingAudioToVideo
();
break
;
case
AVChatControlCommand
.
SWITCH_AUDIO_TO_VIDEO_AGREE
:
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"handleCallControl 同意从音频切换到视频"
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"handleCallControl 同意从音频切换到视频"
);
// 对方同意切成视频啦
state
=
AVChatType
.
VIDEO
.
getValue
();
avChatVideoUI
.
onAudioToVideoAgree
(
notification
.
getAccount
());
break
;
case
AVChatControlCommand
.
SWITCH_AUDIO_TO_VIDEO_REJECT
:
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"handleCallControl 拒绝从音频切换到视频"
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"handleCallControl 拒绝从音频切换到视频"
);
rejectAudioToVideo
();
ToastUtil
.
toastShort
(
AVChatActivity
.
this
,
R
.
string
.
im_avchat_switch_video_reject
);
break
;
case
AVChatControlCommand
.
SWITCH_VIDEO_TO_AUDIO
:
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"handleCallControl 视频切换到音频"
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"handleCallControl 视频切换到音频"
);
onVideoToAudio
();
break
;
case
AVChatControlCommand
.
NOTIFY_VIDEO_OFF
:
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"handleCallControl 通知对方自己关闭了视频"
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"handleCallControl 通知对方自己关闭了视频"
);
// 收到对方关闭画面通知
if
(
state
==
AVChatType
.
VIDEO
.
getValue
())
{
avChatVideoUI
.
peerVideoOff
();
}
break
;
case
AVChatControlCommand
.
NOTIFY_VIDEO_ON
:
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"handleCallControl 通知对方自己打开了视频"
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"handleCallControl 通知对方自己打开了视频"
);
// 收到对方打开画面通知
if
(
state
==
AVChatType
.
VIDEO
.
getValue
())
{
avChatVideoUI
.
peerVideoOn
();
...
...
@@ -533,24 +533,24 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
protected
void
handleWithConnectServerResult
(
int
auth_result
)
{
LogUtil
.
i
(
TAG
,
"result code->"
+
auth_result
);
if
(
auth_result
==
200
)
{
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"handleWithConnectServerResult onConnectServer success"
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"handleWithConnectServerResult onConnectServer success"
);
LogUtil
.
d
(
TAG
,
"onConnectServer success"
);
}
else
if
(
auth_result
==
101
)
{
// 连接超时
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"handleWithConnectServerResult 连接超时 101"
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"handleWithConnectServerResult 连接超时 101"
);
avChatController
.
showQuitToast
(
AVChatExitCode
.
PEER_NO_RESPONSE
);
}
else
if
(
auth_result
==
401
)
{
// 验证失败
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"handleWithConnectServerResult 验证失败 401"
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"handleWithConnectServerResult 验证失败 401"
);
avChatController
.
showQuitToast
(
AVChatExitCode
.
CONFIG_ERROR
);
}
else
if
(
auth_result
==
417
)
{
// 无效的channelId
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"handleWithConnectServerResult 无效的channelId 417"
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"handleWithConnectServerResult 无效的channelId 417"
);
avChatController
.
showQuitToast
(
AVChatExitCode
.
INVALIDE_CHANNELID
);
}
else
{
// 连接服务器错误,直接退出
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"handleWithConnectServerResult 连接服务器错误"
+
auth_result
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"handleWithConnectServerResult 连接服务器错误"
+
auth_result
);
avChatController
.
showQuitToast
(
AVChatExitCode
.
CONFIG_ERROR
);
}
}
...
...
@@ -592,8 +592,8 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
if
(
client
!=
null
)
{
String
option
=
ackInfo
.
getEvent
()
==
AVChatEventType
.
CALLEE_ONLINE_CLIENT_ACK_AGREE
?
"接听!"
:
"拒绝!"
;
ToastUtil
.
toastShort
(
AVChatActivity
.
this
,
"通话已在"
+
client
+
"端被"
+
option
);
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"onlineAckObserver 通话已在"
+
client
+
"端被"
+
option
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"onlineAckObserver 通话已在"
+
client
+
"端被"
+
option
);
}
finish
();
}
...
...
@@ -656,8 +656,8 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
@Override
public
void
onReceiveAudioToVideoAgree
()
{
// 同意切换为视频
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"onReceiveAudioToVideoAgree 同意切换为视频"
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"onReceiveAudioToVideoAgree 同意切换为视频"
);
state
=
AVChatType
.
VIDEO
.
getValue
();
audioRoot
.
setVisibility
(
View
.
GONE
);
videoRoot
.
setVisibility
(
View
.
VISIBLE
);
...
...
@@ -714,16 +714,16 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
// 主动挂断
private
void
manualHangUp
(
int
exitCode
)
{
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"manualHangUp 主动挂断"
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"manualHangUp 主动挂断"
);
releaseVideo
();
avChatController
.
hangUp
(
exitCode
);
}
// 被对方挂断
private
void
hangUpByOther
(
int
exitCode
)
{
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"hangUpByOther 被对方挂断 exitCode:"
+
exitCode
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
YUNXIN
,
"hangUpByOther 被对方挂断 exitCode:"
+
exitCode
);
if
(
exitCode
==
AVChatExitCode
.
PEER_BUSY
)
{
avChatController
.
hangUp
(
AVChatExitCode
.
HANGUP
);
finish
();
...
...
m-im/src/main/java/com/yidianling/avchatkit/common/util/NetworkUtil.java
View file @
018badf8
...
...
@@ -11,8 +11,8 @@ import android.os.Build;
import
android.telephony.TelephonyManager
;
import
android.text.TextUtils
;
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
;
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
;
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
;
import
com.yidianling.avchatkit.common.log.LogUtil
;
public
class
NetworkUtil
{
...
...
@@ -148,7 +148,7 @@ public class NetworkUtil {
}
}
curNetworkType
=
type
;
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
NETSTATUS
,
"网络类型:"
+
type
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
NETSTATUS
,
"网络类型:"
+
type
);
return
type
;
}
...
...
@@ -274,10 +274,10 @@ public class NetworkUtil {
NetworkInfo
ni
=
cm
.
getActiveNetworkInfo
();
if
(
ni
!=
null
)
{
if
(
ni
.
getType
()
==
ConnectivityManager
.
TYPE_WIFI
)
{
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
NETSTATUS
,
"网络类型:TYPE_WIFI"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
NETSTATUS
,
"网络类型:TYPE_WIFI"
);
return
true
;
}
else
{
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
NETSTATUS
,
"网络类型:非WIFI环境"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
NETSTATUS
,
"网络类型:非WIFI环境"
);
return
false
;
}
...
...
m-im/src/main/java/com/yidianling/avchatkit/controll/AVChatController.java
View file @
018badf8
...
...
@@ -15,8 +15,8 @@ import com.netease.nimlib.sdk.avchat.model.AVChatNotifyOption;
import
com.netease.nimlib.sdk.avchat.model.AVChatParameters
;
import
com.netease.nimlib.sdk.avchat.video.AVChatCameraCapturer
;
import
com.netease.nimlib.sdk.avchat.video.AVChatVideoCapturerFactory
;
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
;
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
;
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
;
import
com.yidianling.avchatkit.AVChatKit
;
import
com.yidianling.avchatkit.common.log.LogUtil
;
import
com.yidianling.avchatkit.common.widgets.MultiSelectDialog
;
...
...
@@ -76,7 +76,7 @@ public class AVChatController {
* 恢复视频和语音发送
*/
public
void
resumeVideo
()
{
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"恢复视频和语音发送"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"恢复视频和语音发送"
);
if
(
needRestoreLocalVideo
)
{
AVChatManager
.
getInstance
().
muteLocalVideo
(
false
);
needRestoreLocalVideo
=
false
;
...
...
@@ -93,7 +93,7 @@ public class AVChatController {
* 关闭视频和语音发送.
*/
public
void
pauseVideo
()
{
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"关闭视频和语音发送"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"关闭视频和语音发送"
);
if
(!
AVChatManager
.
getInstance
().
isLocalVideoMuted
())
{
AVChatManager
.
getInstance
().
muteLocalVideo
(
true
);
needRestoreLocalVideo
=
true
;
...
...
@@ -144,10 +144,10 @@ public class AVChatController {
if
(
code
==
ResponseCode
.
RES_FORBIDDEN
)
{
ToastUtil
.
toastShort
(
context
,
R
.
string
.
im_avchat_no_permission
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"onFailed 暂无权限,请开通音视频服务 code:"
+
code
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"onFailed 暂无权限,请开通音视频服务 code:"
+
code
);
}
else
{
ToastUtil
.
toastShort
(
context
,
R
.
string
.
im_avchat_call_failed
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"onFailed 发起通话失败 code:"
+
code
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"onFailed 发起通话失败 code:"
+
code
);
}
closeRtc
(
avChatType
==
AVChatType
.
VIDEO
?
CallStateEnum
.
VIDEO
:
CallStateEnum
.
AUDIO
);
callback
.
onFailed
(
code
,
""
);
...
...
@@ -156,7 +156,7 @@ public class AVChatController {
@Override
public
void
onException
(
Throwable
exception
)
{
LogUtil
.
d
(
TAG
,
"avChat call onException->"
+
exception
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"onException avChat call onException->"
+
exception
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"onException avChat call onException->"
+
exception
);
closeRtc
(
avChatType
==
AVChatType
.
VIDEO
?
CallStateEnum
.
VIDEO
:
CallStateEnum
.
AUDIO
);
callback
.
onFailed
(-
1
,
exception
.
toString
());
...
...
@@ -195,11 +195,11 @@ public class AVChatController {
public
void
onFailed
(
int
code
)
{
if
(
code
==
-
1
)
{
ToastUtil
.
toastShort
(
context
,
"本地音视频启动失败"
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"onFailed 本地音视频启动失败 code:"
+
code
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"onFailed 本地音视频启动失败 code:"
+
code
);
}
else
{
ToastUtil
.
toastShort
(
context
,
"建立连接失败"
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"onFailed 建立连接失败 code:"
+
code
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"onFailed 建立连接失败 code:"
+
code
);
}
LogUtil
.
e
(
TAG
,
"accept onFailed->"
+
code
);
...
...
@@ -211,7 +211,7 @@ public class AVChatController {
@Override
public
void
onException
(
Throwable
exception
)
{
LogUtil
.
d
(
TAG
,
"accept exception->"
+
exception
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"onException accept exception->"
+
exception
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"onException accept exception->"
+
exception
);
handleAcceptFailed
(
avChatType
==
AVChatType
.
VIDEO
?
CallStateEnum
.
VIDEO_CONNECTING
:
CallStateEnum
.
AUDIO
);
...
...
@@ -225,12 +225,12 @@ public class AVChatController {
if
(!
AVChatManager
.
getInstance
().
isLocalAudioMuted
())
{
// isMute是否处于静音状态
// 关闭音频
AVChatManager
.
getInstance
().
muteLocalAudio
(
true
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"toggleMute 关闭音频"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"toggleMute 关闭音频"
);
}
else
{
// 打开音频
AVChatManager
.
getInstance
().
muteLocalAudio
(
false
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"toggleMute 打开音频"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"toggleMute 打开音频"
);
}
}
...
...
@@ -245,7 +245,7 @@ public class AVChatController {
@Override
public
void
onSuccess
(
Void
aVoid
)
{
LogUtil
.
d
(
TAG
,
"videoSwitchAudio onSuccess"
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"switchVideoToAudio 发送视频切换为音频命令 onSuccess"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"switchVideoToAudio 发送视频切换为音频命令 onSuccess"
);
//关闭视频
AVChatManager
.
getInstance
().
stopVideoPreview
();
...
...
@@ -258,14 +258,14 @@ public class AVChatController {
@Override
public
void
onFailed
(
int
code
)
{
LogUtil
.
d
(
TAG
,
"videoSwitchAudio onFailed"
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"switchVideoToAudio 发送视频切换为音频命令 onFailed code:"
+
code
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"switchVideoToAudio 发送视频切换为音频命令 onFailed code:"
+
code
);
}
@Override
public
void
onException
(
Throwable
exception
)
{
LogUtil
.
d
(
TAG
,
"videoSwitchAudio onException"
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"switchVideoToAudio 发送视频切换为音频命令 onException exception:"
+
exception
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"switchVideoToAudio 发送视频切换为音频命令 onException exception:"
+
exception
);
}
});
...
...
@@ -277,7 +277,7 @@ public class AVChatController {
@Override
public
void
onSuccess
(
Void
aVoid
)
{
LogUtil
.
d
(
TAG
,
"requestSwitchToVideo onSuccess"
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"switchVideoToAudio 发送音频切换为视频命令 onSuccess"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"switchVideoToAudio 发送音频切换为视频命令 onSuccess"
);
avSwitchListener
.
onAudioToVideo
();
}
...
...
@@ -285,14 +285,14 @@ public class AVChatController {
@Override
public
void
onFailed
(
int
code
)
{
LogUtil
.
d
(
TAG
,
"requestSwitchToVideo onFailed"
+
code
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"switchVideoToAudio 发送音频切换为视频命令 onFailed:"
+
code
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"switchVideoToAudio 发送音频切换为视频命令 onFailed:"
+
code
);
}
@Override
public
void
onException
(
Throwable
exception
)
{
LogUtil
.
d
(
TAG
,
"requestSwitchToVideo onException"
+
exception
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"switchVideoToAudio 发送音频切换为视频命令 onException:"
+
exception
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"switchVideoToAudio 发送音频切换为视频命令 onException:"
+
exception
);
}
});
...
...
@@ -304,7 +304,7 @@ public class AVChatController {
@Override
public
void
onSuccess
(
Void
aVoid
)
{
LogUtil
.
d
(
TAG
,
"receiveAudioToVideo onSuccess"
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"switchVideoToAudio 发送同意从音频切换为视频的命令 onSuccess"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"switchVideoToAudio 发送同意从音频切换为视频的命令 onSuccess"
);
avSwitchListener
.
onReceiveAudioToVideoAgree
();
}
...
...
@@ -312,7 +312,7 @@ public class AVChatController {
@Override
public
void
onFailed
(
int
code
)
{
LogUtil
.
d
(
TAG
,
"receiveAudioToVideo onFailed"
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"switchVideoToAudio 发送同意从音频切换为视频的命令 onFailed:"
+
code
);
}
...
...
@@ -320,7 +320,7 @@ public class AVChatController {
@Override
public
void
onException
(
Throwable
exception
)
{
LogUtil
.
d
(
TAG
,
"receiveAudioToVideo onException"
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"switchVideoToAudio 发送同意从音频切换为视频的命令 exception:"
+
exception
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"switchVideoToAudio 发送同意从音频切换为视频的命令 exception:"
+
exception
);
}
});
...
...
@@ -468,39 +468,39 @@ public class AVChatController {
// 服务器返回数据错误
case
AVChatExitCode
.
CONFIG_ERROR
:
ToastUtil
.
toastShort
(
context
,
R
.
string
.
im_avchat_net_error_then_quit
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"网络异常,通话结束 网络切换4 网络异常8 服务器返回数据错误10 code:"
+
code
);
break
;
case
AVChatExitCode
.
REJECT
:
ToastUtil
.
toastShort
(
context
,
R
.
string
.
im_avchat_call_reject
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"被对方拒绝"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"被对方拒绝"
);
break
;
case
AVChatExitCode
.
PEER_HANGUP
:
case
AVChatExitCode
.
HANGUP
:
if
(
isCallEstablish
.
get
())
{
ToastUtil
.
toastShort
(
context
,
R
.
string
.
im_avchat_call_finish
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"通话结束"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"通话结束"
);
}
break
;
case
AVChatExitCode
.
PEER_BUSY
:
ToastUtil
.
toastShort
(
context
,
R
.
string
.
im_avchat_peer_busy
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"对方正在通话中,请稍后再拨。"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"对方正在通话中,请稍后再拨。"
);
break
;
case
AVChatExitCode
.
PROTOCOL_INCOMPATIBLE_PEER_LOWER
:
ToastUtil
.
toastShort
(
context
,
R
.
string
.
im_avchat_peer_protocol_low_version
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"对方版本过低,请提示对方升"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"对方版本过低,请提示对方升"
);
break
;
case
AVChatExitCode
.
PROTOCOL_INCOMPATIBLE_SELF_LOWER
:
ToastUtil
.
toastShort
(
context
,
R
.
string
.
im_avchat_local_protocol_low_version
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"版本过低,请升级后使用"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"版本过低,请升级后使用"
);
break
;
case
AVChatExitCode
.
INVALIDE_CHANNELID
:
ToastUtil
.
toastShort
(
context
,
R
.
string
.
im_avchat_invalid_channel_id
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"对方已挂断"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"对方已挂断"
);
break
;
case
AVChatExitCode
.
LOCAL_CALL_BUSY
:
ToastUtil
.
toastShort
(
context
,
R
.
string
.
im_avchat_local_call_busy
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"本地通话中,无法进行通话。"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"本地通话中,无法进行通话。"
);
break
;
default
:
break
;
...
...
m-im/src/main/java/com/yidianling/avchatkit/teamavchat/activity/TeamAVChatActivity.java
View file @
018badf8
...
...
@@ -35,8 +35,8 @@ import com.netease.nimlib.sdk.avchat.model.AVChatParameters;
import
com.netease.nimlib.sdk.avchat.video.AVChatCameraCapturer
;
import
com.netease.nimlib.sdk.avchat.video.AVChatVideoCapturerFactory
;
import
com.netease.nrtc.video.render.IVideoRender
;
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
;
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
;
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
;
import
com.yidianling.avchatkit.AVChatKit
;
import
com.yidianling.avchatkit.TeamAVChatProfile
;
import
com.yidianling.avchatkit.common.activity.AVChatBaseUI
;
...
...
@@ -438,7 +438,7 @@ public class TeamAVChatActivity extends AVChatBaseUI {
public
void
onSuccess
(
AVChatData
data
)
{
chatId
=
data
.
getChatId
();
LogUtil
.
i
(
TAG
,
"join room success, roomId="
+
roomId
+
", chatId="
+
chatId
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"join room success, roomId="
+
roomId
+
", chatId="
+
chatId
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"join room success, roomId="
+
roomId
+
", chatId="
+
chatId
);
}
@Override
...
...
@@ -461,16 +461,16 @@ public class TeamAVChatActivity extends AVChatBaseUI {
startLocalPreview
();
startTimerForCheckReceivedCall
();
LogUtil
.
i
(
TAG
,
"team avchat running..."
+
", roomId="
+
roomId
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"onJoinRoomSuccess 进入房间成功"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"onJoinRoomSuccess 进入房间成功"
);
}
private
void
onJoinRoomFailed
(
int
code
,
Throwable
e
)
{
if
(
code
==
ResponseCode
.
RES_ENONEXIST
)
{
showToast
(
getString
(
R
.
string
.
im_t_avchat_join_fail_not_exist
));
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"startRtc 进入房间失败 房间不存在 code:"
+
code
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"startRtc 进入房间失败 房间不存在 code:"
+
code
);
}
else
{
showToast
(
"join room failed, code="
+
code
+
", e="
+
(
e
==
null
?
""
:
e
.
getMessage
()));
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"join room failed, code="
+
code
+
", e="
+
(
e
==
null
?
""
:
e
.
getMessage
()));
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"join room failed, code="
+
code
+
", e="
+
(
e
==
null
?
""
:
e
.
getMessage
()));
}
}
...
...
@@ -490,7 +490,7 @@ public class TeamAVChatActivity extends AVChatBaseUI {
updateAudioMuteButtonState
();
LogUtil
.
i
(
TAG
,
"on user joined, account="
+
account
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"on user joined, account="
+
account
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"on user joined, account="
+
account
);
}
public
void
onAVChatUserLeave
(
String
account
)
{
...
...
@@ -504,7 +504,7 @@ public class TeamAVChatActivity extends AVChatBaseUI {
updateAudioMuteButtonState
();
LogUtil
.
i
(
TAG
,
"on user leave, account="
+
account
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"on user leave, account="
+
account
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"on user leave, account="
+
account
);
}
private
void
startLocalPreview
()
{
...
...
m-im/src/main/java/com/yidianling/im/helper/IMChatUtil.kt
View file @
018badf8
...
...
@@ -17,10 +17,10 @@ import com.ydl.ydlcommon.ui.LoadingDialogFragment
import
com.ydl.ydlcommon.ui.LoadingDialogFragment.Companion.newInstance
import
com.ydl.ydlcommon.utils.NetworkParamsUtils
import
com.ydl.ydlcommon.utils.UserInfoCache
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import
com.ydl.ydlcommon.utils.remind.HttpErrorUtils.Companion.handleError
import
com.ydl.ydlcommon.view.dialog.CommonDialog
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
import
com.ydl.ydlnet.utils.log.AliYunLogHelper.Companion.getInstance
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.im.R
...
...
@@ -196,7 +196,7 @@ object IMChatUtil {
isFromQingShu
:
Int
,
context
:
AppCompatActivity
)
{
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"startChatSession 开启聊天会话"
)
AliYunRichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"startChatSession 开启聊天会话"
)
val
p2PCustomActionHandlerImpl
=
P2PCustomActionHandlerImpl
(
toUid
,
expertInfo
)
p2PCustomActionHandlerImpl
.
isFromQingShu
=
isFromQingShu
SessionHelper
.
startP2PSession
(
...
...
m-im/src/main/java/com/yidianling/uikit/api/NimUIKit.java
View file @
018badf8
...
...
@@ -5,8 +5,8 @@ import android.content.Context;
import
com.netease.nimlib.sdk.msg.attachment.MsgAttachment
;
import
com.netease.nimlib.sdk.msg.constant.SessionTypeEnum
;
import
com.netease.nimlib.sdk.msg.model.IMMessage
;
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
;
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
;
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
;
import
com.yidianling.nimbase.api.BaseNimUIKit
;
import
com.yidianling.nimbase.api.model.session.SessionCustomization
;
import
com.yidianling.uikit.business.contact.selector.activity.ContactSelectActivity
;
...
...
@@ -32,7 +32,7 @@ public class NimUIKit extends BaseNimUIKit {
*/
public
static
void
startYDLChatting
(
Context
context
,
String
id
,
SessionTypeEnum
sessionType
,
SessionCustomization
customization
,
IMMessage
anchor
,
IP2PCustomActionHandler
handler
)
{
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"startYDLChatting 打开壹点灵定制聊天窗口,开始聊天"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"startYDLChatting 打开壹点灵定制聊天窗口,开始聊天"
);
NimUIKitImpl
.
startChatting
(
context
,
id
,
sessionType
,
customization
,
anchor
,
handler
);
}
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/activity/YDLP2PMessageActivity.java
View file @
018badf8
...
...
@@ -16,8 +16,8 @@ import com.netease.nimlib.sdk.msg.MsgServiceObserve;
import
com.netease.nimlib.sdk.msg.constant.SessionTypeEnum
;
import
com.netease.nimlib.sdk.msg.model.CustomNotification
;
import
com.netease.nimlib.sdk.msg.model.IMMessage
;
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
;
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
;
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.im.R
;
import
com.yidianling.im.api.bean.IMRegisterObserverCustomNotificationCallBack
;
...
...
@@ -151,7 +151,7 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
registerObservers
(
false
);
super
.
onDestroy
();
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
YUNXIN
,
"退出聊天页面"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
YUNXIN
,
"退出聊天页面"
);
}
@Override
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
View file @
018badf8
...
...
@@ -49,11 +49,11 @@ import com.ydl.ydlcommon.utils.LogUtil;
import
com.ydl.ydlcommon.utils.SharedPreferencesEditor
;
import
com.ydl.ydlcommon.utils.YdlBuryPointUtil
;
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
;
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
;
import
com.ydl.ydlcommon.utils.log.LogHelper
;
import
com.ydl.ydlcommon.view.CircleImageView
;
import
com.ydl.ydlcommon.view.dialog.CommonDialog
;
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
;
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.im.R
;
import
com.yidianling.im.helper.IMChatUtil
;
...
...
@@ -1184,14 +1184,14 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}
});
AliYun
LogHelper
.
Companion
.
getInstance
().
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"sendMessage 该消息发送成功"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
YUNXIN
,
"sendMessage 该消息发送成功 sessionId:"
+
sessionId
);
}
else
{
// 替换成tip
message
=
MessageBuilder
.
createTipMessage
(
message
.
getSessionId
(),
message
.
getSessionType
());
message
.
setContent
(
"该消息无法发送"
);
message
.
setStatus
(
MsgStatusEnum
.
success
);
NIMClient
.
getService
(
MsgService
.
class
).
saveMessageToLocal
(
message
,
false
);
AliYun
LogHelper
.
Companion
.
getInstance
().
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"sendMessage 该消息无法发送"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
YUNXIN
,
"sendMessage 该消息无法发送 sessionId:"
+
sessionId
);
}
messageListPanel
.
onMsgSend
(
message
);
...
...
@@ -1219,11 +1219,11 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
LogHelper
.
Companion
.
getInstance
().
writeLogSync
(
"发送消息失败:已被对方拉黑"
);
ToastUtil
.
toastLong
(
getActivity
(),
"您已被对方拉黑!"
);
AliYun
LogHelper
.
Companion
.
getInstance
().
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"sendFailWithBlackList 发送消息失败:已被对方拉黑"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
YUNXIN
,
"sendFailWithBlackList 发送消息失败:已被对方拉黑 sessionId:"
+
sessionId
);
}
else
if
(
code
==
404
)
{
LogHelper
.
Companion
.
getInstance
().
writeLogSync
(
"发送消息失败:对象不见了"
);
ToastUtil
.
toastLong
(
getActivity
(),
"对象不见了!"
);
AliYun
LogHelper
.
Companion
.
getInstance
().
sendLog
(
AliYunLogConfig
.
YUNXIN
,
"sendFailWithBlackList 发送消息失败:对象不见了 404"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
YUNXIN
,
"sendFailWithBlackList 发送消息失败:对象不见了 404 sessionId:"
+
sessionId
);
}
else
{
//上传至后台
...
...
m-user/src/main/java/com/yidianling/user/LoginUtils.kt
View file @
018badf8
...
...
@@ -6,8 +6,8 @@ import com.tencent.bugly.crashreport.CrashReport
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.utils.ActivityManager
import
com.ydl.ydlcommon.utils.BuryPointUtils
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.im.api.bean.IMLoginInfo
import
com.yidianling.im.api.bean.IMRequestCallback
...
...
@@ -61,19 +61,19 @@ object LoginUtils {
override
fun
onSuccess
(
t
:
IMLoginInfo
?)
{
LogUtil
.
e
(
"IM登录成功:"
+
"info.account:"
+
info
.
account
+
"info.passWord"
+
info
.
passWord
)
UserIn
.
imSetAccount
(
userInfo
?.
uid
?:
""
)
AliYunLogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
LOGIN
,
"IM登录成功"
)
AliYunRichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
LOGIN
,
"IM登录成功"
)
}
override
fun
onFailed
(
i
:
Int
)
{
LogUtil
.
e
(
"IM登录失败:$i"
+
"info.account:"
+
info
.
account
+
"info.passWord"
+
info
.
passWord
)
AliYunLogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
LOGIN
,
"IM登录失败"
)
AliYunRichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
LOGIN
,
"IM登录失败"
)
}
override
fun
onException
(
throwable
:
Throwable
?)
{
LogUtil
.
e
(
"IM登录onException:${throwable?.message}"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
LOGIN
,
"IM登录onException:${throwable?.message}"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
LOGIN
,
"IM登录onException:${throwable?.message}"
)
}
}
...
...
@@ -98,7 +98,7 @@ object LoginUtils {
@JvmStatic
fun
logoutClearLocal
()
{
AliYunLogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
LOGIN
,
"退出登录"
)
AliYunRichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
LOGIN
,
"退出登录"
)
UserIn
.
imLogout
()
UserIn
.
closePlayer
()
UserIn
.
clearImData
()
...
...
m-user/src/main/java/com/yidianling/user/ui/SmsLoginActivity.kt
View file @
018badf8
...
...
@@ -14,9 +14,9 @@ import com.ydl.ydlcommon.router.YdlCommonOut
import
com.ydl.ydlcommon.utils.ActivityManager
import
com.ydl.ydlcommon.utils.UserInfoCache
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import
com.ydl.ydlcommon.utils.remind.ToastHelper
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
import
com.yidianling.im.api.bean.IMLoginInfo
import
com.yidianling.im.api.bean.IMRequestCallback
import
com.yidianling.user.LoginUtils
...
...
@@ -171,14 +171,14 @@ class SmsLoginActivity : BaseActivity() {
// finish()
LoginUtils
.
loginSuccessOperate
(
this
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
LOGIN
,
"短信验证码 成功"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
LOGIN
,
"短信验证码 成功"
)
},
object
:
ThrowableConsumer
()
{
override
fun
accept
(
msg
:
String
)
{
dismissProgressDialog
()
YdlCommonOut
.
showToast
(
msg
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
LOGIN
,
"短信验证码 失败 msg:$msg "
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
LOGIN
,
"短信验证码 失败 msg:$msg "
)
}
})
}
...
...
m-user/src/main/java/com/yidianling/user/ui/login/OneKeyLoginHelp.kt
View file @
018badf8
...
...
@@ -26,9 +26,9 @@ import com.ydl.ydlcommon.utils.JPushUtils
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.YDLCacheUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import
com.ydl.ydlcommon.utils.log.LogHelper
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
import
com.yidianling.common.tools.RxAppTool
import
com.yidianling.common.tools.RxDeviceTool
import
com.yidianling.common.tools.RxImageTool
...
...
@@ -430,7 +430,7 @@ object OneKeyLoginHelp {
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
({
if
(
it
.
code
==
200
)
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
LOGIN
,
"一键登录成功"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
LOGIN
,
"一键登录成功"
)
ToastUtil
.
toastShort
(
"登录成功"
)
saveUserData
(
it
.
data
)
if
(
it
.
data
.
firstLogin
==
1
)
{
//第一次登录:是注册
...
...
@@ -464,12 +464,12 @@ object OneKeyLoginHelp {
LoginUtils
.
loginSuccessOperate
(
mActivity
)
}
}
else
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
LOGIN
,
"一键登录失败 msg:${it.msg}"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
LOGIN
,
"一键登录失败 msg:${it.msg}"
)
ToastUtil
.
toastShort
(
it
.
msg
)
mPhoneNumberAuthHelper
?.
hideLoginLoading
()
}
},
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
LOGIN
,
"一键登录Error msg:${it.message}"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
LOGIN
,
"一键登录Error msg:${it.message}"
)
ToastUtil
.
toastShort
(
it
.
message
)
mPhoneNumberAuthHelper
?.
hideLoginLoading
()
})
...
...
m-user/src/main/java/com/yidianling/user/ui/login/RegisterAndLoginActivity.kt
View file @
018badf8
...
...
@@ -34,8 +34,6 @@ import com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.YDLCacheUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.view.dialog.CommonDialog
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.RxAppTool
import
com.yidianling.common.tools.RxKeyboardTool
...
...
m-user/src/main/java/com/yidianling/user/ui/login/presenter/InputPassWordPresenterImpl.kt
View file @
018badf8
...
...
@@ -7,9 +7,9 @@ import com.ydl.ydlcommon.router.YdlCommonOut
import
com.ydl.ydlcommon.utils.StringUtils
import
com.ydl.ydlcommon.utils.YDLCacheUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import
com.ydl.ydlcommon.utils.log.LogHelper
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.user.LoginUtils
import
com.yidianling.user.StatusUtils
...
...
@@ -111,8 +111,8 @@ class InputPassWordPresenterImpl :
.
doAfterTerminate
{
mView
.
showLoading
(
false
)
}
.
subscribe
({
if
(
it
?.
data
==
null
)
{
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
LOGIN
,
"手机号密码 登录失败 msg: ${it.msg}"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
LOGIN
,
"手机号密码 登录失败 msg: ${it.msg}"
)
ToastUtil
.
toastShort
(
it
.
msg
)
mView
.
startAnim
()
}
else
{
...
...
@@ -132,13 +132,13 @@ class InputPassWordPresenterImpl :
}
mView
.
closeActivity
()
}
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
LOGIN
,
"手机号密码 登录成功"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
LOGIN
,
"手机号密码 登录成功"
)
}
},
{
YdlCommonOut
.
showToast
(
it
.
message
!!
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
LOGIN
,
"手机号密码 Error msg: ${it.message}"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
LOGIN
,
"手机号密码 Error msg: ${it.message}"
)
})
}
...
...
m-user/src/main/java/com/yidianling/user/ui/login/presenter/LoginPresenterImpl.kt
View file @
018badf8
...
...
@@ -9,9 +9,9 @@ import com.ydl.ydlcommon.mvp.base.BasePresenter
import
com.ydl.ydlcommon.router.YdlCommonOut
import
com.ydl.ydlcommon.utils.YDLCacheUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import
com.ydl.ydlcommon.utils.log.LogHelper
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.user.LoginUtils
import
com.yidianling.user.StatusUtils
...
...
@@ -91,21 +91,21 @@ class LoginPresenterImpl(view: ILoginContract.View) :
)
}
mView
.
autoLoginSuccess
()
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
LOGIN
,
"通过一键认证服务登录成功"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
LOGIN
,
"通过一键认证服务登录成功"
)
}
else
{
// ToastUtil.toastShort(it.msg)
mView
.
aliAuthFailed
()
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
LOGIN
,
"通过一键认证服务登陆 失败 msg: ${it.msg}"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
LOGIN
,
"通过一键认证服务登陆 失败 msg: ${it.msg}"
)
}
},
{
//走验证码、密码登录
mView
.
aliAuthFailed
()
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
LOGIN
,
"通过一键认证服务登陆 Error msg: ${it.message}"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
LOGIN
,
"通过一键认证服务登陆 Error msg: ${it.message}"
)
})
}
...
...
@@ -263,14 +263,14 @@ class LoginPresenterImpl(view: ILoginContract.View) :
if
(
media
==
SHARE_MEDIA
.
QQ
)
"qq"
else
"weixin"
)
LogHelper
.
getInstance
().
writeLogSync
(
media
.
getName
()
+
"登录成功"
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
LOGIN
,
media
.
getName
()
+
"登录成功"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
LOGIN
,
media
.
getName
()
+
"登录成功"
)
},
{
mView
.
dismissProgressView
()
YdlCommonOut
.
showToast
(
it
.
message
!!
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
LOGIN
,
media
.
getName
()
+
"登录失败"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
LOGIN
,
media
.
getName
()
+
"登录失败"
)
})
}
...
...
ydl-pay/src/main/java/com/yidianling/ydl_pay/common/CommonPayDialog.kt
View file @
018badf8
...
...
@@ -14,8 +14,8 @@ import android.widget.LinearLayout
import
com.alipay.sdk.app.PayTask
import
com.tencent.mm.opensdk.modelpay.PayReq
import
com.tencent.mm.opensdk.openapi.WXAPIFactory
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
import
com.yidianling.common.tools.RxImageTool
import
com.yidianling.ydl_pay.R
import
com.yidianling.ydl_pay.common.bean.*
...
...
@@ -211,7 +211,7 @@ class CommonPayDialog : Dialog {
private
fun
getOrderInfo
()
{
if
(!
NetUtils
.
isConnected
(
activity
))
{
ToastHelper
.
show
(
activity
,
activity
.
getString
(
R
.
string
.
net_error
))
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"获取下单信息,无网络"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"获取下单信息,无网络"
)
// progress.visibility = View.GONE
dismissProgressDialog
()
return
...
...
@@ -230,18 +230,18 @@ class CommonPayDialog : Dialog {
progress_layout
.
visibility
=
View
.
GONE
view_pager
.
visibility
=
View
.
VISIBLE
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"获取下单信息,成功"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"获取下单信息,成功"
)
updateDataOnView
(
it
.
data
)
}
else
{
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
PAY
,
"获取下单信息data=null msg: ${it.msg}"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
PAY
,
"获取下单信息data=null msg: ${it.msg}"
)
ToastHelper
.
show
(
activity
,
it
.
msg
)
// progress.visibility = View.GONE
}
}
else
{
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
PAY
,
"获取下单信息code!=200 msg: ${it.msg}"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
PAY
,
"获取下单信息code!=200 msg: ${it.msg}"
)
ToastHelper
.
show
(
activity
,
it
.
msg
)
// progress.visibility = View.GONE
}
...
...
@@ -249,8 +249,8 @@ class CommonPayDialog : Dialog {
dismissProgressDialog
()
// progress.visibility = View.GONE
ToastHelper
.
show
(
activity
,
e
.
message
!!
)
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
PAY
,
"获取下单信息error e:${e.message}"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
PAY
,
"获取下单信息error e:${e.message}"
)
})
}
...
...
@@ -436,7 +436,7 @@ class CommonPayDialog : Dialog {
}
bean
.
orderType
=
payBusinessType
.
toString
()
bean
.
payType
=
useMoneyType
.
toString
()
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"创建订单,支付方式payWay:$payWay---payMoney:$payMoney----useMoneyType:$useMoneyType"
)
...
...
@@ -449,7 +449,7 @@ class CommonPayDialog : Dialog {
if
(
it
.
code
==
200
)
{
if
(
it
.
data
!=
null
)
{
if
(
it
.
data
.
payStatus
)
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"创建订单,支付成功"
)
...
...
@@ -494,7 +494,7 @@ class CommonPayDialog : Dialog {
@SuppressLint
(
"CheckResult"
)
private
fun
getAliPayOrderId
(
payId
:
String
,
isThreePay
:
Int
)
{
if
(!
NetUtils
.
isConnected
(
activity
))
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"支付宝支付:无网络"
)
...
...
@@ -509,13 +509,13 @@ class CommonPayDialog : Dialog {
.
subscribeOn
(
Schedulers
.
io
())
.
subscribe
({
if
(
it
.
data
!=
null
)
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"支付宝支付:无网络"
)
aliPay
(
it
.
data
.
aliSign
)
}
else
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"支付宝支付:data = null msg: ${it.msg} "
)
...
...
@@ -525,7 +525,7 @@ class CommonPayDialog : Dialog {
dismissProgressDialog
()
}
},
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"支付宝支付:error message: ${it.message} localizedMessage: ${it.localizedMessage}"
)
...
...
@@ -541,7 +541,7 @@ class CommonPayDialog : Dialog {
val
result
=
alipay
.
payV2
(
aliSign
,
true
)
val
payResult
=
PayResult
(
result
)
if
(
"9000"
==
payResult
.
resultStatus
)
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"支付宝支付:支付成功"
)
...
...
@@ -552,7 +552,7 @@ class CommonPayDialog : Dialog {
}
dismissProgressDialog
()
}
else
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"支付宝支付:resultStatus != 9000 memo${payResult.memo} "
)
...
...
@@ -569,7 +569,7 @@ class CommonPayDialog : Dialog {
@SuppressLint
(
"CheckResult"
)
private
fun
getWeiXinPayOrderId
(
payId
:
String
,
isThreePay
:
Int
,
merchantType
:
String
)
{
if
(!
NetUtils
.
isConnected
(
activity
))
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"微信支付,无网络"
)
...
...
@@ -586,7 +586,7 @@ class CommonPayDialog : Dialog {
if
(
it
.
data
!=
null
)
{
weixinPay
(
it
.
data
.
option
)
}
else
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"微信支付data=null ${it.msg}"
)
...
...
@@ -596,7 +596,7 @@ class CommonPayDialog : Dialog {
dismissProgressDialog
()
}
},
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"微信支付,异常:message:${it.message}----localizedMessage:${it.localizedMessage}"
)
...
...
@@ -633,7 +633,7 @@ class CommonPayDialog : Dialog {
.
subscribe
({
dismissProgressDialog
()
if
(
it
.
data
!=
null
&&
it
.
code
==
0
)
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"余额支付:成功"
)
...
...
@@ -642,7 +642,7 @@ class CommonPayDialog : Dialog {
dismiss
()
}
}
else
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"余额支付:失败 msg:${it.msg}"
)
...
...
@@ -651,7 +651,7 @@ class CommonPayDialog : Dialog {
}
}
},
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"余额支付:ERROR message:${it.message} localizedMessage: ${it.localizedMessage}"
)
...
...
@@ -666,7 +666,7 @@ class CommonPayDialog : Dialog {
fun
onEvent
(
event
:
WeiXinPayStatusEvent
)
{
dismissProgressDialog
()
if
(
event
.
success
)
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"微信支付成功"
)
...
...
@@ -674,7 +674,7 @@ class CommonPayDialog : Dialog {
listener
!!
.
onSuccesed
()
dismiss
()
}
else
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"微信支付:失败 msg:${event.msg}"
)
...
...
ydl-pay/src/main/java/com/yidianling/ydl_pay/pay/PayActivity.kt
View file @
018badf8
...
...
@@ -18,9 +18,9 @@ import com.ydl.ydlcommon.data.PlatformDataManager
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import
com.ydl.ydlcommon.utils.log.LogHelper
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.im.api.service.IImService
...
...
@@ -553,7 +553,7 @@ class PayActivity : BaseActivity() {
* 点击支付
*/
private
fun
onClickPay
()
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"点击支付"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"点击支付"
)
when
(
inlet
)
{
INLET_NORMAL
->
{
//正常入口
...
...
@@ -619,7 +619,7 @@ class PayActivity : BaseActivity() {
if
(
null
==
payParams
)
{
return
}
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"进入充值, 0微信充值,其他支付宝充值:$select"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"进入充值, 0微信充值,其他支付宝充值:$select"
)
HttpUtils
.
recharge
(
RechargeParam
(
payParams
!!
.
needPay
.
toInt
().
toString
()))
.
subscribeOn
(
Schedulers
.
io
())
...
...
@@ -639,7 +639,7 @@ class PayActivity : BaseActivity() {
.
doOnSubscribe
{
showProgressDialog
(
""
)
}
.
doAfterTerminate
{
dismissProgressDialog
()
}
.
subscribe
(
Consumer
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"支付成功"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"支付成功"
)
LogHelper
.
getInstance
().
writeLogSync
(
"支付成功"
)
ToastUtil
.
toastShort
(
"支付成功"
)
...
...
@@ -652,7 +652,7 @@ class PayActivity : BaseActivity() {
override
fun
accept
(
msg
:
String
)
{
ToastUtil
.
toastShort
(
msg
)
LogHelper
.
getInstance
().
writeLogSync
(
"支付失败$msg"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"支付失败$msg"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"支付失败$msg"
)
}
})
...
...
@@ -665,18 +665,18 @@ class PayActivity : BaseActivity() {
when
(
inlet
)
{
INLET_NORMAL
->
{
//正常入口
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"余额支付 正常入口"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"余额支付 正常入口"
)
balancePayById
(
payParams
!!
.
payId
)
}
INLET_TEST
->
{
//测评入口
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"余额支付 测评入口"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"余额支付 测评入口"
)
balancePayById
(
testAddOrderBean
!!
.
payId
!!
)
}
else
->
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"余额支付"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"余额支付"
)
balancePayById
(
payParams
!!
.
payId
)
}
...
...
@@ -700,7 +700,7 @@ class PayActivity : BaseActivity() {
.
doAfterTerminate
{
dismissProgressDialog
()
}
.
subscribe
(
Consumer
{
LogHelper
.
getInstance
().
writeLogSync
(
"支付成功"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"余额支付:支付成功"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"余额支付:支付成功"
)
ToastUtil
.
toastShort
(
"支付成功"
)
setResult
(
Activity
.
RESULT_OK
)
finish
()
...
...
@@ -708,7 +708,7 @@ class PayActivity : BaseActivity() {
override
fun
accept
(
msg
:
String
)
{
ToastUtil
.
toastShort
(
msg
)
LogHelper
.
getInstance
().
writeLogSync
(
"支付失败:$msg"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"余额支付:支付失败:$msg"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"余额支付:支付失败:$msg"
)
}
})
...
...
@@ -719,7 +719,7 @@ class PayActivity : BaseActivity() {
*/
@SuppressLint
(
"CheckResult"
)
private
fun
appPay
()
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"微信支付 0 其他支付宝支付 select:${select}"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"微信支付 0 其他支付宝支付 select:${select}"
)
Observable
.
just
(
select
)
.
subscribeOn
(
Schedulers
.
io
())
...
...
@@ -737,7 +737,7 @@ class PayActivity : BaseActivity() {
.
doOnSubscribe
{
showProgressDialog
(
""
)
}
.
doAfterTerminate
{
dismissProgressDialog
()
}
.
subscribe
(
Consumer
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"支付成功"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"支付成功"
)
LogHelper
.
getInstance
().
writeLogSync
(
"支付成功"
)
setResult
(
Activity
.
RESULT_OK
)
finish
()
...
...
@@ -745,7 +745,7 @@ class PayActivity : BaseActivity() {
override
fun
accept
(
msg
:
String
)
{
ToastUtil
.
toastShort
(
msg
)
LogHelper
.
getInstance
().
writeLogSync
(
"支付失败:$msg"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"支付失败:$msg"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"支付失败:$msg"
)
}
})
...
...
@@ -758,20 +758,20 @@ class PayActivity : BaseActivity() {
return
when
(
inlet
)
{
INLET_NORMAL
->
{
//正常入口
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"微信支付:正常入口"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"微信支付:正常入口"
)
wxPayById
(
payParams
!!
.
payId
,
payParams
?.
merchantType
.
toString
())
}
INLET_TEST
->
{
//测评入口
if
(
null
!=
testAddOrderBean
&&
!
TextUtils
.
isEmpty
(
testAddOrderBean
!!
.
payId
!!
))
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"微信支付:测评入口"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"微信支付:测评入口"
)
wxPayById
(
testAddOrderBean
!!
.
payId
!!
,
payParams
?.
merchantType
.
toString
())
}
else
{
null
}
}
else
->
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"微信支付"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"微信支付"
)
wxPayById
(
payParams
!!
.
payId
,
payParams
?.
merchantType
.
toString
())
}
}
...
...
@@ -797,14 +797,14 @@ class PayActivity : BaseActivity() {
return
when
(
inlet
)
{
INLET_NORMAL
->
{
//正常入口
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"支付宝支付:正常入口"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"支付宝支付:正常入口"
)
aliPayById
(
payParams
!!
.
payId
)
}
INLET_TEST
->
{
//测评入口
if
(
null
!=
testAddOrderBean
&&
!
TextUtils
.
isEmpty
(
testAddOrderBean
!!
.
payId
!!
))
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"支付宝支付:测评入口"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"支付宝支付:测评入口"
)
aliPayById
(
testAddOrderBean
!!
.
payId
!!
)
}
else
{
...
...
@@ -812,7 +812,7 @@ class PayActivity : BaseActivity() {
}
}
else
->
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"支付宝支付"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"支付宝支付"
)
aliPayById
(
payParams
!!
.
payId
)
}
...
...
ydl-pay/src/main/java/com/yidianling/ydl_pay/pay/RxPay.kt
View file @
018badf8
...
...
@@ -7,8 +7,8 @@ import com.tencent.mm.opensdk.constants.Build
import
com.tencent.mm.opensdk.modelpay.PayReq
import
com.tencent.mm.opensdk.openapi.WXAPIFactory
import
com.ydl.ydlcommon.data.http.CustomThrowable
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
import
com.yidianling.ydl_pay.common.bean.CommonWXPayBean
import
com.yidianling.ydl_pay.common.bean.PayResult
import
com.yidianling.ydl_pay.pay.bean.PayStatus
...
...
@@ -64,13 +64,13 @@ object RxPay {
"9000"
==
payResult
.
resultStatus
->
{
it
.
onNext
(
PayStatus
(
true
))
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"支付宝支付成功"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"支付宝支付成功"
)
}
else
->
{
it
.
onError
(
CustomThrowable
(
payResult
.
memo
))
AliYun
Log
Helper
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
PAY
,
"支付宝支付失败 memo:${payResult.memo}"
)
AliYun
RichLogs
Helper
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
PAY
,
"支付宝支付失败 memo:${payResult.memo}"
)
}
}
...
...
ydl-pay/src/main/java/com/yidianling/ydl_pay/pay/payDialog/PayDialog.kt
View file @
018badf8
...
...
@@ -9,10 +9,10 @@ import android.support.v7.app.AlertDialog
import
android.view.*
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.utils.StringUtils
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import
com.ydl.ydlcommon.utils.log.LogHelper
import
com.ydl.ydlcommon.utils.remind.ToastHelper
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
import
com.yidianling.ydl_pay.R
import
com.yidianling.ydl_pay.common.bean.params.AliPayParam
import
com.yidianling.ydl_pay.common.bean.params.WxPayParam
...
...
@@ -162,7 +162,7 @@ class PayDialog : Dialog {
if
(
data
?.
payId
==
null
)
{
ToastHelper
.
show
(
"支付id有误,请返回重试"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"支付id有误,请返回重试"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"支付id有误,请返回重试"
)
return
}
...
...
@@ -190,12 +190,12 @@ class PayDialog : Dialog {
this
.
callBack
?.
onSuccess
()
}
LogHelper
.
getInstance
().
writeLogSync
(
"支付成功"
)
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"支付成功"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"支付成功"
)
this
.
callBack
?.
onSuccess
()
dismiss
()
},
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"支付失败:${it.message}"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"支付失败:${it.message}"
)
ToastHelper
.
show
(
it
.
message
?:
"支付失败"
)
LogHelper
.
getInstance
().
writeLogSync
(
"支付失败:${it.message}"
)
})
...
...
@@ -206,7 +206,7 @@ class PayDialog : Dialog {
* @param payId 支付id
*/
private
fun
wxPayById
(
payId
:
String
,
merchantType
:
String
):
Observable
<
PayStatus
>
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"微信支付"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"微信支付"
)
val
bean
=
WxPayParam
(
payId
,
1
,
merchantType
)
return
HttpUtils
.
wxPay
(
bean
)
.
compose
(
RxUtils
.
resultData
())
...
...
@@ -219,7 +219,7 @@ class PayDialog : Dialog {
* @param payId 支付Id
*/
private
fun
aliPayById
(
payId
:
String
):
Observable
<
PayStatus
>
{
AliYun
LogHelper
.
getInstance
().
send
Log
(
AliYunLogConfig
.
PAY
,
"支付宝支付"
)
AliYun
RichLogsHelper
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
PAY
,
"支付宝支付"
)
var
bean
=
AliPayParam
(
payId
,
1
)
return
HttpUtils
.
getAliPayOrderId
(
bean
)
...
...
ydl-webview/src/main/java/com/ydl/webview/NewH5Activity.java
View file @
018badf8
...
...
@@ -48,11 +48,11 @@ import com.ydl.ydlcommon.utils.LogUtil;
import
com.ydl.ydlcommon.utils.NetWorkSpeedUtils
;
import
com.ydl.ydlcommon.utils.StatusBarUtils
;
import
com.ydl.ydlcommon.utils.URLUtils
;
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
;
import
com.ydl.ydlcommon.view.TitleBar
;
import
com.ydl.ydlcommon.view.dialog.YDLCommonDialog
;
import
com.ydl.ydlcommon.view.dialog.YDLShareDialog
;
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
;
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
;
import
com.yidianling.common.tools.RxDeviceTool
;
import
com.yidianling.common.tools.RxImageTool
;
import
com.yidianling.common.tools.ToastUtil
;
...
...
@@ -376,7 +376,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
rightText
=
getIntent
().
getStringExtra
(
"rightText"
);
if
(
h5Params
==
null
)
{
ToastUtil
.
toastShort
(
"参数错误"
);
AliYun
LogHelper
.
Companion
.
getInstance
().
send
Log
(
AliYunLogConfig
.
WEB
,
"参数错误 Params == null"
);
AliYun
RichLogsHelper
.
Companion
.
getInstance
().
sendRich
Log
(
AliYunLogConfig
.
WEB
,
"参数错误 Params == null"
);
finish
();
return
;
}
...
...
@@ -691,8 +691,8 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
safeTipView
.
setLocation
(
"orderList"
);
}
if
(
title
.
contains
(
"404"
)
||
title
.
contains
(
"500"
)
||
title
.
contains
(
"Error"
))
{
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
WEB
,
"页面错误 : url:"
+
view
.
getUrl
()
+
"title:"
+
title
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
WEB
,
"页面错误 : url:"
+
view
.
getUrl
()
+
"title:"
+
title
);
}
}
...
...
@@ -784,8 +784,8 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
@Override
public
void
onReceivedError
(
WebView
view
,
int
errorCode
,
String
description
,
String
failingUrl
)
{
super
.
onReceivedError
(
view
,
errorCode
,
description
,
failingUrl
);
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
WEB
,
"onReceivedError---- errorCode: "
+
errorCode
+
"----failingUrl:"
+
failingUrl
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
WEB
,
"onReceivedError---- errorCode: "
+
errorCode
+
"----failingUrl:"
+
failingUrl
);
loadFailed
=
true
;
tb_title
.
setTitle
(
"加载中"
);
if
(
wv_content
!=
null
)
{
...
...
@@ -895,8 +895,8 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
@Override
public
void
onReceivedError
(
WebView
view
,
int
errorCode
,
String
description
,
String
failingUrl
)
{
super
.
onReceivedError
(
view
,
errorCode
,
description
,
failingUrl
);
AliYun
Log
Helper
.
Companion
.
getInstance
()
.
sendLog
(
AliYunLogConfig
.
WEB
,
"onReceivedError---- errorCode: "
+
errorCode
+
"----failingUrl:"
+
failingUrl
);
AliYun
RichLogs
Helper
.
Companion
.
getInstance
()
.
send
Rich
Log
(
AliYunLogConfig
.
WEB
,
"onReceivedError---- errorCode: "
+
errorCode
+
"----failingUrl:"
+
failingUrl
);
tb_title
.
setTitle
(
"加载中"
);
loadFailed
=
true
;
if
(
wv_content
!=
null
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment