Return a result from tryPromptReview instead of accepting callbacks
Categories
(Firefox for Android :: Experimentation and Telemetry, enhancement)
Tracking
()
People
(Reporter: mkozinski, Unassigned)
References
(Blocks 1 open bug)
Details
PlayStoreReviewPromptController.tryPromptReview() currently uses a mix of suspend and callback APIs. We could make the function signature cleaner and simplify the call sites if we returned a result that would allow to handle error/edge cases, instead of accepting callbacks.
This requires resolving a similar inconsistency within the function. It is a suspend fun and makes use of dispatchers. But later it carries on calling a callback based API and actually finishes early, as soon as the callback is registered. It doesn't await/suspend until the task is complete. This doesn't allow returning a result and generally doesn't allow callers to use it in true suspend/coroutines style, where you can write sequentially-looking code and add some logic that happens after the prompt was shown (or not shown).
Description
•