stopAsync

fun stopAsync(reason: StopReason = StopReason.UserRequested, callback: Consumer<Unit> = Consumer {})

Java-friendly counterpart to stop; the callback is invoked on a background thread when the stop attempt completes, whether or not it succeeded. Callers that need teardown to run unconditionally (e.g. releasing a foreground service pin) can rely on the callback firing even if provider's stop throws.