Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -607,17 +607,6 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetOS)' == 'android' and '$(TestNativeAOT)' == 'true'">
<!-- https://github.com/dotnet/runtime/issues/120725 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Formats.Tar\tests\System.Formats.Tar.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.Compression.ZipFile\tests\System.IO.Compression.ZipFile.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.FileSystem.Watcher\tests\System.IO.FileSystem.Watcher.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.MemoryMappedFiles\tests\System.IO.MemoryMappedFiles.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Http\tests\FunctionalTests\System.Net.Http.Functional.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Mail\tests\Unit\System.Net.Mail.Unit.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Ping\tests\FunctionalTests\System.Net.Ping.Functional.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Security\tests\UnitTests\System.Net.Security.Unit.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.IO.FileSystem.Tests\DisabledFileLockingTests\System.IO.FileSystem.DisabledFileLocking.Tests.csproj" />

<SmokeTestProject Include="$(RepoRoot)src\tests\FunctionalTests\Android\Device_Emulator\NativeAOT\*.Test.csproj"/>
<SmokeTestProject Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Globalization.Tests\System.Globalization.Tests.csproj" />
<SmokeTestProject Include="$(MSBuildThisFileDirectory)System.Security.Cryptography\tests\System.Security.Cryptography.Tests.csproj" />
Expand Down
15 changes: 9 additions & 6 deletions src/tasks/AndroidAppBuilder/Templates/monodroid-nativeaot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,18 @@ internal unsafe struct JNIEnv
{
fixed (JNIEnv* thisptr = &this)
{
byte* chars = NativeInterface->GetStringUTFChars(thisptr, str, out byte isCopy);
byte* chars = NativeInterface->GetStringUTFChars(thisptr, str, null);
if (chars is null)
return null;

string result = Marshal.PtrToStringUTF8((nint)chars)!;
if (isCopy != 0)
try
{
return Marshal.PtrToStringUTF8((nint)chars)!;
Comment thread
jkotas marked this conversation as resolved.
}
finally
{
NativeInterface->ReleaseStringUTFChars(thisptr, str, chars);

return result;
}
}
}

Expand Down Expand Up @@ -383,7 +386,7 @@ unsafe struct JNINativeInterface

void* NewStringUTF;
delegate* unmanaged[Cdecl]<JNIEnv*, JString, int> GetStringUTFLength;
public delegate* unmanaged[Cdecl]<JNIEnv*, JString, out byte, byte*> GetStringUTFChars;
public delegate* unmanaged[Cdecl]<JNIEnv*, JString, byte*, byte*> GetStringUTFChars;
public delegate* unmanaged[Cdecl]<JNIEnv*, JString, byte*, void> ReleaseStringUTFChars;
public delegate* unmanaged[Cdecl]<JNIEnv*, JObjectArray, JSize> GetArrayLength;

Expand Down
Loading