NSCLIENT mode: do not create local profile switch
This commit is contained in:
parent
45b58719a6
commit
9f1a87110d
1 changed files with 10 additions and 3 deletions
|
@ -64,7 +64,8 @@ class CommandQueue @Inject constructor(
|
|||
private val buildHelper: BuildHelper,
|
||||
private val dateUtil: DateUtil,
|
||||
private val repository: AppRepository,
|
||||
private val fabricPrivacy: FabricPrivacy
|
||||
private val fabricPrivacy: FabricPrivacy,
|
||||
private val config: Config
|
||||
) : CommandQueueProvider {
|
||||
|
||||
private val disposable = CompositeDisposable()
|
||||
|
@ -79,6 +80,10 @@ class CommandQueue @Inject constructor(
|
|||
.toObservable(EventProfileSwitchChanged::class.java)
|
||||
.observeOn(aapsSchedulers.io)
|
||||
.subscribe({
|
||||
if (config.NSCLIENT) { // Effective profileswitch should be synced over NS
|
||||
rxBus.send(EventNewBasalProfile())
|
||||
return@subscribe
|
||||
}
|
||||
aapsLogger.debug(LTag.PROFILE, "onProfileSwitch")
|
||||
profileFunction.getRequestedProfile()?.let {
|
||||
val nonCustomized = ProfileSealed.PS(it).convertToNonCustomizedProfile(dateUtil)
|
||||
|
@ -173,7 +178,7 @@ class CommandQueue @Inject constructor(
|
|||
// After new command added to the queue
|
||||
// start thread again if not already running
|
||||
@Synchronized
|
||||
open fun notifyAboutNewCommand() {
|
||||
fun notifyAboutNewCommand() {
|
||||
waitForFinishedThread()
|
||||
if (thread == null || thread!!.state == Thread.State.TERMINATED) {
|
||||
thread = QueueThread(this, context, aapsLogger, rxBus, activePlugin, resourceHelper, sp)
|
||||
|
@ -195,7 +200,9 @@ class CommandQueue @Inject constructor(
|
|||
|
||||
override fun independentConnect(reason: String, callback: Callback?) {
|
||||
aapsLogger.debug(LTag.PUMPQUEUE, "Starting new queue")
|
||||
val tempCommandQueue = CommandQueue(injector, aapsLogger, rxBus, aapsSchedulers, resourceHelper, constraintChecker, profileFunction, activePlugin, context, sp, buildHelper, dateUtil, repository, fabricPrivacy)
|
||||
val tempCommandQueue = CommandQueue(injector, aapsLogger, rxBus, aapsSchedulers, resourceHelper,
|
||||
constraintChecker, profileFunction, activePlugin, context, sp,
|
||||
buildHelper, dateUtil, repository, fabricPrivacy, config)
|
||||
tempCommandQueue.readStatus(reason, callback)
|
||||
tempCommandQueue.disposable.clear()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue