Update ReviewPromptController.kt

pull/76/head
bbigam 4 years ago committed by GitHub
parent a33d070781
commit 61a440b4df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,7 +7,6 @@ package org.mozilla.fenix.components
import android.app.Activity
import android.content.Context
import androidx.annotation.VisibleForTesting
import com.google.android.play.core.review.ReviewManagerFactory
import kotlinx.coroutines.Dispatchers.Main
import kotlinx.coroutines.withContext
import org.mozilla.fenix.utils.Settings
@ -44,17 +43,7 @@ class ReviewPromptController(
private val context: Context,
private val reviewSettings: ReviewSettings,
private val timeNowInMillis: () -> Long = { System.currentTimeMillis() },
private val tryPromptReview: suspend (Activity) -> Unit = { activity ->
val manager = ReviewManagerFactory.create(context)
val flow = manager.requestReviewFlow()
withContext(Main) {
flow.addOnCompleteListener {
if (it.isSuccessful) {
manager.launchReviewFlow(activity, it.result)
}
}
}
private val tryPromptReview: suspend (Activity) -> Unit = { _ ->
}
) {
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)

Loading…
Cancel
Save