Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

[[ AndroidPermissionsLCB ]] Added permission checking handlers to and… - #7027

Merged
runrevmark merged 1 commit into
livecode:developfrom
livecodemichael:feature-android_permissions_lcb
May 16, 2019
Merged

[[ AndroidPermissionsLCB ]] Added permission checking handlers to and…#7027
runrevmark merged 1 commit into
livecode:developfrom
livecodemichael:feature-android_permissions_lcb

Conversation

@livecodemichael

Copy link
Copy Markdown
Contributor

…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.

Comment thread extensions/modules/android-utils/android-utils.lcb Outdated
@montegoulding

Copy link
Copy Markdown
Contributor

@livecodemichael could you flesh out the docs a bit? Could basically crib the LCS docs for these.

@livecodemichael
livecodemichael force-pushed the feature-android_permissions_lcb branch from 5edd50d to 85a5190 Compare May 14, 2019 15:13
@livecodemichael

Copy link
Copy Markdown
Contributor Author

@montegoulding Done : )

end handler

private foreign handler MCAndroidCheckRuntimePermission(in pPermission as String) \
returns Boolean binds to "<builtin>"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This needs to be CBool

return tPermissionExists
end handler

private foreign handler MCAndroidHasPermission(in pPermission as String) \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This needs to be CBool

return AndroidHasPermission(pPermission)
end handler

private foreign handler MCAndroidCheckPermissionExists(in pPermission as String) \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This needs to be CBool

@livecodemichael
livecodemichael force-pushed the feature-android_permissions_lcb branch from 85a5190 to 9dda091 Compare May 14, 2019 16:55
unsafe
MCAndroidCheckRuntimePermission(pPermission)
end unsafe
return AndroidHasPermission(pPermission)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@livecodemichael I believe you can just return the value returned by MCAndroidCheckRuntimePermission here

@runrevmark runrevmark added this to the 9.5.0-dp-1 milestone May 15, 2019
…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.
@livecodemichael
livecodemichael force-pushed the feature-android_permissions_lcb branch from 9dda091 to ee9fda0 Compare May 15, 2019 08:32
public handler AndroidRequestPermission(in pPermission as String) returns Boolean
variable tHasPermission as Boolean
unsafe
MCAndroidCheckRuntimePermission(pPermission)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @livecodemichael what I meant was put MCAndroidCheckRuntimePermission(pPermission) into tHasPermission

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@runrevmark

Copy link
Copy Markdown
Contributor

@livecode-vulcan review ok ee9fda0

@livecode-vulcan

Copy link
Copy Markdown
Contributor

💙 review by @runrevmark ok ee9fda0

livecode-vulcan added a commit that referenced this pull request May 16, 2019
…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.
@livecode-vulcan

Copy link
Copy Markdown
Contributor

😎 test success ee9fda0

  • try-community-armv6-android-sdk26_ndk16r15: success
  • try-community-armv7-android-sdk26_ndk16r15: success
  • try-community-arm64-android-sdk26_ndk16r15: success
  • try-community-x86-android-sdk26_ndk16r15: success
  • try-community-x86_64-android-sdk26_ndk16r15: success
  • try-community-js-emscripten-sdk1.35: success
  • try-community-universal-ios-iphoneos12.1: success
  • try-community-universal-ios-iphonesimulator12.1: success
  • try-community-universal-mac-macosx10.9: success
  • try-community-x86-linux-debian8: success
  • try-community-x86_64-linux-debian8: success
  • try-community-x86-win32: success
  • try-community-x86_64-win32: success

@runrevmark
runrevmark merged commit 38375c4 into livecode:develop May 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants