Skip to content

Fix blocking permission requests#314

Merged
jmattheis merged 4 commits into
gotify:masterfrom
cyb3rko:fix-permission-blocking
Oct 3, 2023
Merged

Fix blocking permission requests#314
jmattheis merged 4 commits into
gotify:masterfrom
cyb3rko:fix-permission-blocking

Conversation

@cyb3rko

@cyb3rko cyb3rko commented Oct 1, 2023

Copy link
Copy Markdown
Contributor

I've realized that this line

installSplashScreen().setKeepOnScreenCondition { splashScreenActive }

is blocking the UI thread until the condition is true. Because permission requests take some seconds the app is blocking for several seconds, even leading to possible app crashes.

The solution is canceling the splashScreen when requesting permissions and showing the previous "splash screen layout".
Tested on Android 13 (33) and 14 (34).

Comment thread app/src/main/kotlin/com/github/gotify/init/InitializationActivity.kt Outdated
@cyb3rko

cyb3rko commented Oct 3, 2023

Copy link
Copy Markdown
Contributor Author

We have that weird behaviour again that it does not recognize Kotlin functions.
I will check that.

Edit: Downgrading Kotlin fixed it once again

@cyb3rko
cyb3rko force-pushed the fix-permission-blocking branch from 7e24579 to ba04033 Compare October 3, 2023 10:22
jmattheis
jmattheis previously approved these changes Oct 3, 2023

@jmattheis jmattheis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, only have one little remark.

Comment thread app/src/main/kotlin/com/github/gotify/init/InitializationActivity.kt Outdated

@jmattheis jmattheis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@jmattheis
jmattheis merged commit 6dd5fe4 into gotify:master Oct 3, 2023
@cyb3rko
cyb3rko deleted the fix-permission-blocking branch October 7, 2023 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants