Add ForceRequestPermissions event to bypass soft-denial intercept

This commit is contained in:
ganfra
2026-07-07 21:37:37 +02:00
parent 74bc2c0f5d
commit 7f4d264ee0
3 changed files with 20 additions and 0 deletions
@@ -9,7 +9,23 @@
package io.element.android.libraries.permissions.api
sealed interface PermissionsEvent {
/**
* Request the runtime permission. If the app has already recorded a soft denial for this
* permission, this event is intercepted to raise [PermissionsState.showDialog] instead of
* hitting the OS — the intent is for the caller to render `PermissionsView` to prompt the
* user to open system settings.
*
* If the caller renders its own "already denied" UI and wants the OS prompt regardless,
* use [ForceRequestPermissions].
*/
data object RequestPermissions : PermissionsEvent
/**
* Same as [RequestPermissions] but bypasses the soft-denial intercept — always launches
* the OS permission dialog. The OS may still auto-deny for permanently-denied permissions.
*/
data object ForceRequestPermissions : PermissionsEvent
data object CloseDialog : PermissionsEvent
data object OpenSystemSettingAndCloseDialog : PermissionsEvent
}