A foreground service is required for screen capture on API level Q (29) and up. This a simple default foreground service to display a notification while screen capturing.