Skip to content

Commit a192fb5

Browse files
Copilotwinnerspiros
andcommitted
Fix deprecated Node.js 20 actions and Android CA1416 platform compatibility warnings
Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com> Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/b6cdde36-04c4-4f15-927d-110644a5e205
1 parent 510342f commit a192fb5

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ jobs:
1616
contents: write
1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v4
19+
uses: actions/checkout@v6
2020

2121
- name: Setup JDK 17
22-
uses: actions/setup-java@v4
22+
uses: actions/setup-java@v5
2323
with:
2424
distribution: microsoft
2525
java-version: 17
2626

2727
- name: Install .NET 8.0.x
28-
uses: actions/setup-dotnet@v4
28+
uses: actions/setup-dotnet@v5
2929
with:
3030
dotnet-version: "8.0.x"
3131

@@ -91,7 +91,7 @@ jobs:
9191
echo "apk_path=$APK" >> "$GITHUB_OUTPUT"
9292
9393
- name: Upload APK artifact
94-
uses: actions/upload-artifact@v4
94+
uses: actions/upload-artifact@v7
9595
with:
9696
name: osu-android-${{ github.ref_name }}
9797
path: ${{ steps.find_apk.outputs.apk_path }}

osu.Android/OsuGameActivity.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ protected override void OnStart()
7676
try
7777
{
7878
// Request unbuffered touch dispatch for lower input latency during gameplay.
79-
Window?.DecorView?.RequestUnbufferedDispatch((int)InputSourceType.Touchscreen);
79+
// View.RequestUnbufferedDispatch(int) requires Android API 30+.
80+
if (OperatingSystem.IsAndroidVersionAtLeast(30))
81+
Window?.DecorView?.RequestUnbufferedDispatch((int)InputSourceType.Touchscreen);
8082
}
8183
catch (Exception e)
8284
{
@@ -155,7 +157,9 @@ public void ApplyPerformanceOptimizations(bool enabled)
155157
{
156158
try
157159
{
158-
Window?.SetSustainedPerformanceMode(enabled);
160+
// SetSustainedPerformanceMode requires Android API 24+.
161+
if (OperatingSystem.IsAndroidVersionAtLeast(24))
162+
Window?.SetSustainedPerformanceMode(enabled);
159163

160164
if (enabled)
161165
selectHighestRefreshRate();
@@ -169,6 +173,11 @@ public void ApplyPerformanceOptimizations(bool enabled)
169173

170174
private void selectHighestRefreshRate()
171175
{
176+
// Display.GetSupportedModes(), Display.Mode.RefreshRate, Display.Mode.ModeId, and
177+
// WindowManagerLayoutParams.PreferredDisplayModeId require Android API 23+.
178+
if (!OperatingSystem.IsAndroidVersionAtLeast(23))
179+
return;
180+
172181
try
173182
{
174183
var display = WindowManager?.DefaultDisplay;

0 commit comments

Comments
 (0)