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 okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
/** // internal = visible within this Gradle module only.
* Single shared OkHttpClient for the entire app. // Intentionally not private: WalletNotificationService accesses this
* Used by both LNbitsClient (Retrofit) and WalletNotificationService (WebSocket). // directly because Android instantiates Services via reflection —
*/ // constructor injection is not possible. All other consumers must use
// LNbitsClient.api instead.
object LNbitsHttpClient { object LNbitsHttpClient {
val instance: OkHttpClient = OkHttpClient.Builder() internal val instance: OkHttpClient = OkHttpClient.Builder()
.connectTimeout(WalletConstants.CONNECT_TIMEOUT_S, TimeUnit.SECONDS) .connectTimeout(WalletConstants.CONNECT_TIMEOUT_S, TimeUnit.SECONDS)
.readTimeout(WalletConstants.READ_TIMEOUT_S, TimeUnit.SECONDS) .readTimeout(WalletConstants.READ_TIMEOUT_S, TimeUnit.SECONDS)
.writeTimeout(WalletConstants.WRITE_TIMEOUT_S, TimeUnit.SECONDS) .writeTimeout(WalletConstants.WRITE_TIMEOUT_S, TimeUnit.SECONDS)