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 * @see androidx.profileinstaller.ProfileVerifier.CompilationStatus.ResultCode
*/ */
class ProfileVerifierLogger ( object ProfileVerifierLogger {
private val scope: CoroutineScope, private const val TAG = "ProfileInstaller"
) { private var scope: CoroutineScope? = null
companion object {
private const val TAG = "ProfileInstaller" fun setScope(scope: CoroutineScope) {
this.scope = scope
} }
operator fun invoke() = scope.launch { fun start() = scope?.launch {
val status = ProfileVerifier.getCompilationStatusAsync().await() val status = ProfileVerifier.getCompilationStatusAsync().await()
Log.d(TAG, "Status code: ${status.profileInstallResultCode}") Log.d(TAG, "Status code: ${status.profileInstallResultCode}")
Log.d( Log.d(

Loading…
Cancel
Save