This branch was built on top of https://github.com/mattprecious/telescope/pull/76, to leverage the version bumps and also the crash reproducibility.
Please consider merging that PR (it also means the diff for this one is smaller than it looks).
You can follow the commit history for easier understanding of the changes, but in summary:
Adds a subclass of Service, updates the AndroidManifest to refer to it and adds the FOREGROUND_SERVICE permission
Starts the foreground service (Q and above only) when a request for capture is triggered (posting the notification), and keeps it until the screenshot is saved, stopping it afterwards.
Open question: Since the foreground service requires a notification, and thus a notification channel, I hardcoded some values for simplicity (like notification channel name, service ID, notification ID, and didn't define a notification icon). Is this something users of the library absolutely care about, and if so, would it be worth providing a public API via telescope's configuration methods to define them?
Fixes https://github.com/mattprecious/telescope/issues/75 Follow-up to https://github.com/mattprecious/telescope/pull/77
This branch was built on top of https://github.com/mattprecious/telescope/pull/76, to leverage the version bumps and also the crash reproducibility. Please consider merging that PR (it also means the diff for this one is smaller than it looks).
You can follow the commit history for easier understanding of the changes, but in summary:
Service
, updates the AndroidManifest to refer to it and adds theFOREGROUND_SERVICE
permissionOpen question: Since the foreground service requires a notification, and thus a notification channel, I hardcoded some values for simplicity (like notification channel name, service ID, notification ID, and didn't define a notification icon). Is this something users of the library absolutely care about, and if so, would it be worth providing a public API via telescope's configuration methods to define them?