mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Add ForceRequestPermissions event to bypass soft-denial intercept
This commit is contained in:
+16
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user