The onStop() method offered by the Media Projection Callback is currently empty. When the user stops the screen recording from the OS notification, the service doesn't stop.
On the onStop callback, call the onDestroy() so that the service is stopped and the callOnComplete flow is triggered.
Additional context
For Android users, the OS notification is prominent and a go-to way to stop the screen recording, making it difficult to react with the current implementation.