remove unused params

This commit is contained in:
Milos Kozak 2023-10-21 11:24:17 +02:00
parent 7d4492d179
commit 24bdf92270

View file

@ -188,7 +188,7 @@ class NSClientV3Plugin @Inject constructor(
) )
) )
setClient("START") setClient()
receiverDelegate.grabReceiversState() receiverDelegate.grabReceiversState()
disposable += rxBus disposable += rxBus
@ -203,7 +203,7 @@ class NSClientV3Plugin @Inject constructor(
assert(nsClientV3Service != null) assert(nsClientV3Service != null)
if (ev.connected) { if (ev.connected) {
when { when {
isAllowed && nsClientV3Service?.storageSocket == null -> setClient("CONNECTIVITY") // socket must be created isAllowed && nsClientV3Service?.storageSocket == null -> setClient() // socket must be created
!isAllowed && nsClientV3Service?.storageSocket != null -> stopService() !isAllowed && nsClientV3Service?.storageSocket != null -> stopService()
} }
if (isAllowed) executeLoop("CONNECTIVITY", forceNew = false) if (isAllowed) executeLoop("CONNECTIVITY", forceNew = false)
@ -222,7 +222,7 @@ class NSClientV3Plugin @Inject constructor(
ev.isChanged(rh.gs(app.aaps.core.utils.R.string.key_ns_announcements)) ev.isChanged(rh.gs(app.aaps.core.utils.R.string.key_ns_announcements))
) { ) {
stopService() stopService()
setClient("SETTING CHANGE") setClient()
} }
if (ev.isChanged(rh.gs(app.aaps.core.utils.R.string.key_local_profile_last_change))) if (ev.isChanged(rh.gs(app.aaps.core.utils.R.string.key_local_profile_last_change)))
executeUpload("PROFILE_CHANGE", forceNew = true) executeUpload("PROFILE_CHANGE", forceNew = true)
@ -338,7 +338,7 @@ class NSClientV3Plugin @Inject constructor(
} }
} }
private fun setClient(reason: String) { private fun setClient() {
if (nsAndroidClient == null) if (nsAndroidClient == null)
nsAndroidClient = NSAndroidClientImpl( nsAndroidClient = NSAndroidClientImpl(
baseUrl = sp.getString(app.aaps.core.utils.R.string.key_nsclientinternal_url, "").lowercase().replace("https://", "").replace(Regex("/$"), ""), baseUrl = sp.getString(app.aaps.core.utils.R.string.key_nsclientinternal_url, "").lowercase().replace("https://", "").replace(Regex("/$"), ""),
@ -348,11 +348,11 @@ class NSClientV3Plugin @Inject constructor(
logger = { msg -> aapsLogger.debug(LTag.HTTP, msg) } logger = { msg -> aapsLogger.debug(LTag.HTTP, msg) }
) )
SystemClock.sleep(2000) SystemClock.sleep(2000)
startService(reason) startService()
rxBus.send(EventSWSyncStatus(status)) rxBus.send(EventSWSyncStatus(status))
} }
private fun startService(reason: String) { private fun startService() {
if (sp.getBoolean(app.aaps.core.utils.R.string.key_ns_use_ws, true)) { if (sp.getBoolean(app.aaps.core.utils.R.string.key_ns_use_ws, true)) {
context.bindService(Intent(context, NSClientV3Service::class.java), serviceConnection, Context.BIND_AUTO_CREATE) context.bindService(Intent(context, NSClientV3Service::class.java), serviceConnection, Context.BIND_AUTO_CREATE)
} }