protoncore_android/network/data/src/main/kotlin/me/proton/core/network/data/doh
Benjamin Monjoie bd78d8069d Delay OkHttp's initialization
OkHttp's cache initialization is blocking the UI.
As per this trick: https://www.zacsweers.dev/dagger-party-tricks-deferred-okhttp-init/,
it should be better to initialize OkHttp in Retrofit's `callFactory` method.

This currently doesn't solve the issue with coroutines but has no downside either.
Indeed, the `callFactory` SAM is called on the `Dispatcher` which initiate the call.
It's often the `viewModelScope` which is using `Dispatchers.Main`.
Hopefully, an update to Retrofit will solve this issue.
2021-10-07 15:39:19 +00:00
..
DnsOverHttpsProviderRFC8484.kt Delay OkHttp's initialization 2021-10-07 15:39:19 +00:00
DnsOverHttpsRetrofitApi.kt Introducing API block avoidance based on DoH 2020-07-03 11:24:18 +00:00