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