fix(live-room): 스탭 캡쳐 녹화 허용 정책을 동기화한다

This commit is contained in:
2026-03-30 16:58:37 +09:00
parent a6e3f71ca5
commit d074f98d24
2 changed files with 67 additions and 3 deletions

View File

@@ -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
}