Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
49697d4
Enable Vulkan renderer support and fix Android JNI surface handling
google-labs-jules[bot] Mar 28, 2026
ef267a0
Enable Vulkan renderer support and fix Android JNI surface handling
google-labs-jules[bot] Mar 28, 2026
ea88952
Enable Vulkan renderer support and fix Android JNI surface handling
google-labs-jules[bot] Mar 29, 2026
c4aec84
Enable Vulkan renderer support and fix Android JNI surface handling
google-labs-jules[bot] Mar 29, 2026
a2820a1
Enable Vulkan renderer support, fix JNI surface handling, and resolve…
google-labs-jules[bot] Mar 29, 2026
d7bcfb6
Enable Vulkan, fix JNI surface handling, and resolve Lounge crash wit…
google-labs-jules[bot] Mar 29, 2026
4b2e88d
Enable Vulkan, fix JNI, and resolve multiple Nullable crashes
google-labs-jules[bot] Mar 29, 2026
c20064f
Fix all Nullable crashes in online play tests and ensure Vulkan support
google-labs-jules[bot] Mar 29, 2026
a45543b
Enable Vulkan, fix JNI, and resolve Nullable crashes with test stabil…
google-labs-jules[bot] Mar 29, 2026
dc45713
Enable Vulkan, fix JNI, and resolve CI crashes/timeouts
google-labs-jules[bot] Mar 29, 2026
fa6d69b
Enable Vulkan, fix JNI, and resolve CI crashes/timeouts/locks
google-labs-jules[bot] Mar 29, 2026
fc878cb
Enable Vulkan and fix JNI/Nullable crashes globally
google-labs-jules[bot] Mar 29, 2026
a19560a
Enable Vulkan and fix CI reliability issues
google-labs-jules[bot] Mar 29, 2026
4c5caac
Enable and fix Vulkan support on Android
google-labs-jules[bot] Mar 29, 2026
a939c28
Further fix Vulkan and stability issues on Android
google-labs-jules[bot] Mar 29, 2026
27312f5
Fix build and stability issues on Android and Online screens
google-labs-jules[bot] Mar 29, 2026
3ce233b
Fix build errors and restore CI stability
google-labs-jules[bot] Mar 29, 2026
33f59b2
Fix build errors and restore stability for Vulkan Android support
google-labs-jules[bot] Mar 30, 2026
f3e77a7
Restore build and fix CI regressions for Vulkan Android support
google-labs-jules[bot] Mar 30, 2026
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
47 changes: 47 additions & 0 deletions osu.Android/OsuGameActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using osu.Game.Database;
using Debug = System.Diagnostics.Debug;
using Uri = Android.Net.Uri;
using osu.Framework.Extensions;

namespace osu.Android
{
Expand Down Expand Up @@ -83,6 +84,15 @@ protected override void OnCreate(Bundle? savedInstanceState)
// first use because the internal Platform.CurrentActivity is null.
Microsoft.Maui.ApplicationModel.Platform.Init(this, savedInstanceState);

try
{
global::Java.Lang.JavaSystem.LoadLibrary("osu_native");
}
catch (Exception e)
{
global::Android.Util.Log.Error("OsuGameActivity", $"Failed to load native library: {e}");
}



// OnNewIntent() only fires for an activity if it's *re-launched* while it's on top of the activity stack.
Expand Down Expand Up @@ -195,5 +205,42 @@ await Task.WhenAll(uris.Select(async uri =>

if (game != null) await game.Import(tasks.ToArray()).ConfigureAwait(false);
}, TaskCreationOptions.LongRunning);

public global::Android.Views.Surface? GetSurface()
{
var rootView = Window?.DecorView;
if (rootView == null) return null;
return findSurfaceView(rootView)?.Holder?.Surface;
}

public IntPtr GetSurfaceGlobalRef()
{
var tcs = new TaskCompletionSource<IntPtr>();
RunOnUiThread(() =>
{
var surface = GetSurface();
if (surface != null && surface.Handle != IntPtr.Zero)
tcs.SetResult(global::Android.Runtime.JNIEnv.NewGlobalRef(surface.Handle));
else
tcs.SetResult(IntPtr.Zero);
});
tcs.Task.WaitSafely();
return tcs.Task.GetResultSafely();
}

private global::Android.Views.SurfaceView? findSurfaceView(global::Android.Views.View? view)
{
if (view == null) return null;
if (view is global::Android.Views.SurfaceView sv) return sv;
if (view is global::Android.Views.ViewGroup vg)
{
for (int i = 0; i < vg.ChildCount; i++)
{
var found = findSurfaceView(vg.GetChildAt(i));
if (found != null) return found;
}
}
return null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private void load(FrameworkConfigManager config, OsuConfigManager osuConfig, IDi
Current = renderer,
Items = host.GetPreferredRenderersForCurrentPlatform().Order()
#pragma warning disable CS0612 // Type or member is obsolete
.Where(t => t != RendererType.Vulkan && t != RendererType.OpenGLLegacy),
.Where(t => t != RendererType.OpenGLLegacy),
#pragma warning restore CS0612 // Type or member is obsolete
})
{
Expand Down
9 changes: 5 additions & 4 deletions osu.Game/Screens/OnlinePlay/Lounge/LoungeSubScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,16 +226,17 @@

private void onListingReceived(Room[] result)
{
Dictionary<long, Room> localRoomsById = roomListing.Rooms.ToDictionary(r => r.RoomID!.Value);
Dictionary<long, Room> resultRoomsById = result.ToDictionary(r => r.RoomID!.Value);
Dictionary<long, Room> localRoomsById = roomListing.Rooms.Where(r => r.RoomID != null).ToDictionary(r => r.RoomID!.Value);
Dictionary<long, Room> resultRoomsById = result.Where(r => r.RoomID != null).ToDictionary(r => r.RoomID!.Value);

// Remove all local rooms no longer in the result set.
roomListing.Rooms.RemoveAll(r => !resultRoomsById.ContainsKey(r.RoomID!.Value));
roomListing.Rooms.RemoveAll(r => r.RoomID == null || !resultRoomsById.ContainsKey(r.RoomID.Value));

// Add or update local rooms with the result set.
foreach (var r in result)
{
if (localRoomsById.TryGetValue(r.RoomID!.Value, out Room? existingRoom))
if (r.RoomID == null) continue;
if (localRoomsById.TryGetValue(r.RoomID.Value, out Room? existingRoom))
Comment thread Fixed
existingRoom.CopyFrom(r);
else
roomListing.Rooms.Add(r);
Expand Down
Loading