-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Service Type for IsolateHolderService #83
Conversation
Signed-off-by: Pun Butrach <pun.butrach@gmail.com>
Hello @validcube , I have a suggestion. I am not affiliated with this project, and I never helped here. Can you rewrite it to respect the general coding style of this project ? Maybe the author of this project will be more inclined to accept this pull request directly. |
<service android:name="de.julianassmann.flutter_background.IsolateHolderService" android:exported="true" /> | ||
<service | ||
android:name="de.julianassmann.flutter_background.IsolateHolderService" | ||
android:foregroundServiceType="specialUse" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users might want to customize this.
I'd suggest leave out the <service>
and ask users to set it themselves.
startForeground( | ||
1, | ||
notification, | ||
ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A better default is probably FOREGROUND_SERVICE_TYPE_MANIFEST
.
Ref #89 |
This PR has been superseded by #89, I believe. |
I honestly haven't thought about this at that time but your suggestion works better so I'll consider closing this PR – And thanks. |
Starting in Android 14, all foreground service must list at least one foreground service type for each service.
Without listing a service type, the system will raise
SecurityException
.https://developer.android.com/about/versions/14/behavior-changes-14#fgs-types