Skip to content

Commit 0984b95

Browse files
jiahaoliangMinTate
authored andcommitted
【TUICallKit】【Android】Fix crash when receiving FCM push notifications on Android 14
1 parent 4263531 commit 0984b95

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

call/tuicallkit-kt/src/main/java/com/tencent/qcloud/tuikit/tuicallkit/TUICallKitImpl.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ class TUICallKitImpl private constructor(context: Context) : TUICallKit() {
226226
if (selfInfo.status != CallParticipantStatus.Waiting || selfIsCaller()) {
227227
return@collect
228228
}
229-
CallManager.instance.startForegroundService()
230229
handleNewCall()
231230
}
232231
}

call/tuicallkit-kt/src/main/java/com/tencent/qcloud/tuikit/tuicallkit/manager/CallManager.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class CallManager private constructor(context: Context) {
3838

3939
fun reset() {
4040
viewState.reset()
41-
stopForegroundService()
4241
}
4342

4443
fun calls(
@@ -361,7 +360,7 @@ class CallManager private constructor(context: Context) {
361360
}
362361
}
363362

364-
private fun stopForegroundService() {
363+
fun stopForegroundService() {
365364
VideoForegroundService.stop(TUIConfig.getAppContext())
366365
AudioForegroundService.stop(TUIConfig.getAppContext())
367366
}

call/tuicallkit-kt/src/main/java/com/tencent/qcloud/tuikit/tuicallkit/view/CallMainActivity.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class CallMainActivity : FullScreenActivity() {
7070
setAudioDeviceRoute(mediaType)
7171
openDeviceMediaForMediaType(mediaType)
7272
}
73+
CallManager.instance.startForegroundService()
7374
}
7475

7576
private fun initView() {
@@ -179,6 +180,7 @@ class CallMainActivity : FullScreenActivity() {
179180
override fun onDestroy() {
180181
super.onDestroy()
181182
subscribeStateJob?.cancel()
183+
CallManager.instance.stopForegroundService()
182184
Logger.i(TAG, "onDestroy")
183185
}
184186

0 commit comments

Comments
 (0)