[Trimming] Update value managers for annotated peer activation#11436
Open
simonrozsival wants to merge 5 commits into
Open
[Trimming] Update value managers for annotated peer activation#11436simonrozsival wants to merge 5 commits into
simonrozsival wants to merge 5 commits into
Conversation
Update the Java.Interop submodule to the reviewed ActivatePeer signature change and clean up the AndroidRuntime override formatting. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates .NET for Android value manager peer activation to align with the annotated JniValueManager.ActivatePeer signature, reducing reliance on reflection-based activation paths that required trimming suppressions.
Changes:
- Removed the local reflection-based
ActivatePeeroverride fromSimpleValueManager. - Updated
JavaMarshalValueManagerandAndroidRuntime.AndroidValueManagerto the newActivatePeer(JniObjectReference, Type, ConstructorInfo, object?[]?)signature, including appropriateDynamicallyAccessedMembersannotations. - Added a runtime guard in
JavaMarshalValueManager.ActivatePeerfor theTrimmableTypeMapfeature switch.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Mono.Android/Microsoft.Android.Runtime/SimpleValueManager.cs | Removes the reflection-based activation override (and associated trimming suppressions). |
| src/Mono.Android/Microsoft.Android.Runtime/JavaMarshalValueManager.cs | Updates ActivatePeer override signature and adds a TrimmableTypeMap guard before delegating to base. |
| src/Mono.Android/Android.Runtime/AndroidRuntime.cs | Updates AndroidValueManager.ActivatePeer override signature with constructor DAM annotations. |
Keep this Android change independent until the Java.Interop ActivatePeer API update flows into dotnet/android through Maestro. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Bumps [external/Java.Interop](https://github.com/dotnet/java-interop) from `d3636b4` to `d546a08`. - [Commits](dotnet/java-interop@d3636b4...d546a08) --- updated-dependencies: - dependency-name: external/Java.Interop dependency-version: d546a083f3139243243959fbf1d9b7d35f6c2cbf dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
JniValueManager.ActivatePeer()signaturePart of #10794
Supersedes #11447 - includes the java.interop version bump to include dotnet/java-interop#1429
Validation
external/Java.Interopsubmodule revision because the requiredJniValueManager.ActivatePeer()API change has not flowed yet../dotnet-local.sh build src/Mono.Android/Mono.Android.csproj -v:minimal -nr:falsesucceeded and no IL/trimming warnings (IL####) were found in the build log.