[[ AndroidPermissionsLCB ]] Added permission checking handlers to and… - #7027
Conversation
|
@livecodemichael could you flesh out the docs a bit? Could basically crib the LCS docs for these. |
5edd50d to
85a5190
Compare
|
@montegoulding Done : ) |
| end handler | ||
|
|
||
| private foreign handler MCAndroidCheckRuntimePermission(in pPermission as String) \ | ||
| returns Boolean binds to "<builtin>" |
| return tPermissionExists | ||
| end handler | ||
|
|
||
| private foreign handler MCAndroidHasPermission(in pPermission as String) \ |
| return AndroidHasPermission(pPermission) | ||
| end handler | ||
|
|
||
| private foreign handler MCAndroidCheckPermissionExists(in pPermission as String) \ |
85a5190 to
9dda091
Compare
| unsafe | ||
| MCAndroidCheckRuntimePermission(pPermission) | ||
| end unsafe | ||
| return AndroidHasPermission(pPermission) |
There was a problem hiding this comment.
@livecodemichael I believe you can just return the value returned by MCAndroidCheckRuntimePermission here
…roid-utils. The android-utils lcb module has been updated to expose LiveCode's android permission API. Three new handlers have been added to the module that just wrap their equivalent engine functions.
9dda091 to
ee9fda0
Compare
| public handler AndroidRequestPermission(in pPermission as String) returns Boolean | ||
| variable tHasPermission as Boolean | ||
| unsafe | ||
| MCAndroidCheckRuntimePermission(pPermission) |
There was a problem hiding this comment.
Sorry @livecodemichael what I meant was put MCAndroidCheckRuntimePermission(pPermission) into tHasPermission
There was a problem hiding this comment.
Interestingly the LCS variant doesn't have a granted result instead it sets the result to empty even though the granted status is right there.... odd... @livecodepanos do you recall the reasoning for this in LCS? Perhaps the same argument applies here.
There was a problem hiding this comment.
Sorry @livecodemichael what I meant was
put MCAndroidCheckRuntimePermission(pPermission) into tHasPermission
Duh yeah. As you say, the LCS version doesn't return granted result so I assumed the internal function didn't.
There was a problem hiding this comment.
Interestingly the LCS variant doesn't have a granted result instead it sets the result to empty even though the granted status is right there.... odd... @livecodepanos do you recall the reasoning for this in LCS? Perhaps the same argument applies here.
It was @runrevmark 's suggestion to return empty. See this comment:
#6614 (comment)
There was a problem hiding this comment.
OK sorry again @livecodemichael . While I'm not sure I entirely agree with the LCS syntax because it seems more sensible to me to always request permission when starting to use something that needs it which will silently return granted if the user has already granted it and then just checking has permission to guard code later on I presume @runrevmark will want it the same for the same reasons.
|
@livecode-vulcan review ok ee9fda0 |
|
💙 review by @runrevmark ok ee9fda0 |
…rmissions_lcb [[ AndroidPermissionsLCB ]] Added permission checking handlers to and… …roid-utils. The android-utils lcb module has been updated to expose LiveCode's android permission API. Three new handlers have been added to the module that just wrap their equivalent engine functions.
|
😎 test success ee9fda0
|
…roid-utils.
The android-utils lcb module has been updated to expose
LiveCode's android permission API. Three new handlers have been
added to the module that just wrap their equivalent engine
functions.