Fix compilation warning after bump kotlin-gradle-plugin from 1.6.0 to 1.6.21

This commit is contained in:
Benoit Marty 2022-05-10 16:19:53 +02:00
parent 67cd82385a
commit fe8648c7f8
9 changed files with 18 additions and 3 deletions

View file

@ -50,6 +50,7 @@ import im.vector.app.features.settings.VectorPreferences
import im.vector.app.features.ui.SharedPreferencesUiStateRepository
import im.vector.app.features.ui.UiStateRepository
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.SupervisorJob
@ -173,7 +174,7 @@ object VectorStaticModule {
return CoroutineDispatchers(io = Dispatchers.IO, computation = Dispatchers.Default)
}
@Suppress("EXPERIMENTAL_API_USAGE")
@OptIn(DelicateCoroutinesApi::class)
@Provides
@NamedGlobalScope
fun providesGlobalScope(): CoroutineScope {

View file

@ -157,12 +157,14 @@ class LoginCaptchaFragment @Inject constructor(
}
}
@Deprecated("Deprecated in Java")
override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
@Suppress("DEPRECATION")
super.onReceivedError(view, errorCode, description, failingUrl)
onError(description)
}
@Deprecated("Deprecated in Java")
override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
if (url?.startsWith("js:") == true) {
var json = url.substring(3)

View file

@ -141,6 +141,7 @@ class LoginWebFragment @Inject constructor(
.show()
}
@Deprecated("Deprecated in Java")
override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
super.onReceivedError(view, errorCode, description, failingUrl)
@ -193,6 +194,7 @@ class LoginWebFragment @Inject constructor(
* @param url
* @return
*/
@Deprecated("Deprecated in Java")
override fun shouldOverrideUrlLoading(view: WebView, url: String?): Boolean {
if (url == null) return super.shouldOverrideUrlLoading(view, url as String?)

View file

@ -152,12 +152,14 @@ class LoginCaptchaFragment2 @Inject constructor(
}
}
@Deprecated("Deprecated in Java")
override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
@Suppress("DEPRECATION")
super.onReceivedError(view, errorCode, description, failingUrl)
onError(description)
}
@Deprecated("Deprecated in Java")
override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
if (url?.startsWith("js:") == true) {
var json = url.substring(3)

View file

@ -142,6 +142,7 @@ class LoginWebFragment2 @Inject constructor(
.show()
}
@Deprecated("Deprecated in Java")
override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
super.onReceivedError(view, errorCode, description, failingUrl)
@ -194,6 +195,7 @@ class LoginWebFragment2 @Inject constructor(
* @param url
* @return
*/
@Deprecated("Deprecated in Java")
override fun shouldOverrideUrlLoading(view: WebView, url: String?): Boolean {
if (url == null) return super.shouldOverrideUrlLoading(view, url as String?)

View file

@ -103,12 +103,14 @@ class CaptchaWebview @Inject constructor(
}
}
@Deprecated("Deprecated in Java")
override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
@Suppress("DEPRECATION")
super.onReceivedError(view, errorCode, description, failingUrl)
onError(description)
}
@Deprecated("Deprecated in Java")
override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
if (url?.startsWith("js:") == true) {
val javascriptResponse = parseJsonFromUrl(url)

View file

@ -138,6 +138,7 @@ class FtueAuthWebFragment @Inject constructor(
.show()
}
@Deprecated("Deprecated in Java")
override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
super.onReceivedError(view, errorCode, description, failingUrl)
@ -190,6 +191,7 @@ class FtueAuthWebFragment @Inject constructor(
* @param url
* @return
*/
@Deprecated("Deprecated in Java")
override fun shouldOverrideUrlLoading(view: WebView, url: String?): Boolean {
if (url == null) return super.shouldOverrideUrlLoading(view, url as String?)

View file

@ -22,6 +22,7 @@ import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import im.vector.app.features.settings.VectorPreferences
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import timber.log.Timber
@ -59,7 +60,7 @@ class PinLocker @Inject constructor(
return liveState
}
@Suppress("EXPERIMENTAL_API_USAGE")
@OptIn(DelicateCoroutinesApi::class)
private fun computeState() {
GlobalScope.launch {
val state = if (shouldBeLocked && pinCodeStore.hasEncodedPin()) {

View file

@ -19,6 +19,7 @@ package im.vector.app.features.rageshake
import android.content.Context
import android.util.Log
import im.vector.app.features.settings.VectorPreferences
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
@ -88,7 +89,7 @@ class VectorFileLogger @Inject constructor(
}
}
@Suppress("EXPERIMENTAL_API_USAGE")
@OptIn(DelicateCoroutinesApi::class)
override fun log(priority: Int, tag: String?, message: String, t: Throwable?) {
fileHandler ?: return
GlobalScope.launch(Dispatchers.IO) {