Make it as singleton and create setScope and start function.

Change-Id: I842554dfa2884942a0c74a2ecd0645020238f237
pull/1493/head
Jaehwa Noh 1 year ago
parent 037d21372e
commit 81a8d87025

@ -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(

Loading…
Cancel
Save