From 2027c7d77dd876442d4bb700706ea62fac3f0fc7 Mon Sep 17 00:00:00 2001 From: davotoula Date: Wed, 17 Sep 2025 15:01:46 +0200 Subject: [PATCH] use default settings (64) when in emulator --- .../amethyst/service/okhttp/OkHttpClientFactory.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/okhttp/OkHttpClientFactory.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/okhttp/OkHttpClientFactory.kt index 498cffe54..ec055e448 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/okhttp/OkHttpClientFactory.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/okhttp/OkHttpClientFactory.kt @@ -37,8 +37,6 @@ class OkHttpClientFactory( const val DEFAULT_IS_MOBILE: Boolean = false const val DEFAULT_TIMEOUT_ON_WIFI_SECS: Int = 10 const val DEFAULT_TIMEOUT_ON_MOBILE_SECS: Int = 30 - const val MAX_REQUESTS_EMULATOR: Int = 32 - const val MAX_REQUESTS_DEVICE: Int = 512 private fun isEmulator(): Boolean = Build.FINGERPRINT.startsWith("generic") || @@ -62,11 +60,10 @@ class OkHttpClientFactory( val myDispatcher = Dispatcher().apply { - if (isEmulator()) { - maxRequests = MAX_REQUESTS_EMULATOR - Log.i("OkHttpClientFactory", "Emulator detected, using reduced maxRequests: $MAX_REQUESTS_EMULATOR.") + if (!isEmulator()) { + maxRequests = 512 } else { - maxRequests = MAX_REQUESTS_DEVICE + Log.i("OkHttpClientFactory", "Emulator detected, using default maxRequests: 64.") } }