WindowSecureHelper

Controls whether an activity's window permits screenshots and screen capture.

Functions

Link copied to clipboard
fun apply(activity: Activity, allowScreenshots: Boolean)

Enables or disables FLAG_SECURE on activity according to allowScreenshots and records the applied policy for diagnostics.

Link copied to clipboard
fun bind(activity: ComponentActivity, settingsRepository: SettingsRepository)

Applies screenshot policy now, on resume, and whenever the setting changes.

Link copied to clipboard
fun disable(activity: Activity)

Clears FLAG_SECURE, allowing screenshots and screen recording.

Link copied to clipboard
fun enable(activity: Activity)

Sets FLAG_SECURE to block screenshots and screen recording.