From a1ef8d9446d744a44f360e6f40d3ffbfc4af2836 Mon Sep 17 00:00:00 2001 From: Arnau Mora Date: Wed, 10 Apr 2024 15:01:09 +0200 Subject: [PATCH] Added missing overrides Signed-off-by: Arnau Mora Gras --- .../java/at/bitfire/icsdroid/model/ValidationModel.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/at/bitfire/icsdroid/model/ValidationModel.kt b/app/src/main/java/at/bitfire/icsdroid/model/ValidationModel.kt index 29402e9e..5aa7efb8 100644 --- a/app/src/main/java/at/bitfire/icsdroid/model/ValidationModel.kt +++ b/app/src/main/java/at/bitfire/icsdroid/model/ValidationModel.kt @@ -18,12 +18,12 @@ import at.bitfire.icsdroid.Constants import at.bitfire.icsdroid.HttpUtils.toURI import at.bitfire.icsdroid.HttpUtils.toUri import at.bitfire.icsdroid.ui.ResourceInfo +import java.io.InputStream +import java.io.InputStreamReader import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import net.fortuna.ical4j.model.property.Color import okhttp3.MediaType -import java.io.InputStream -import java.io.InputStreamReader class ValidationModel(application: Application): AndroidViewModel(application) { @@ -43,7 +43,7 @@ class ValidationModel(application: Application): AndroidViewModel(application) { val info = ResourceInfo(originalUri) val downloader = object: CalendarFetcher(getApplication(), originalUri) { - override fun onSuccess( + override suspend fun onSuccess( data: InputStream, contentType: MediaType?, eTag: String?, @@ -75,13 +75,13 @@ class ValidationModel(application: Application): AndroidViewModel(application) { result.postValue(info) } - override fun onNewPermanentUrl(target: Uri) { + override suspend fun onNewPermanentUrl(target: Uri) { Log.i(Constants.TAG, "Got permanent redirect when validating, saving new URL: $target") val location = uri.toURI().resolve(target.toURI()) info.uri = location.toUri() } - override fun onError(error: Exception) { + override suspend fun onError(error: Exception) { Log.e(Constants.TAG, "Couldn't validate calendar", error) info.exception = error result.postValue(info)