fix(live-room): 스탭 캡쳐 녹화 허용 정책을 동기화한다
This commit is contained in:
@@ -181,6 +181,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
private var screenRecordingCallback: Any? = null
|
||||
|
||||
private var isHost = false
|
||||
private var isStaff = false
|
||||
|
||||
private var isAvailableLikeHeart = false
|
||||
private var buttonPosition = IntArray(2)
|
||||
@@ -1294,7 +1295,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
}
|
||||
}
|
||||
|
||||
isHost = response.creatorId == SharedPreferenceManager.userId
|
||||
syncRoomRoleState(response)
|
||||
syncCaptureSecurityPolicyByRole()
|
||||
binding.tvChatFreezeSwitch.visibility = if (isHost) {
|
||||
View.VISIBLE
|
||||
@@ -1645,8 +1646,20 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
}, 100)
|
||||
}
|
||||
|
||||
private fun syncRoomRoleState(response: GetRoomInfoResponse) {
|
||||
val myUserId = SharedPreferenceManager.userId
|
||||
isHost = response.creatorId == myUserId
|
||||
isStaff = response.managerList.any { member ->
|
||||
member.id == myUserId
|
||||
}
|
||||
}
|
||||
|
||||
private fun hasCapturePermissionByRole(): Boolean {
|
||||
return isHost || isStaff
|
||||
}
|
||||
|
||||
private fun syncCaptureSecurityPolicyByRole() {
|
||||
if (isHost) {
|
||||
if (hasCapturePermissionByRole()) {
|
||||
window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
|
||||
unregisterScreenRecordingCallback()
|
||||
clearCapturePrivacyMuteState()
|
||||
@@ -1719,7 +1732,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
}
|
||||
|
||||
private fun syncCapturePrivacyMuteState() {
|
||||
val shouldMute = !isHost && isScreenRecordingActive
|
||||
val shouldMute = !hasCapturePermissionByRole() && isScreenRecordingActive
|
||||
if (isCapturePrivacyMuted == shouldMute) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user