diff --git a/app/src/main/kotlin/com/google/samples/apps/nowinandroid/util/ProfileVerifierLogger.kt b/app/src/main/kotlin/com/google/samples/apps/nowinandroid/util/ProfileVerifierLogger.kt index 9794a7b9e..4b7e59827 100644 --- a/app/src/main/kotlin/com/google/samples/apps/nowinandroid/util/ProfileVerifierLogger.kt +++ b/app/src/main/kotlin/com/google/samples/apps/nowinandroid/util/ProfileVerifierLogger.kt @@ -46,14 +46,15 @@ import kotlinx.coroutines.launch * * @see androidx.profileinstaller.ProfileVerifier.CompilationStatus.ResultCode */ -class ProfileVerifierLogger ( - private val scope: CoroutineScope, -) { - companion object { - private const val TAG = "ProfileInstaller" +object ProfileVerifierLogger { + private const val TAG = "ProfileInstaller" + private var scope: CoroutineScope? = null + + fun setScope(scope: CoroutineScope) { + this.scope = scope } - operator fun invoke() = scope.launch { + fun start() = scope?.launch { val status = ProfileVerifier.getCompilationStatusAsync().await() Log.d(TAG, "Status code: ${status.profileInstallResultCode}") Log.d(