Repository navigation
Support Color in trimmable Export signatures - #13297
Draft
simonrozsival wants to merge 2 commits into
Draft
simonrozsival wants to merge 2 commits into
simonrozsival wants to merge 2 commits into
Conversation
Map Android.Graphics.Color to Java int in [Export] signatures and marshal scalar and jagged array values through JNI. Add scanner and runtime coverage for Color exports. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b8771eaf-6e1d-4e59-86f8-4f0cb73f59fb
The updated JNI array region helpers require unsafe contexts. Keep the Color conversion paths compatible with those helpers and document the buffer and element-range guarantees. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b8771eaf-6e1d-4e59-86f8-4f0cb73f59fb
simonrozsival
force-pushed
the
simonrozsival-investigate-issue-11681
branch
from
November 4, 2026 11:52
7b22bde to
2c953b1
Compare
This branch has not been deployed
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.
Pull Request
title and
description
should follow the
commit-messages.mdworkflow documentation, and in particular should include:Context
Android.Graphics.Coloris represented as a Javaint, but the trimmable typemap did not apply that mapping to[Export]signatures. As a result, generated direct-dispatch wrappers could use the wrong JNI descriptor or lack the conversions between managedColorvalues and JNI integers. This change brings the trimmable[Export]path in line with the existing Color marshaling behavior.Fixes
#11681
Changes
The scanner now recognizes
Android.Graphics.ColorfromMono.Androidand maps it to JNII, including constructors and recursively jagged arrays. Generated dispatch wrappers convert scalar values between JNI integers andColor; runtime array copying handlesColor[]with a bulk JNI read. Tests cover generated signatures, scalar and array marshaling, deep jagged arrays with null rows, and rejection of unrelated lookalike types.Validation
make leeroy CONFIGURATION=Release— passed, 0 errors.dotnet test src/Microsoft.Android.Build.Tasks/Tests/Microsoft.Android.Build.Tasks.Tests/Microsoft.Android.Build.Tasks.Tests.csproj -v minimal --filter 'FullyQualifiedName~TrimmableTypeMapColorExportTests'— passed, 9/9../dotnet-local.sh build -t:Install -c Release tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj '-p:AdbTarget=-s emulator-5586' -p:IncludeCategories=ColorExport— passed.cd tests/Mono.Android-Tests/Mono.Android-Tests && ../../../dotnet-local.sh test Mono.Android.NET-Tests.csproj --no-build -c Release -p:IncludeCategories=ColorExport --device emulator-5586 --report-trx --results-directory ../../../bin/TestRelease/TestResults— passed, 4/4.