diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml
index 979f6e1b52e..9c772956a3b 100644
--- a/build-tools/automation/azure-pipelines.yaml
+++ b/build-tools/automation/azure-pipelines.yaml
@@ -379,7 +379,7 @@ stages:
testName: Mono.Android_Tests-Aot
project: tests/Mono.Android-Tests/Mono.Android-Tests.csproj
testResultsFiles: TestResult-Mono.Android_Tests-$(ApkTestConfiguration)-Aot.xml
- extraBuildArgs: /p:AotAssemblies=True /p:EnableLlvm=True
+ extraBuildArgs: /p:AotAssemblies=True /p:EnableLLVM=True
artifactSource: bin/Test$(ApkTestConfiguration)/Mono.Android_Tests-Signed.apk
artifactFolder: AotLlvm
@@ -691,13 +691,15 @@ stages:
- template: yaml-templates/apk-instrumentation.yaml
parameters:
- # TODO: disable LLVM test, see: https://github.com/dotnet/runtime/issues/68914
+ # TODO: disable LLVM test, see:
+ # https://github.com/dotnet/runtime/issues/68914
+ # https://github.com/dotnet/runtime/issues/73304
condition: false
configuration: $(XA.Build.Configuration)
testName: Mono.Android.NET_Tests-AotLlvm
project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)AotLlvm.xml
- extraBuildArgs: -p:TestsFlavor=AotLlvm -p:EnableLlvm=true
+ extraBuildArgs: -p:TestsFlavor=AotLlvm -p:EnableLLVM=true -p:AndroidEnableProfiledAot=false
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
artifactFolder: $(DotNetTargetFramework)-AotLlvm
useDotNet: true
diff --git a/src/Mono.Android/Android.Runtime/JNIEnv.cs b/src/Mono.Android/Android.Runtime/JNIEnv.cs
index 36c2e476340..3d1a5cde5e1 100644
--- a/src/Mono.Android/Android.Runtime/JNIEnv.cs
+++ b/src/Mono.Android/Android.Runtime/JNIEnv.cs
@@ -198,10 +198,17 @@ internal static unsafe void Initialize (JnienvInitializeArgs* args)
}
#if !MONOANDROID1_0
- SynchronizationContext.SetSynchronizationContext (Android.App.Application.SynchronizationContext);
+ SetSynchronizationContext ();
#endif
}
+#if !MONOANDROID1_0
+ // NOTE: prevents Android.App.Application static ctor from running
+ [MethodImpl (MethodImplOptions.NoInlining)]
+ static void SetSynchronizationContext () =>
+ SynchronizationContext.SetSynchronizationContext (Android.App.Application.SynchronizationContext);
+#endif
+
internal static void Exit ()
{
/* Manually dispose surfaced objects and close the current JniEnvironment to
diff --git a/tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj b/tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
index 22d9dce4925..2460510dca5 100644
--- a/tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
+++ b/tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
@@ -21,10 +21,10 @@
IL2037
DotNetIgnore
- $(ExcludeCategories):InetAccess
+ $(ExcludeCategories):InetAccess
$(ExcludeCategories):IgnoreInterpreter