Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Build.Tasks] Fix up ForegroundService.ToString() (#8412
) Fixes: #8409 Context: #8272 The [`//service/@android:foregroundServiceType`][0] attribute can be generated based on the value of the `Android.App.ServiceAttribute.ForegroundServiceType` property: [Service(ForegroundServiceType=ForegroundService.TypeCamera)] partial class MyService : Service { } which will result in an `AndroidManifest.xml` fragment such as: <service android:foregroundServiceType="camera" android:name="crc64….MyService" /> However, a number of `ForegroundService` enum values have been added without corresponding updates to `ServiceAttribute` XML generation. Consequently, using "recently added" values such as `ForegroundService.TypeHealth` would result in those values *not* being added to the generated `//service/@android:foregroundServiceType`. Update `ManifestDocumentElement.cs` to update `ToString(ForegroundService)` so that all current `ForegroundService` enum values are supported. This will allow: [Service(ForegroundServiceType= ForegroundService.TypeCamera | // previously supported ForegroundService.TypeMicrophone)] // new hawtness partial class MyService : Service { } to properly emit: <service android:foregroundServiceType="camera|microphone" android:name="crc64….MyService" /> [0]: https://developer.android.com/guide/topics/manifest/service-element#foregroundservicetype
- Loading branch information