refactor: make LNbitsHttpClient.instance internal
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user