Skip to content

uses-feature.version should be settable according to android documentation - #10890

Merged
jonathanpeppers merged 2 commits into
dotnet:mainfrom
Happypig375:patch-1
Mar 6, 2026
Merged

uses-feature.version should be settable according to android documentation#10890
jonathanpeppers merged 2 commits into
dotnet:mainfrom
Happypig375:patch-1

Conversation

@Happypig375

@Happypig375 Happypig375 commented Mar 5, 2026

Copy link
Copy Markdown
Member

https://developer.android.com/guide/topics/manifest/uses-feature-element#hw-features
version is used for vulkan features. This attribute operates similarly to glEsVersion and therefore should be similarly settable.

There is no other way to use this attribute property currently aside from reflection.

Copilot AI review requested due to automatic review settings March 5, 2026 16:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables setting the Android manifest <uses-feature android:version="..."> attribute via Android.App.UsesFeatureAttribute, aligning with Android documentation (notably for Vulkan feature version requirements).

Changes:

  • Make UsesFeatureAttribute.Version publicly settable and wire it into the manifest mapping loader.
  • Update manifest-attribute-codegen metadata so uses-feature.version is generated as writable/visible.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Mono.Android/Android.App/UsesFeatureAttribute.cs Makes Version settable and adds a mapping setter so values specified in attributes are applied during manifest generation.
build-tools/manifest-attribute-codegen/metadata.xml Changes metadata so uses-feature.version is no longer read-only (generated as writable).
Comments suppressed due to low confidence (1)

src/Mono.Android/Android.App/UsesFeatureAttribute.cs:33

  • Making UsesFeatureAttribute.Version settable enables android:version emission, but manifest merging/deduplication currently treats <uses-feature> entries as unique only by Name or glEsVersion (see ManifestDocument.AddUsesFeatures). If an existing manifest already contains the same android:name (or multiple assemblies specify it), the new version value can be dropped, producing an incorrect manifest for Vulkan features. Consider updating the dedupe logic to also account for Version (and likely Required) or to merge/replace existing entries when version differs.
	public int Version { get; set; }

#if XABT_MANIFEST_EXTENSIONS
	static Xamarin.Android.Manifest.ManifestDocumentElement<UsesFeatureAttribute> mapping = new ("uses-feature");


You can also share your feedback on Copilot code review. Take the survey.

@jonathanpeppers jonathanpeppers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonathanpeppers
jonathanpeppers enabled auto-merge (squash) March 5, 2026 22:47
@jonathanpeppers
jonathanpeppers disabled auto-merge March 6, 2026 14:17
@jonathanpeppers
jonathanpeppers merged commit 35ce332 into dotnet:main Mar 6, 2026
31 of 33 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants