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

Update MediaBrowserService.cs #895

Merged
merged 1 commit into from
Mar 16, 2023

Conversation

BajakiGabesz
Copy link
Contributor

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

It is a bugfix related to Android MediaBrowserService which causes an instant crash when starting the foreground process on Android Pie and maybe others too.

⤵️ What is the current behavior?

The application crashes as soon as trying to create a notification on some systems.

🆕 What is the new behavior (if this is a feature change)?

We don't use ForegroundService.TypeMediaPlayback when starting foreground service as it may not be known by earlier operating systems like Android Pie.

💥 Does this PR introduce a breaking change?

No.

🐛 Recommendations for testing

#894

📝 Links to relevant issues/docs

🤔 Checklist before submitting

  • All projects build
  • Follows style guide lines
  • Relevant documentation was updated
  • Rebased onto current develop

Fixed issue which causes an instant crash when starting foreground process on Android Pie and maybe others too.
@martijn00 martijn00 merged commit de3cc72 into Baseflow:develop Mar 16, 2023
@martijn00
Copy link
Member

@BajakiGabesz thanks. Do you have a clue about: https://github.com/Baseflow/XamarinMediaManager/blob/develop/MediaManager/Platforms/Android/MediaSession/MediaBrowserService.cs#L17

Does ForegroundServiceType = ForegroundService.TypeMediaPlayback work on older devices as well?

@BajakiGabesz
Copy link
Contributor Author

BajakiGabesz commented Mar 16, 2023

@BajakiGabesz thanks. Do you have a clue about: https://github.com/Baseflow/XamarinMediaManager/blob/develop/MediaManager/Platforms/Android/MediaSession/MediaBrowserService.cs#L17

Does ForegroundServiceType = ForegroundService.TypeMediaPlayback work on older devices as well?

@martijn00 that one was not causing any issues on my physical device, only that line does which I just modified.

I just checked it in multiple emulators for now from API 28 to API 30 and everything works fine. I only have API 31 and API 28 physical devices.

@BajakiGabesz BajakiGabesz deleted the 894-crash_at_startup branch March 16, 2023 17:42
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.

None yet

2 participants