I noticed that in the compose method this observable could be binded to an activity lifecycle to do the desired unsubscription, the problem is that i am doing this in a service, so i cant use this library, or at least i dont know how to get this service lifecycle and bind the observable to it:
return bleDevice
.establishConnection(false)
.takeUntil(disconnectTriggerSubject)
//.compose(RxLifecycle.bindUntilEvent(MISSINGACTIVITYLIFECYCLE, ActivityEvent.DESTROY))
.doOnUnsubscribe(this::onDestroy)
.compose(new ConnectionSharingAdapter());
i am using RxandroidBle to scan numerous devices used as interface of for a sensoring system, all goes fine, i do this in a background service, the problem is when i stop the service i cant unsuscribe to that broadcast, i used the example provided in the repo. (UPDATED)