From f8eb0fabec5b6434aec1847c9de02510d2485df9 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 3 Dec 2020 13:00:20 +0100 Subject: [PATCH] [illink] Do not always preserve CharSequence Part of https://github.com/xamarin/xamarin-android/issues/5167 Added dynamic dependency where needed. Removed API from `BuildReleaseArm64False` test: Type Android.Runtime.CharSequence - Method public static SIGERR ToLocalJniHandle (System.Collections.Generic.IEnumerable`1) --- src/Microsoft.Android.Sdk.ILLink/PreserveLists/Mono.Android.xml | 1 - src/Mono.Android.Export/CallbackCode.cs | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.Android.Sdk.ILLink/PreserveLists/Mono.Android.xml b/src/Microsoft.Android.Sdk.ILLink/PreserveLists/Mono.Android.xml index 4e27871023c..0093d322641 100644 --- a/src/Microsoft.Android.Sdk.ILLink/PreserveLists/Mono.Android.xml +++ b/src/Microsoft.Android.Sdk.ILLink/PreserveLists/Mono.Android.xml @@ -3,7 +3,6 @@ - diff --git a/src/Mono.Android.Export/CallbackCode.cs b/src/Mono.Android.Export/CallbackCode.cs index c438a757503..6942414b682 100644 --- a/src/Mono.Android.Export/CallbackCode.cs +++ b/src/Mono.Android.Export/CallbackCode.cs @@ -26,6 +26,7 @@ class DynamicInvokeTypeInfo // NewArray(T[]) static readonly MethodInfo jnienv_newarray = GetTArrayToIntPtr (JNIEnv.NewArray); static readonly MethodInfo jnienv_getarray = GetIntPtrToTArray (JNIEnv.GetArray); + [DynamicDependency ("ToLocalJniHandle", "Android.Runtime.CharSequence", "Mono.Android")] static readonly MethodInfo charsequence_tojnihandle = GetEnumerableCharToIntPtrMethodInfo (CharSequence.ToLocalJniHandle); static readonly MethodInfo jnienv_tojnihandle = GetObjectToIntPtrMethodInfo (JNIEnv.ToLocalJniHandle); static readonly MethodInfo jnienv_newstring = GetStringToIntPtrMethodInfo (JNIEnv.NewString);