Skip to content

[TrimmableTypeMap] Enable deferred Export device coverage for JCW-only shapes #11289

@simonrozsival

Description

@simonrozsival

Summary

PR #11123 adds trimmable [Export] / [ExportField] scanner, generator, and runtime dispatch support, but several end-to-end device test shapes are intentionally deferred because they currently fail before reaching the trimmable runtime path.

This issue tracks the focused follow-up needed to enable those device tests.

Missing device coverage

tests/Mono.Android-Tests/Mono.Android-Tests/Java.Interop/ExportTests.cs currently enables 9 [Export] device tests. The following shapes remain covered only by host scanner/emitter tests and need end-to-end runtime tests once the JCW side can build them:

  • enum [Export] parameter/return shapes
  • Java.Lang.ICharSequence [Export] parameter/return shapes
  • non-generic collection [Export] parameter/return shapes (IList, IDictionary, ICollection)
  • [ExportField] runtime visibility/initialization shapes

Current blocker

The generated Java callable wrapper path rejects or mishandles some of these shapes before runtime validation can execute:

  • CecilImporter.GetJniSignature returns null for some managed enum, ICharSequence, and non-generic collection shapes while generating Java callable wrappers, causing the app build to fail before the trimmable export dispatch path can be exercised.
  • [ExportField] needs separate JCW field-initializer work before runtime coverage is meaningful; current field initialization can call the exported method with the wrong static/instance shape.

Expected outcome

After fixing the JCW side:

  1. Add the deferred device tests to ExportTests.cs.
  2. Verify they pass for the legacy typemap path that defines the contract.
  3. Verify they pass for _AndroidTypeMapImplementation=trimmable + UseMonoRuntime=false.
  4. Update PR/issue references so the host scanner/emitter coverage and device coverage are aligned.

Related: #10788, #10933, #11123.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIssues that need to be assigned.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions