mirror of
https://github.com/geode-sdk/android-launcher.git
synced 2026-10-21 16:32:39 +00:00
change handling of failures
This commit is contained in:
1 parent
5fa42b6ca5
commit
d078879e7b
1 file changed
+6
-5
@@ -265,22 +265,23 @@ object GeodeUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun requestPermission(permission: String): Boolean {
|
fun requestPermission(permission: String) {
|
||||||
if (getPermissionStatus(permission)) {
|
if (getPermissionStatus(permission)) {
|
||||||
permissionCallback(true)
|
permissionCallback(true)
|
||||||
return true
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
activity.get()?.run {
|
activity.get()?.run {
|
||||||
try {
|
try {
|
||||||
requestPermissionLauncher.launch(permission)
|
requestPermissionLauncher.launch(permission)
|
||||||
return true
|
|
||||||
} catch (e: ActivityNotFoundException) {
|
} catch (e: ActivityNotFoundException) {
|
||||||
return false
|
permissionCallback(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
permissionCallback(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("KotlinJniMissingFunction")
|
@Suppress("KotlinJniMissingFunction")
|
||||||
|
|||||||
Reference in new issue
Block a user