Exposed function to set digital credentials presentment mechanism fro… #1469
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…m intent (#1468)
Fixes #1468
Extracted the logic that takes a credential request and turns it into a DigitalCredentialsPresentmentMechanism so that single activity apps and apps that want to create their own visuals can still reuse that part of Multipaz. Tried to make the API surface strict enough to not complicate the logic inside but also leave little room for confusion.
Some thoughts:
Expecting consuming apps to turn the incoming intent into a ProviderGetCredentialRequest first since single activity apps will likely check whether the intent is consumable through
retrieveProviderGetCredentialRequest(intent: Intent).Expecting consuming apps to pass in a function for
setResultso that other results thanRESULT_OKis possible. This might not be needed so hoping for some feedback on this part.Tests pass
Changelog updated as it is a new public facing function
Manually tested
Commit message is as short as I could make it
Example:

In the screenshot below, I've used the introduced function to set the presentation mechanism from a view model that belongs to a single activity app. It is not a polished example but a working one showing that it allows this type of app to make use of this part of multipaz as well.