|
@@ -51,9 +51,6 @@ import com.swago.room.lianmai.LianMaiVm
|
|
|
import com.swago.room.pk.IPKListener
|
|
|
import com.swago.room.pk.PKStateManager
|
|
|
import com.swago.room.pk.PkVm
|
|
|
-import com.swago.room.service.AgoraForegroundService
|
|
|
-import com.swago.room.service.AgoraForegroundService.ACTION_START_FOREGROUND_SERVICE
|
|
|
-import com.swago.room.service.AgoraForegroundService.ACTION_STOP_FOREGROUND_SERVICE
|
|
|
import com.swago.room.vm.MsgVm
|
|
|
import com.swago.room.vm.RoomOtherVm
|
|
|
import com.swago.room.vm.RoomVm
|
|
@@ -76,8 +73,6 @@ class AnchorRoomActivity : AbsAnchorActivity<ActivityAnchorRoomBinding, IRoomInf
|
|
|
private val pkVm by viewModels<PkVm>()
|
|
|
private val lianMaiVm by viewModels<LianMaiVm>()
|
|
|
|
|
|
- private var agoraService: Intent? = null
|
|
|
-
|
|
|
private val fragments = arrayListOf(NoContentFragment(), AnchorRoomFragment())
|
|
|
|
|
|
private val adapter = SwagoAdapter(fragments, supportFragmentManager)
|
|
@@ -109,7 +104,6 @@ class AnchorRoomActivity : AbsAnchorActivity<ActivityAnchorRoomBinding, IRoomInf
|
|
|
AudioRoomManager.addListener(this)
|
|
|
initPeerAnchorLayoutParams()
|
|
|
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
|
|
- agoraService = Intent(this, AgoraForegroundService::class.java)
|
|
|
AgoraManager.initializeEngine(this, this)
|
|
|
AgoraManager.setVideoConfiguration()
|
|
|
AgoraManager.setVideoAudio(pullVideo = true, pullAudio = true, pushVideo = true, pushAudio = true)
|
|
@@ -376,25 +370,16 @@ class AnchorRoomActivity : AbsAnchorActivity<ActivityAnchorRoomBinding, IRoomInf
|
|
|
|
|
|
override fun onResume() {
|
|
|
super.onResume()
|
|
|
- agoraService?.let {
|
|
|
- it.action = ACTION_STOP_FOREGROUND_SERVICE
|
|
|
- startService(it)
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
override fun onPause() {
|
|
|
super.onPause()
|
|
|
- agoraService?.let {
|
|
|
- it.action = ACTION_START_FOREGROUND_SERVICE
|
|
|
- startService(it)
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
override fun onDestroy() {
|
|
|
anchorCloseDialog = null
|
|
|
PKStateManager.removePKListener(this)
|
|
|
AudioRoomManager.removeListener(this)
|
|
|
- agoraService?.let { stopService(it) }
|
|
|
super.onDestroy()
|
|
|
}
|
|
|
|