Skip to content

Commit be0e9df

Browse files
CYGCYG
authored andcommitted
[android]data report
1 parent 3bc084c commit be0e9df

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

KTVAPI/Android/lib_ktvapi/src/main/java/io/agora/ktvapi/KTVApiImpl.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ class KTVApiImpl(
2222

2323
companion object {
2424
private val scheduledThreadPool: ScheduledExecutorService = Executors.newScheduledThreadPool(5)
25-
const val tag = "KTV_API_LOG"
26-
const val version = "1_android_4.3.0"
27-
const val lyricSyncVersion = 2
25+
private const val tag = "KTV_API_LOG"
26+
private const val messageId = "agora:scenarioAPI"
27+
private const val version = "1_android_4.3.0"
28+
private const val lyricSyncVersion = 2
2829
}
2930

3031
private val mainHandler by lazy { Handler(Looper.getMainLooper()) }
@@ -185,7 +186,7 @@ class KTVApiImpl(
185186
private fun reportCallScenarioApi(event: String, params: JSONObject) {
186187
ktvApiLog("event: $event, params:$params")
187188
mRtcEngine.sendCustomReportMessage(
188-
"scenarioAPI",
189+
messageId,
189190
version,
190191
event,
191192
params.toString(),
@@ -251,6 +252,9 @@ class KTVApiImpl(
251252
mRtcEngine.setParameters("{\"rtc.enable_tds_request_on_join\": true}")
252253
//mRtcEngine.setParameters("{\"rtc.remote_path_scheduling_strategy\": 0}")
253254
//mRtcEngine.setParameters("{\"rtc.path_scheduling_strategy\": 0}")
255+
256+
// 数据上报
257+
mRtcEngine.setParameters("{\"rtc.direct_send_custom_event\": true}")
254258
}
255259

256260
override fun addEventHandler(ktvApiEventHandler: IKTVApiEventHandler) {

KTVAPI/Android/lib_ktvapi/src/main/java/io/agora/ktvapi/KTVGiantChorusApiImpl.kt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ class KTVGiantChorusApiImpl(
2222

2323
companion object {
2424
private val scheduledThreadPool: ScheduledExecutorService = Executors.newScheduledThreadPool(5)
25-
const val tag = "KTV_API_LOG"
26-
const val version = "1_android_4.3.0"
27-
const val lyricSyncVersion = 2
25+
private const val tag = "KTV_API_LOG_GIANT"
26+
private const val messageId = "agora:scenarioAPI"
27+
private const val version = "1_android_4.3.0"
28+
private const val lyricSyncVersion = 2
2829
}
2930

3031
private val mainHandler by lazy { Handler(Looper.getMainLooper()) }
@@ -190,7 +191,7 @@ class KTVGiantChorusApiImpl(
190191
// 数据上报
191192
private fun reportCallScenarioApi(event: String, params: JSONObject) {
192193
mRtcEngine.sendCustomReportMessage(
193-
"scenarioAPI",
194+
messageId,
194195
version,
195196
event,
196197
params.toString(),
@@ -199,12 +200,12 @@ class KTVGiantChorusApiImpl(
199200

200201
// 日志输出
201202
private fun ktvApiLog(msg: String) {
202-
Logging.i(KTVApiImpl.tag, "[GiantChorus] $msg")
203+
Logging.i(tag, "[GiantChorus] $msg")
203204
}
204205

205206
// 日志输出
206207
private fun ktvApiLogError(msg: String) {
207-
Logging.e(KTVApiImpl.tag, "[GiantChorus] $msg")
208+
Logging.e(tag, "[GiantChorus] $msg")
208209
}
209210

210211
override fun renewInnerDataStreamId() {
@@ -251,6 +252,9 @@ class KTVGiantChorusApiImpl(
251252
mRtcEngine.setParameters("{\"rtc.enable_tds_request_on_join\": true}")
252253
//mRtcEngine.setParameters("{\"rtc.remote_path_scheduling_strategy\": 0}")
253254
//mRtcEngine.setParameters("{\"rtc.path_scheduling_strategy\": 0}")
255+
256+
// 数据上报
257+
mRtcEngine.setParameters("{\"rtc.direct_send_custom_event\": true}")
254258
}
255259

256260
override fun addEventHandler(ktvApiEventHandler: IKTVApiEventHandler) {

0 commit comments

Comments
 (0)