You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes: #10381
This PR removes obsolete managed code that references
`System.AndroidPlatform`, which was part of the Xamarin.Android runtime
but was never used in modern .NET. The issue was identified by
@filipnavara and confirmed safe to remove by @jonathanpeppers after
verifying that these APIs don't exist in dotnet/runtime.
## Changes Made
**Removed Methods from AndroidEnvironment.cs:**
- `GetDisplayDPI()` - Previously called by
`System.Drawing.GraphicsAndroid.FromAndroidSurface()` (already
marked as obsolete for android31.0)
- `GetDefaultTimeZone()` - Previously called by
`System.Core!System.AndroidPlatform.GetDefaultTimeZone()`
- `GetDefaultSyncContext()` - Previously called by
`mscorlib.dll!System.AndroidPlatform.GetDefaultSyncContext()`
- `GetInterfaceAddresses()` - Previously called by
`System.dll!System.AndroidPlatform.getifaddrs`
- `FreeInterfaceAddresses()` - Previously called by
`System.dll!System.AndroidPlatform.freeifaddrs`
- `GetDefaultProxy()` - Previously called by
`System.dll!System.AndroidPlatform.GetDefaultProxy()`
**Additional Cleanup:**
- Removed the `_Proxy` class that was only used by `GetDefaultProxy()`
- Removed unused P/Invoke declarations from `RuntimeNativeMethods.cs`:
- `_monodroid_timezone_get_default_id()`
- `_monodroid_getifaddrs()`
- `_monodroid_freeifaddrs()`
**Native Code Cleanup:**
- Removed P/Invoke method entries from both CLR and Mono P/Invoke
table generators
- Regenerated P/Invoke tables using `generate-pinvoke-tables.sh`
- Removed unused native C++ implementations:
- `_monodroid_timezone_get_default_id()` functions (CLR & Mono)
- Complete `xamarin_getifaddrs.cc` files and header (CLR & Mono -
2,200+ lines)
- Updated CMakeLists.txt files to remove build references
- Fixed linker error by removing obsolete symbols from Mono version
script
## Impact
This is a **breaking change** that removes internal APIs that were
never intended for public use in modern .NET for Android. No external
code should be affected as these were internal implementation details
for obsolete `System.AndroidPlatform` methods.
Co-authored-by: Jonathan Peppers <[email protected]>
0 commit comments