Q:

Stop Work Manager manually, when another event occurs

Am trying to use Work Manager to record a call in background, i am not sure if it will be able stop recording when the call is ended that when it returns to ideal.

A:

If I understand correctly, you want to kick off a Worker which records a call and starts when you get a call ? If you  must do it this way, I would use ListenableWorker and only complete the ListenableFuture that it returns when the call has ended.
Bear in mind that WorkManager imposes a 10 min execution window for a Worker so this might not be a great fit for what you want to do. Calls may go longer than 10 mins for e.g. Also, this kind of work is better modelled via dipatching the record operation to an Executor or via coroutines.

