fix(live-room): 방장 캡쳐 녹화 허용 정책을 반영한다
This commit is contained in:
@@ -64,7 +64,7 @@ android {
|
||||
minSdk 23
|
||||
targetSdk 35
|
||||
versionCode 233
|
||||
versionName "1.54.1"
|
||||
versionName "1.54.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
|
||||
@@ -415,7 +415,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
)
|
||||
|
||||
// 포그라운드 진입 시 API 레벨별 캡처/녹화 감지를 시작한다.
|
||||
registerCaptureSecurityCallbacks()
|
||||
syncCaptureSecurityPolicyByRole()
|
||||
|
||||
if (this::layoutManager.isInitialized) {
|
||||
layoutManager.scrollToPosition(chatAdapter.itemCount - 1)
|
||||
@@ -1256,6 +1256,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
}
|
||||
|
||||
isHost = response.creatorId == SharedPreferenceManager.userId
|
||||
syncCaptureSecurityPolicyByRole()
|
||||
binding.tvChatFreezeSwitch.visibility = if (isHost) {
|
||||
View.VISIBLE
|
||||
} else {
|
||||
@@ -1605,8 +1606,18 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
}, 100)
|
||||
}
|
||||
|
||||
private fun registerCaptureSecurityCallbacks() {
|
||||
registerScreenRecordingCallback()
|
||||
private fun syncCaptureSecurityPolicyByRole() {
|
||||
if (isHost) {
|
||||
window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
|
||||
unregisterScreenRecordingCallback()
|
||||
clearCapturePrivacyMuteState()
|
||||
return
|
||||
}
|
||||
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_SECURE)
|
||||
if (isForeground) {
|
||||
registerScreenRecordingCallback()
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
@@ -1669,7 +1680,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
}
|
||||
|
||||
private fun syncCapturePrivacyMuteState() {
|
||||
val shouldMute = isScreenRecordingActive
|
||||
val shouldMute = !isHost && isScreenRecordingActive
|
||||
if (isCapturePrivacyMuted == shouldMute) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user