forked from geode-sdk/android-launcher
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
|
||||
fun requestPermission(permission: String): Boolean {
|
||||
fun requestPermission(permission: String) {
|
||||
if (getPermissionStatus(permission)) {
|
||||
permissionCallback(true)
|
||||
return true
|
||||
return
|
||||
}
|
||||
|
||||
activity.get()?.run {
|
||||
try {
|
||||
requestPermissionLauncher.launch(permission)
|
||||
return true
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
return false
|
||||
permissionCallback(false)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
return false
|
||||
permissionCallback(false)
|
||||
}
|
||||
|
||||
@Suppress("KotlinJniMissingFunction")
|
||||
|
||||
Reference in new issue
Block a user