Fix lint internal issue: remove object Params.

GetTurnServerTask.kt: Error: Unexpected failure during lint analysis of GetTurnServerTask.kt (this is a bug in lint or one of the libraries it depends on)
This commit is contained in:
Benoit Marty 2022-05-11 10:22:07 +02:00
parent 5ad2567633
commit ff386c3de6
2 changed files with 8 additions and 8 deletions

View file

@ -22,16 +22,16 @@ import org.matrix.android.sdk.internal.network.executeRequest
import org.matrix.android.sdk.internal.task.Task
import javax.inject.Inject
internal abstract class GetTurnServerTask : Task<GetTurnServerTask.Params, TurnServerResponse> {
object Params
}
internal abstract class GetTurnServerTask : Task<Unit, TurnServerResponse>
internal class DefaultGetTurnServerTask @Inject constructor(private val voipAPI: VoipApi,
private val globalErrorReceiver: GlobalErrorReceiver) : GetTurnServerTask() {
internal class DefaultGetTurnServerTask @Inject constructor(
private val voipApi: VoipApi,
private val globalErrorReceiver: GlobalErrorReceiver
) : GetTurnServerTask() {
override suspend fun execute(params: Params): TurnServerResponse {
override suspend fun execute(params: Unit): TurnServerResponse {
return executeRequest(globalErrorReceiver) {
voipAPI.getTurnServer()
voipApi.getTurnServer()
}
}
}

View file

@ -39,7 +39,7 @@ internal class TurnServerDataSource @Inject constructor(private val turnServerTa
}
suspend fun getTurnServer(): TurnServerResponse {
return cachedTurnServerResponse.data ?: turnServerTask.execute(GetTurnServerTask.Params).also {
return cachedTurnServerResponse.data ?: turnServerTask.execute(Unit).also {
cachedTurnServerResponse.data = it
}
}