refactor: make LNbitsHttpClient.instance internal

This commit is contained in:
2026-06-12 12:25:30 +02:00
parent 4694b6d44e
commit 16e955e553
@@ -4,12 +4,13 @@ import com.bitcointxoko.gudariwallet.util.WalletConstants
import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit
/**
* Single shared OkHttpClient for the entire app.
* Used by both LNbitsClient (Retrofit) and WalletNotificationService (WebSocket).
*/
// internal = visible within this Gradle module only.
// Intentionally not private: WalletNotificationService accesses this
// directly because Android instantiates Services via reflection —
// constructor injection is not possible. All other consumers must use
// LNbitsClient.api instead.
object LNbitsHttpClient {
val instance: OkHttpClient = OkHttpClient.Builder()
internal val instance: OkHttpClient = OkHttpClient.Builder()
.connectTimeout(WalletConstants.CONNECT_TIMEOUT_S, TimeUnit.SECONDS)
.readTimeout(WalletConstants.READ_TIMEOUT_S, TimeUnit.SECONDS)
.writeTimeout(WalletConstants.WRITE_TIMEOUT_S, TimeUnit.SECONDS)