Skip to content

internal: Android working permission helper - #2898

Closed
pkar70 wants to merge 4 commits into
unoplatform:masterfrom
pkar70:PermissionHelper
Closed

pkar70 wants to merge 4 commits into
unoplatform:masterfrom
pkar70:PermissionHelper

Conversation

@pkar70

@pkar70 pkar70 commented Mar 29, 2020

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): #

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
    All of above, and - at same time - none of above :)

What is the current behavior?

Current implementation of Android permission helper functions doesn't work.
Currently there is no possibility to invoke system dialog asking for permission from Uno code (e.g. from RequestAccessAsync methods).
So, PR#2024 (geolocator) is labelled as 'help needed' (to split code into levels - as was said in Lobby or in some comments), also PR#2544 (contacts), PR#2757 (calllog), and soon-to-be PR (SMS access) cannot be fully implemented (some code have to be included in app code, not inside Uno).

What is the new behavior?

New helper methods works inside Uno, and can invoke system dialog asking for permission.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

I made it as separate PR, to be used in all four PRs mentioned above, as code is common (and I don't want contacts-PR be dependend on e.g. geolocator PR). Also, it can be used from other Uno PRs and from user code.

I don't edit/modify current Android methods in permissionhelper.cs, as they can be somewhere used (structure of these methods are cumbersome, too complicated for me).

Internal Issue (If applicable):

@gitpod-io

gitpod-io Bot commented Mar 29, 2020 •

Copy link
Copy Markdown

@jeromelaban

Copy link
Copy Markdown
Member

Thanks for your contribution. Can you add ui tests for it so we can validate that it works as it should ?

@pkar70

pkar70 commented Apr 4, 2020

Copy link
Copy Markdown
Contributor Author

Which folder should I use for such test?
It is Windows.Extensions.PermissionHelper class, Android only.

@jeromelaban

jeromelaban commented Apr 5, 2020 •

Copy link
Copy Markdown
Member

Use the namespace name, separated by _ as mentioned here: https://github.com/unoplatform/uno/blob/master/doc/articles/uno-development/working-with-the-samples-apps.md#creating-ui-tests

GitHub
Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported. - unoplatform/uno

@pkar70

pkar70 commented Apr 5, 2020

Copy link
Copy Markdown
Contributor Author

Could you please specify which folder, and not refer to document that is not related to my question?
E.g.: should test be placed in shared, or in android?

@jeromelaban

Copy link
Copy Markdown
Member

The document I'm referring to is related to your question, and you can place it where any other test is located. Use #if __ANDROID__ to exclude the platform specific code.

@pkar70

pkar70 commented Apr 6, 2020

Copy link
Copy Markdown
Contributor Author

After adding test, I got three conflicts - I do know how to resolve AndroidManifest.xml, but doesn't have any clue how to resolve two others.
I tried to
git rebase unoplatform/master
git rebase -i unoplatform/master
git push -f
but I got
Current branch PermissionHelper is up to date.
Successfully rebased and updated refs/heads/PermissionHelper
Everything up-to-date

@pkar70
pkar70 force-pushed the PermissionHelper branch from 928d242 to 9bf741e Compare April 8, 2020 12:13
@pkar70

pkar70 commented Apr 8, 2020

Copy link
Copy Markdown
Contributor Author

Will be reopened

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants