-
Notifications
You must be signed in to change notification settings - Fork 520
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
Fix up ForegroundService.ToString() #8412
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jonpryor
reviewed
Oct 10, 2023
src/Xamarin.Android.Build.Tasks/Utilities/ManifestDocumentElement.cs
Outdated
Show resolved
Hide resolved
Related: #8272 |
jonathanpeppers
approved these changes
Oct 11, 2023
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.
Looks good if CI is green. 👍
src/Xamarin.Android.Build.Tasks/Utilities/ManifestDocumentElement.cs
Outdated
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
grendello
added a commit
to grendello/xamarin-android
that referenced
this pull request
Oct 12, 2023
* main: [Xamarin.Android.Build.Tasks] Fix up ForegroundService.ToString() (xamarin#8412) [monodroid] Hush some messages logged by default on startup (xamarin#8414)
jonathanpeppers
pushed a commit
that referenced
this pull request
Oct 13, 2023
) 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
jonathanpeppers
pushed a commit
that referenced
this pull request
Oct 17, 2023
) 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #8409
There were a number of missing
ForegroundService
types missing in the last few releases. As a result users were not able to make use of them via theService
attribute. If they tried it would result in an emptyforegroundService
attribute.Lets fill in the missing types. We should address this in the future by using some form of code generation as outlined in #8272