Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance service lifecycle and exit strategy (#2039)
* Enhance service lifecycle and exit strategy - Updated `AndroidManifest.xml` to improve `CommunityToolkit.Maui.Media.Services` behavior. Added `android:stopWithTask=true` and `android:foregroundServiceType=mediaPlayback` attributes to ensure the service stops with the task and properly manages media playback in the foreground. - Added `OnDestroy()` method in `MediaControlsService.android.cs` for a more aggressive shutdown approach. This includes logging service destruction, stopping and removing the service from the foreground, finishing and removing the task, exiting the application, and ensuring base class cleanup with `base.OnDestroy()`. This aims at a cleaner exit and resource management when the service is destroyed. * Fix Merge error --------- Co-authored-by: Brandon Minnick <[email protected]> Co-authored-by: Gerald Versluis <[email protected]>
- Loading branch information