diff --git a/com.unity.mobile.android-logcat/Editor/Tasks/AndroidLogcatDispatcher.cs b/com.unity.mobile.android-logcat/Editor/Tasks/AndroidLogcatDispatcher.cs index 680a928c..de050dcb 100644 --- a/com.unity.mobile.android-logcat/Editor/Tasks/AndroidLogcatDispatcher.cs +++ b/com.unity.mobile.android-logcat/Editor/Tasks/AndroidLogcatDispatcher.cs @@ -20,7 +20,7 @@ private class AsyncTask internal Action integrateAction; } - CustomSampler m_Sampler; + static readonly Unity.Profiling.ProfilerMarker s_AsyncWorkMarker = new Unity.Profiling.ProfilerMarker("AndroidLogcat Async Work"); private Queue m_AsyncTaskQueue = new Queue(); private Queue m_IntegrateTaskQueue = new Queue(); @@ -52,8 +52,6 @@ internal void Initialize() m_Runtime.Update += IntegrateMainThread; ThreadPool.QueueUserWorkItem(WorkerThread); - m_Sampler = CustomSampler.Create("AndroidLogcat Async Work"); - s_MainThread = Thread.CurrentThread; } @@ -115,9 +113,9 @@ private void WorkerThread(object o) try { - m_Sampler.Begin(); + s_AsyncWorkMarker.Begin(); var result = task.asyncAction.Invoke(task.taskData); - m_Sampler.End(); + s_AsyncWorkMarker.End(); if (task.integrateAction != null) { diff --git a/com.unity.mobile.android-logcat/Tests/Editor/AndroidLogcatNetTests.cs b/com.unity.mobile.android-logcat/Tests/Editor/AndroidLogcatNetTests.cs index 83bb435e..415622b6 100644 --- a/com.unity.mobile.android-logcat/Tests/Editor/AndroidLogcatNetTests.cs +++ b/com.unity.mobile.android-logcat/Tests/Editor/AndroidLogcatNetTests.cs @@ -6,7 +6,7 @@ using NUnit.Framework; using UnityEditor; using UnityEditor.Compilation; -using Assembly = System.Reflection.Assembly; +using Unity.Android.Logcat; class AndroidLogcatNetTests { @@ -32,14 +32,14 @@ private UnityEditor.Compilation.Assembly GetLogcatAssembly() [Test] public void ValidateAssemblyReferences() { - var logcatAssembly = GetLogcatAssembly(); - var expectedReferences = new List(new[] { "mscorlib", "System", "System.Xml.Linq", "UnityEngine.IMGUIModule", + "UnityEngine.ScriptingModule", + "UnityEngine.UICommonModule", "UnityEngine.CoreModule", "UnityEngine.VideoModule", "UnityEngine.TextRenderingModule", @@ -48,11 +48,14 @@ public void ValidateAssemblyReferences() "UnityEngine.ImageConversionModule", "UnityEngine.JSONSerializeModule", "UnityEditor.CoreModule", + "Unity.Scripting", + "UnityEngine.TypeRegistryModule", }); var referencedCount = expectedReferences.ToDictionary(s => s, s => 0); - var references = Assembly.ReflectionOnlyLoadFrom(logcatAssembly.outputPath).GetReferencedAssemblies().Select(a => a.Name); + // ReflectionOnlyLoadFrom is unsupported on CoreCLR; inspect the loaded assembly instead. + var references = typeof(AndroidLogcatConsoleWindow).Assembly.GetReferencedAssemblies().Select(a => a.Name); foreach (var r in references) { Assert.Contains(r, expectedReferences, $"Unexpected reference '{r}'");