Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

validcube
Copy link

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

@axoroll7
Copy link

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 ?
No semicolon for startForeground, and keep <manifest ..> the way it was written.

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"
Copy link
Contributor

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);
Copy link
Contributor

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.

@emersion
Copy link
Contributor

Ref #89

@emersion
Copy link
Contributor

This PR has been superseded by #89, I believe.

@validcube
Copy link
Author

validcube commented Aug 15, 2024

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.

@validcube validcube closed this Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants