-
Notifications
You must be signed in to change notification settings - Fork 566
Open
Labels
Milestone
Description
Part of #10788
Problem
AndroidTypeManager implements InTune/MDM support via GetReplacementTypeCore() and GetReplacementMethodInfoCore(). These handle Java library desugaring by looking up replacement types and methods via native _monodroid_lookup_replacement_type() and _monodroid_lookup_replacement_method_info() calls.
The new TrimmableTypeMapTypeManager (added in #10967) does not implement this functionality. Apps using InTune SDK or Java library desugaring will not work correctly with the trimmable typemap path.
Proposed solution
Extract the replacement logic from AndroidTypeManager into a shared base class or helper that both type managers can use. This avoids duplicating the InTune-specific code while keeping the trimmable path clean.
Key methods to share:
GetReplacementTypeCore()— looks up desugared typesGetReplacementMethodInfoCore()— maps methods to replacement implementations (instance → static conversions)GetStaticMethodFallbackTypesCore()— hardcoded desugaring patterns (Desugar*$_CC,*$-CC)
Considerations
- The native P/Invoke calls (
_monodroid_lookup_replacement_type,_monodroid_lookup_replacement_method_info) may not be trimming-safe — need to verify ManagedTypeManageralready has a non-native implementation ofGetStaticMethodFallbackTypesCore— could be reused- Consider whether InTune support is even needed in the trimmable (NativeAOT) path, or only CoreCLR
Reactions are currently unavailable