-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add permission prompt fallback (#1517)
- Loading branch information
Showing
12 changed files
with
834 additions
and
370 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
urbanairship-core/src/main/java/com/urbanairship/permission/PermissionPromptFallback.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* Copyright Airship and Contributors */ | ||
|
||
package com.urbanairship.permission | ||
|
||
/** | ||
* Fallback for when a permission is silently denied. | ||
*/ | ||
public sealed class PermissionPromptFallback { | ||
|
||
/** | ||
* Navigate to system settings. On return the status will be checked again. | ||
*/ | ||
public data object SystemSettings: PermissionPromptFallback() | ||
|
||
/** | ||
* Run a custom callback. After running the callback, the status will be checked again. | ||
*/ | ||
public class Callback(internal val callback: suspend () -> Unit): PermissionPromptFallback() | ||
|
||
/** | ||
* No fallback | ||
*/ | ||
public data object None: PermissionPromptFallback() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.