Skip to content

Commit

Permalink
Merge pull request #667 from KasperskyLab/ISSUE-649-Pass-button-into-…
Browse files Browse the repository at this point in the history
…allow-via-dialog

ISSUE-649: Pass the button to the allowViaDialog
  • Loading branch information
CherchesovAzamat authored Nov 22, 2024
2 parents 09f64a5 + 32dd02b commit 7045390
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ interface Permissions {

/**
* Passes the permission-requesting permissions dialog and allows permissions.
*
* @param button - the button which would be pressed. Changing the default value may be useful in android 11+ cases
* @see (https://developer.android.com/about/versions/11/privacy/location and https://developer.android.com/about/versions/14/changes/partial-photo-video-access)
*/
fun allowViaDialog()
fun allowViaDialog(button: Button = Button.ALLOW)

/**
* Passes the permission-requesting permissions dialog and denies permissions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ class PermissionsImpl(
/**
* Waits for 1 sec, passes the permission-requesting permissions dialog and allows permissions.
*/
override fun allowViaDialog() {
override fun allowViaDialog(button: Permissions.Button) {
wait(
timeoutMs = DIALOG_TIMEOUT_MS,
logger = logger
) {
handlePermissionRequest(Permissions.Button.ALLOW)
handlePermissionRequest(button)
}
logger.i("Allow permission via dialog")
}
Expand Down

0 comments on commit 7045390

Please sign in to comment.