[One .NET] Don't always preserve Android.Runtime.AndroidEnvironment (#5362)

Context: https://github.com/xamarin/xamarin-android/issues/5167
Context: https://github.com/xamarin/xamarin-android/issues/5361

The `Android.Runtime.AndroidEnvironment` type is not accessed by
reflection *in .NET 6*, and thus does not need to be fully preserved
by the linker *in .NET 6*.  (Many of these members *are* used via
reflection from mono/2020-02.)

Allowing `AndroidEnvironment` to be linked allows for multiple
members to be removed, e.g. for the `BuildReleaseArm64False` test:

	Type Android.Runtime.AndroidEnvironment
	  -             Field public static string AndroidLogAppName
	  -             Field static Javax.Net.Ssl.IX509TrustManager sslTrustManager
	  -             Field static Java.Security.KeyStore certStore
	  -             Method static SIGERR SetupTrustManager ()
	  -             Method static SIGERR SetupCertStore ()
	  -             Method public static SIGERR add_UnhandledExceptionRaiser (System.EventHandler`1<Android.Runtime.RaiseThrowableEventArgs>)
	  -             Method public static SIGERR remove_UnhandledExceptionRaiser (System.EventHandler`1<Android.Runtime.RaiseThrowableEventArgs>)
	  -             Method static SIGERR TrustEvaluateSsl (System.Collections.Generic.List`1<byte[]>)
	  -             Method static SIGERR CertStoreLookup (long, bool)
	  -             Method static SIGERR GetX509CertificateFactory ()
	  -             Method static SIGERR ConvertCertificate (Java.Security.Cert.CertificateFactory, byte[])
	  -             Method static SIGERR NotifyTimeZoneChanged ()
	  -             Method static SIGERR GetDisplayDPI (float&, float&)
	  -             Method static SIGERR GetDefaultTimeZone ()
	  -             Method static SIGERR _monodroid_timezone_get_default_id ()
	  -             Method static SIGERR GetDefaultSyncContext ()
	  -             Method static SIGERR _monodroid_getifaddrs (IntPtr&)
	  -             Method static SIGERR GetInterfaceAddresses (IntPtr&)
	  -             Method static SIGERR _monodroid_freeifaddrs (IntPtr)
	  -             Method static SIGERR FreeInterfaceAddresses (IntPtr)
	  -             Method static SIGERR _monodroid_detect_cpu_and_architecture (ushort&, ushort&, byte&)
	  -             Method static SIGERR DetectCPUAndArchitecture (ushort&, ushort&, bool&)
	  -             Method static SIGERR GetDefaultProxy ()
	  -             Method static SIGERR GetHttpMessageHandler ()
	  -             Type _Proxy

The removed API is no longer needed on .NET 5+.

The template tests run OK on device after the removal.
This commit is contained in:
Radek Doulik 2020-12-09 18:13:12 +01:00 коммит произвёл GitHub
Родитель 9ad0947a25
Коммит 11f0e1bf64
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 0 добавлений и 1 удалений

Просмотреть файл

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<linker>
<assembly fullname="Mono.Android">
<type fullname="Android.Runtime.AndroidEnvironment" />
<type fullname="Android.Runtime.AnnotationAttribute" />
<type fullname="Android.Runtime.GeneratedDummyHost" />
<type fullname="Android.Runtime.GeneratedEnumAttribute" />