[Scummvm-git-logs] scummvm master -> 6b482e530cfdf28659167f6c1f413c717af54543
lephilousophe
noreply at scummvm.org
Sun Jul 12 17:12:49 UTC 2026
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
695383be27 ANDROID: Fix or silence linting errors
a7626c82c4 ANDROID: Remove more linting errors
6b482e530c ANDROID: Fix build when debugging ENTER
Commit: 695383be2766370ff97276d0c487c1851bed3bee
https://github.com/scummvm/scummvm/commit/695383be2766370ff97276d0c487c1851bed3bee
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2026-07-12T19:12:02+02:00
Commit Message:
ANDROID: Fix or silence linting errors
This is only annotation or cosmetic changes.
Changed paths:
backends/platform/android/org/scummvm/scummvm/BackupManager.java
backends/platform/android/org/scummvm/scummvm/CompatHelpers.java
backends/platform/android/org/scummvm/scummvm/CustomKeyboardView.java
backends/platform/android/org/scummvm/scummvm/EditableSurfaceView.java
backends/platform/android/org/scummvm/scummvm/ExternalStorage.java
backends/platform/android/org/scummvm/scummvm/INIParser.java
backends/platform/android/org/scummvm/scummvm/LedView.java
backends/platform/android/org/scummvm/scummvm/MultitouchHelper.java
backends/platform/android/org/scummvm/scummvm/SAFFSTree.java
backends/platform/android/org/scummvm/scummvm/ScummVM.java
backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
backends/platform/android/org/scummvm/scummvm/ShortcutCreatorActivity.java
backends/platform/android/org/scummvm/scummvm/Version.java
backends/platform/android/org/scummvm/scummvm/net/HTTPRequest.java
backends/platform/android/org/scummvm/scummvm/net/LETrustManager.java
backends/platform/android/org/scummvm/scummvm/net/TLSSocketFactory.java
backends/platform/android/org/scummvm/scummvm/zip/ZipConstants.java
diff --git a/backends/platform/android/org/scummvm/scummvm/BackupManager.java b/backends/platform/android/org/scummvm/scummvm/BackupManager.java
index ef13c2cdc6d..012842df184 100644
--- a/backends/platform/android/org/scummvm/scummvm/BackupManager.java
+++ b/backends/platform/android/org/scummvm/scummvm/BackupManager.java
@@ -331,6 +331,7 @@ public class BackupManager {
}
if (parsedIniMap == null) {
+ //noinspection ResultOfMethodCallIgnored
configurationTmp.delete();
return ERROR_INVALID_BACKUP;
}
@@ -368,6 +369,7 @@ public class BackupManager {
} catch(IOException ignored) {
return ERROR_INVALID_BACKUP;
}
+ //noinspection ResultOfMethodCallIgnored
configurationTmp.delete();
}
diff --git a/backends/platform/android/org/scummvm/scummvm/CompatHelpers.java b/backends/platform/android/org/scummvm/scummvm/CompatHelpers.java
index f1567d6ccc8..da1432ae052 100644
--- a/backends/platform/android/org/scummvm/scummvm/CompatHelpers.java
+++ b/backends/platform/android/org/scummvm/scummvm/CompatHelpers.java
@@ -35,10 +35,6 @@ import android.graphics.Insets;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
-import android.media.AudioAttributes;
-import android.media.AudioFormat;
-import android.media.AudioManager;
-import android.media.AudioTrack;
import android.view.DisplayCutout;
import android.view.View;
import android.view.Window;
@@ -71,8 +67,8 @@ class CompatHelpers {
}
}
- @RequiresApi(android.os.Build.VERSION_CODES.JELLY_BEAN)
- @SuppressWarnings("deprecation")
+ //@RequiresApi(android.os.Build.VERSION_CODES.JELLY_BEAN)
+ @SuppressWarnings({"deprecation", "RedundantSuppression"})
private static class HideSystemStatusBarJellyBean {
public static void hide(final Window window) {
View view = window.getDecorView();
@@ -83,7 +79,7 @@ class CompatHelpers {
}
@RequiresApi(android.os.Build.VERSION_CODES.KITKAT)
- @SuppressWarnings("deprecation")
+ @SuppressWarnings({"deprecation", "RedundantSuppression"})
private static class HideSystemStatusBarKitKat {
public static void hide(final Window window) {
View view = window.getDecorView();
@@ -129,7 +125,7 @@ class CompatHelpers {
}
@RequiresApi(android.os.Build.VERSION_CODES.LOLLIPOP)
- @SuppressWarnings("deprecation")
+ @SuppressWarnings({"deprecation", "RedundantSuppression"})
private static class OnApplyWindowInsetsListenerLollipop implements View.OnApplyWindowInsetsListener {
final private SystemInsetsListener l;
@@ -138,6 +134,7 @@ class CompatHelpers {
}
@Override
+ @NonNull
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
// No system gestures inset before Android Q
int[] gestureInsets = new int[] {
@@ -160,7 +157,7 @@ class CompatHelpers {
}
@RequiresApi(android.os.Build.VERSION_CODES.P)
- @SuppressWarnings("deprecation")
+ @SuppressWarnings({"deprecation", "RedundantSuppression"})
private static class OnApplyWindowInsetsListenerP implements View.OnApplyWindowInsetsListener {
final private SystemInsetsListener l;
@@ -169,7 +166,8 @@ class CompatHelpers {
}
@Override
- public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
+ @NonNull
+ public WindowInsets onApplyWindowInsets(@NonNull View v, WindowInsets insets) {
// No system gestures inset before Android Q
int[] gestureInsets = new int[] {
insets.getStableInsetLeft(),
@@ -201,7 +199,7 @@ class CompatHelpers {
}
@RequiresApi(android.os.Build.VERSION_CODES.Q)
- @SuppressWarnings("deprecation")
+ @SuppressWarnings({"deprecation", "RedundantSuppression"})
private static class OnApplyWindowInsetsListenerQ implements View.OnApplyWindowInsetsListener {
final private SystemInsetsListener l;
@@ -210,7 +208,8 @@ class CompatHelpers {
}
@Override
- public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
+ @NonNull
+ public WindowInsets onApplyWindowInsets(@NonNull View v, WindowInsets insets) {
Insets insetsStruct = insets.getSystemGestureInsets();
int[] gestureInsets = new int[] {
insetsStruct.left,
@@ -251,7 +250,8 @@ class CompatHelpers {
}
@Override
- public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
+ @NonNull
+ public WindowInsets onApplyWindowInsets(@NonNull View v, WindowInsets insets) {
Insets insetsStruct = insets.getInsetsIgnoringVisibility(WindowInsets.Type.systemGestures());
int[] gestureInsets = new int[] {
insetsStruct.left,
@@ -293,7 +293,7 @@ class CompatHelpers {
}
}
- @SuppressWarnings("deprecation")
+ @SuppressWarnings({"deprecation", "RedundantSuppression"})
private static class AccessibilityEventConstructorOld {
public static AccessibilityEvent make(int eventType) {
return AccessibilityEvent.obtain(eventType);
@@ -326,7 +326,7 @@ class CompatHelpers {
// No support for older versions
}
- @SuppressWarnings("deprecation")
+ @SuppressWarnings({"deprecation", "RedundantSuppression"})
private static class ShortcutCreatorOld {
public static Intent createShortcutResultIntent(@NonNull Context context, String ignoredId, @NonNull Intent intent, @NonNull String label, @Nullable Drawable icon, @DrawableRes int fallbackIconId) {
Intent result = new Intent();
@@ -498,7 +498,7 @@ class CompatHelpers {
}
}
- @SuppressWarnings("deprecation")
+ @SuppressWarnings({"deprecation", "RedundantSuppression"})
private static class DrawableCompatOld {
@SuppressLint("UseCompatLoadingForDrawables")
public static Drawable getDrawable(@NonNull Context context, @DrawableRes int id) throws Resources.NotFoundException {
@@ -508,6 +508,8 @@ class CompatHelpers {
}
static class ReceiverCompat {
+
+ @SuppressWarnings("UnusedReturnValue")
public static Intent registerReceiver(Context context, BroadcastReceiver receiver, IntentFilter filter) {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.TIRAMISU) {
return ReceiverCompat.ReceiverCompatTiramisu.registerReceiver(context, receiver, filter);
@@ -547,9 +549,9 @@ class CompatHelpers {
}
}
- @SuppressWarnings("deprecation")
+ @SuppressWarnings({"deprecation", "RedundantSuppression"})
private static class IntentCompatOld {
- public static <T extends android.os.Parcelable> T getParcelableExtra(Intent i, String extra, Class<T> clazz) {
+ public static <T extends android.os.Parcelable> T getParcelableExtra(Intent i, String extra, Class<T> ignoredClazz) {
return i.getParcelableExtra(extra);
}
}
diff --git a/backends/platform/android/org/scummvm/scummvm/CustomKeyboardView.java b/backends/platform/android/org/scummvm/scummvm/CustomKeyboardView.java
index 846716af2bb..247651c7e68 100644
--- a/backends/platform/android/org/scummvm/scummvm/CustomKeyboardView.java
+++ b/backends/platform/android/org/scummvm/scummvm/CustomKeyboardView.java
@@ -1229,7 +1229,7 @@ public class CustomKeyboardView extends View implements View.OnClickListener {
}
mMiniKeyboard.setKeyboard(keyboard);
mMiniKeyboard.setPopupParent(this);
- mMiniKeyboardContainer.measure(MeasureSpec.makeMeasureSpec(getWidth(), MeasureSpec.AT_MOST), MeasureSpec.makeMeasureSpec(getHeight(), MeasureSpec.AT_MOST));
+ mMiniKeyboardContainer.measure(MeasureSpec.makeMeasureSpec(getWidth(), MeasureSpec.AT_MOST), MeasureSpec.makeMeasureSpec(getHeight(), MeasureSpec.AT_MOST));
mMiniKeyboardCache.put(popupKey, mMiniKeyboardContainer);
} else {
mMiniKeyboard = (CustomKeyboardView) mMiniKeyboardContainer.findViewById(R.id.ScummVMKeyboardView);
diff --git a/backends/platform/android/org/scummvm/scummvm/EditableSurfaceView.java b/backends/platform/android/org/scummvm/scummvm/EditableSurfaceView.java
index f1c9793dfc9..2f61276577b 100644
--- a/backends/platform/android/org/scummvm/scummvm/EditableSurfaceView.java
+++ b/backends/platform/android/org/scummvm/scummvm/EditableSurfaceView.java
@@ -21,7 +21,6 @@
package org.scummvm.scummvm;
-import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
@@ -37,6 +36,8 @@ import android.view.inputmethod.BaseInputConnection;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
+import androidx.annotation.RequiresApi;
+
public class EditableSurfaceView extends SurfaceView {
final Context _context;
final boolean _allowHideSystemMousePointer;
@@ -348,7 +349,7 @@ public class EditableSurfaceView extends SurfaceView {
// https://stackoverflow.com/a/55482761
// https://developer.android.com/reference/android/view/PointerIcon.html
//
- @TargetApi(24)
+ @RequiresApi(24)
@Override
public PointerIcon onResolvePointerIcon(MotionEvent me, int pointerIndex) {
if (_allowHideSystemMousePointer) {
diff --git a/backends/platform/android/org/scummvm/scummvm/ExternalStorage.java b/backends/platform/android/org/scummvm/scummvm/ExternalStorage.java
index 3bad41a9aca..a6f51dfedde 100644
--- a/backends/platform/android/org/scummvm/scummvm/ExternalStorage.java
+++ b/backends/platform/android/org/scummvm/scummvm/ExternalStorage.java
@@ -429,6 +429,7 @@ public class ExternalStorage {
}
}
} catch (Exception e) {
+ //noinspection CallToPrintStackTrace
e.printStackTrace();
}
@@ -450,6 +451,7 @@ public class ExternalStorage {
}
}
} catch (Exception e) {
+ //noinspection CallToPrintStackTrace
e.printStackTrace();
}
diff --git a/backends/platform/android/org/scummvm/scummvm/INIParser.java b/backends/platform/android/org/scummvm/scummvm/INIParser.java
index 6d9b74728ee..fc244ad184f 100644
--- a/backends/platform/android/org/scummvm/scummvm/INIParser.java
+++ b/backends/platform/android/org/scummvm/scummvm/INIParser.java
@@ -166,6 +166,8 @@ public class INIParser {
}
String decoded = punycodeDecode(component);
+ // punycodeDecode returns component on failure
+ //noinspection StringEquality
if (component == decoded) {
return component;
}
@@ -184,6 +186,7 @@ public class INIParser {
}
/* Java isWhitespace is more inclusive than C one */
+ @SuppressWarnings("BooleanMethodIsAlwaysInverted")
private static boolean isSpace(char c) {
return (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\013');
}
diff --git a/backends/platform/android/org/scummvm/scummvm/LedView.java b/backends/platform/android/org/scummvm/scummvm/LedView.java
index 183f831f0e5..0242e985152 100644
--- a/backends/platform/android/org/scummvm/scummvm/LedView.java
+++ b/backends/platform/android/org/scummvm/scummvm/LedView.java
@@ -47,6 +47,7 @@ public class LedView extends View {
this(context, true, DEFAULT_LED_COLOR);
}
+ @SuppressWarnings("unused")
public LedView(Context context, boolean state) {
this(context, state, DEFAULT_LED_COLOR);
}
@@ -66,6 +67,7 @@ public class LedView extends View {
init(context, attrs, defStyleAttr, 0);
}
+ @SuppressWarnings("unused")
@RequiresApi(android.os.Build.VERSION_CODES.LOLLIPOP)
public LedView(
Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
diff --git a/backends/platform/android/org/scummvm/scummvm/MultitouchHelper.java b/backends/platform/android/org/scummvm/scummvm/MultitouchHelper.java
index 5f26011940a..fa6944c6621 100644
--- a/backends/platform/android/org/scummvm/scummvm/MultitouchHelper.java
+++ b/backends/platform/android/org/scummvm/scummvm/MultitouchHelper.java
@@ -98,7 +98,7 @@ public class MultitouchHelper {
// 2: no "scrolling" (mouse wheel) (decided)
// Scrolling (mouse wheel) mode is mutually exclusive with the rest of the multi-touch modes,
// we can either send mouse wheel events or mouse click events in a multitouch session.
- private int _touchMouseWheelDecisionLevel = 0;
+ private int _touchMouseWheelDecisionLevel;
// constructor
public MultitouchHelper(ScummVM scummvm) {
@@ -169,8 +169,8 @@ public class MultitouchHelper {
pointerIndex = 0;
_firstPointerId = event.getPointerId(pointerIndex);
- _cachedActionEventOnPointer1DownX = (int) event.getX(pointerIndex);;
- _cachedActionEventOnPointer1DownY = (int) event.getY(pointerIndex);;
+ _cachedActionEventOnPointer1DownX = (int) event.getX(pointerIndex);
+ _cachedActionEventOnPointer1DownY = (int) event.getY(pointerIndex);
return false;
} else if (maskedAction == MotionEvent.ACTION_CANCEL) {
diff --git a/backends/platform/android/org/scummvm/scummvm/SAFFSTree.java b/backends/platform/android/org/scummvm/scummvm/SAFFSTree.java
index fd82762e3b0..bf7e1459561 100644
--- a/backends/platform/android/org/scummvm/scummvm/SAFFSTree.java
+++ b/backends/platform/android/org/scummvm/scummvm/SAFFSTree.java
@@ -816,6 +816,7 @@ public class SAFFSTree {
}
private int createStream(SAFFSNode node, String mode) {
+ @SuppressWarnings("resource")
ParcelFileDescriptor pfd = createFileDescriptor(node, mode);
if (pfd == null) {
return -1;
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVM.java b/backends/platform/android/org/scummvm/scummvm/ScummVM.java
index a7c2183abee..4855cc684f7 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVM.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVM.java
@@ -68,6 +68,7 @@ public abstract class ScummVM implements SurfaceHolder.Callback,
boolean assetsUpdated);
private native void destroy();
private native void setSurface(int width, int height, int bpp);
+ @SuppressWarnings("ConfusingMainMethod")
private native int main(String[] args);
// pause the engine and all native threads
@@ -142,6 +143,7 @@ public abstract class ScummVM implements SurfaceHolder.Callback,
/** @noinspection unused */ @Keep
abstract protected int importBackup(String prompt, String path);
+ @SuppressWarnings("ClassEscapesDefinedScope")
public ScummVM(AssetManager asset_manager, SurfaceHolder holder, final MyScummVMDestroyedCallback scummVMDestroyedCallback) {
_asset_manager = asset_manager;
_sem_surface = new Object();
@@ -154,14 +156,14 @@ public abstract class ScummVM implements SurfaceHolder.Callback,
}
// SurfaceHolder callback
- final public void surfaceCreated(SurfaceHolder holder) {
+ final public void surfaceCreated(@NonNull SurfaceHolder holder) {
Log.d(LOG_TAG, "surfaceCreated");
// no need to do anything, surfaceChanged() will be called in any case
}
// SurfaceHolder callback
- final public void surfaceChanged(SurfaceHolder holder, int format,
+ final public void surfaceChanged(@NonNull SurfaceHolder holder, int format,
int width, int height) {
PixelFormat pixelFormat = new PixelFormat();
@@ -183,7 +185,7 @@ public abstract class ScummVM implements SurfaceHolder.Callback,
}
// SurfaceHolder callback
- final public void surfaceDestroyed(SurfaceHolder holder) {
+ final public void surfaceDestroyed(@NonNull SurfaceHolder holder) {
Log.d(LOG_TAG, "surfaceDestroyed");
synchronized(_sem_surface) {
@@ -542,7 +544,7 @@ public abstract class ScummVM implements SurfaceHolder.Callback,
int score = attr.weight();
- Log.d(LOG_TAG, String.format(Locale.ROOT, "%s (%d, %s)", attr.toString(), score, good ? "OK" : "NOK"));
+ Log.d(LOG_TAG, String.format(Locale.ROOT, "%s (%d, %s)", attr, score, good ? "OK" : "NOK"));
if (!good) {
continue;
@@ -560,7 +562,7 @@ public abstract class ScummVM implements SurfaceHolder.Callback,
"Unable to find an acceptable EGL config, expect badness.");
Log.d(LOG_TAG, String.format(Locale.ROOT, "Chosen EGL config: %s",
- new EglAttribs(res).toString()));
+ new EglAttribs(res)));
return res;
}
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
index f9bdc05b2b0..7b3262aaeed 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
@@ -22,7 +22,6 @@
package org.scummvm.scummvm;
import android.Manifest;
-import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
@@ -223,7 +222,7 @@ public class ScummVMActivity extends Activity {
//_inputManager.toggleSoftInputFromWindow(_main_surface.getWindowToken(), InputMethodManager.SHOW_IMPLICIT, InputMethodManager.HIDE_IMPLICIT_ONLY);
int flags = 0;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.BAKLAVA) {
- @SuppressWarnings("deprecation")
+ @SuppressWarnings({"deprecation", "RedundantSuppression"})
final int flag = InputMethodManager.SHOW_IMPLICIT;
flags = flag;
}
@@ -552,7 +551,7 @@ public class ScummVMActivity extends Activity {
// _inputManager.hideSoftInputFromWindow(_main_surface.getWindowToken(), 0);
int flags = 0;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.BAKLAVA) {
- @SuppressWarnings("deprecation")
+ @SuppressWarnings({"deprecation", "RedundantSuppression"})
final int flag = InputMethodManager.HIDE_IMPLICIT_ONLY;
flags = flag;
}
@@ -612,13 +611,14 @@ public class ScummVMActivity extends Activity {
if (_main_surface != null) {
+ //noinspection ConstantValue
if (bGlobalsCompatibilityHacksTextInputEmulatesHwKeyboard) {
showScreenKeyboardWithoutTextInputField(dGlobalsTextInputKeyboard);
//Log.d(ScummVM.LOG_TAG, "showScreenKeyboard - captureMouse(false)");
_main_surface.captureMouse(false);
//_main_surface.showSystemMouseCursor(true);
setupTouchModeBtn(_events.getTouchMode());
- return;
+ //return;
}
//Log.d(ScummVM.LOG_TAG, "showScreenKeyboard: YOU SHOULD NOT SEE ME!!!");
@@ -1491,6 +1491,7 @@ public class ScummVMActivity extends Activity {
Log.d(ScummVM.LOG_TAG, "New ScummVM log: " + _logScummvmFile.getPath());
}
} catch(Exception e) {
+ //noinspection CallToPrintStackTrace
e.printStackTrace();
new AlertDialog.Builder(this)
.setTitle(R.string.no_log_file_title)
@@ -1503,7 +1504,7 @@ public class ScummVMActivity extends Activity {
}
})
.show();
- return;
+ //return;
}
}
@@ -1565,7 +1566,7 @@ public class ScummVMActivity extends Activity {
private final int EstimatedKeyboardDP = defaultKeyboardHeightDP + (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? 48 : 0);
private final Rect rect = new Rect();
- @TargetApi(Build.VERSION_CODES.CUPCAKE)
+ //@RequiresApi(Build.VERSION_CODES.CUPCAKE)
@Override
public void onGlobalLayout() {
int estimatedKeyboardHeight = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, EstimatedKeyboardDP, parentView.getResources().getDisplayMetrics());
@@ -1583,12 +1584,12 @@ public class ScummVMActivity extends Activity {
});
}
- public void onKeyboardVisibilityChanged(boolean visible) {
+ public void onKeyboardVisibilityChanged(boolean ignoredVisible) {
// Toast.makeText(HomeActivity.this, visible ? "Keyboard is active" : "Keyboard is Inactive", Toast.LENGTH_SHORT).show();
CompatHelpers.HideSystemStatusBar.hide(getWindow());
}
- @SuppressWarnings("deprecation")
+ @SuppressWarnings({"deprecation", "RedundantSuppression"})
private int getDisplayPixelFormat() {
// Since API level 17 this always returns PixelFormat.RGBA_8888
// so if we target more recent API levels, we could remove this function
@@ -1613,7 +1614,7 @@ public class ScummVMActivity extends Activity {
audioTrackFramesPerBurst /= 4; // AudioTrack tends to buffer a lot
Log.d(ScummVM.LOG_TAG, "updateAudioValues:" +
- " at=" + Integer.toString(audioTrackSampleRate) + "/" + Integer.toString(audioTrackFramesPerBurst));
+ " at=" + audioTrackSampleRate + "/" + audioTrackFramesPerBurst);
ScummVM.setDefaultAudioValues(audioTrackSampleRate, audioTrackFramesPerBurst);
return;
@@ -1626,7 +1627,7 @@ public class ScummVMActivity extends Activity {
int audioManagerFramesPerBurst = Integer.parseInt(text);
Log.d(ScummVM.LOG_TAG, "updateAudioValues:" +
- " am=" + Integer.toString(audioManagerSampleRate) + "/" + Integer.toString(audioManagerFramesPerBurst));
+ " am=" + audioManagerSampleRate + "/" + audioManagerFramesPerBurst);
ScummVM.setDefaultAudioValues(audioManagerSampleRate, audioManagerFramesPerBurst);
}
@@ -1672,11 +1673,11 @@ public class ScummVMActivity extends Activity {
int newStatus = (micro ? 1 : 0) + (state ? 2 : 0);
Log.i(ScummVM.LOG_TAG, action +
- " micro=" + Boolean.toString(micro) +
- " state=" + Boolean.toString(state) +
- " status=" + Integer.toString(newStatus) +
- " lastStatus=" + Integer.toString(lastStatus) +
- " diff=" + Integer.toString(lastStatus ^ newStatus));
+ " micro=" + micro +
+ " state=" + state +
+ " status=" + newStatus +
+ " lastStatus=" + lastStatus +
+ " diff=" + (lastStatus ^ newStatus));
if (isInitialStickyBroadcast()) {
if (lastStatus == -1) {
@@ -1703,7 +1704,7 @@ public class ScummVMActivity extends Activity {
containsAudioStreamingInterface(device, UsbConstants.USB_DIR_OUT);
final boolean hasAudioCapture =
containsAudioStreamingInterface(device, UsbConstants.USB_DIR_IN);
- Log.w(ScummVM.LOG_TAG, action + " device=" + device.toString() + " playback=" + Boolean.toString(hasAudioPlayback) + " capture=" + Boolean.toString(hasAudioCapture));
+ Log.w(ScummVM.LOG_TAG, action + " device=" + device + " playback=" + hasAudioPlayback + " capture=" + hasAudioCapture);
if (!hasAudioPlayback) {
// We are only interested in playback sinks
return;
@@ -2029,6 +2030,7 @@ public class ScummVMActivity extends Activity {
}
}
} catch(Exception e) {
+ //noinspection CallToPrintStackTrace
e.printStackTrace();
new AlertDialog.Builder(this)
.setTitle(R.string.no_config_file_title)
@@ -2410,7 +2412,7 @@ public class ScummVMActivity extends Activity {
// Otherwise we would probably need to create a specifically named zip file with the selection of files we'd need to extract to the internal memory
// Returns true if the assetDir was a directory and false otherwise
private static boolean extractAssets(AssetManager assetManager, String assetDir, File dataDir) throws IOException {
- String[] files = null;
+ String[] files;
try {
files = assetManager.list(assetDir);
} catch (IOException e) {
@@ -2587,6 +2589,7 @@ public class ScummVMActivity extends Activity {
// region Start of SAF enabled code
// -------------------------------------------------------------------------------------------
public void onActivityResult(int requestCode, int resultCode, Intent resultData) {
+ //noinspection SynchronizeOnNonFinalField
synchronized(safSyncObject) {
safRequestCode = requestCode;
safResultCode = resultCode;
@@ -2635,6 +2638,7 @@ public class ScummVMActivity extends Activity {
int resultCode;
Uri resultURI;
+ //noinspection SynchronizeOnNonFinalField
synchronized(safSyncObject) {
safRequestCode = 0;
startActivityForResult(intent, REQUEST_SAF);
@@ -2663,7 +2667,7 @@ public class ScummVMActivity extends Activity {
return null;
}
- Log.d(ScummVM.LOG_TAG, "Selected SAF URI: " + resultURI.toString());
+ Log.d(ScummVM.LOG_TAG, "Selected SAF URI: " + resultURI);
int grant = Intent.FLAG_GRANT_READ_URI_PERMISSION;
if (write) {
@@ -2680,5 +2684,5 @@ public class ScummVMActivity extends Activity {
// Used to define the interface for a callback after ScummVM thread has finished
interface MyScummVMDestroyedCallback {
- public void handle(int exitResult);
+ void handle(int exitResult);
}
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
index 93ed30da7ac..06b4a8cc6e1 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
@@ -157,7 +157,6 @@ public class ScummVMEvents implements
@Override
public void onBackStarted(@NonNull BackEvent backEvent) {
final int typeOfLongPressMessage = MSG_SBACK_LONG_PRESS;
- final boolean fired = !_handler.hasMessages(typeOfLongPressMessage);
_handler.removeMessages(typeOfLongPressMessage);
_handler.sendMessageDelayed(_handler.obtainMessage(typeOfLongPressMessage), _longPressTimeout);
}
@@ -600,7 +599,7 @@ public class ScummVMEvents implements
/**
* This gets called only on Android < Q
*/
- @SuppressWarnings("deprecation")
+ @SuppressWarnings({"deprecation", "RedundantSuppression"})
private boolean onKeyMultiple(int action, int keyCode, KeyEvent e) {
// The KeyEvent.ACTION_MULTIPLE constant was deprecated in API level 29 (Q).
// No longer used by the input system.
@@ -643,6 +642,7 @@ public class ScummVMEvents implements
* @param action the id of the action (as returned by getAction()
* @return the action description
*/
+ @SuppressWarnings("unused")
public static String motionEventActionToString(int action) {
switch (action) {
@@ -768,7 +768,7 @@ public class ScummVMEvents implements
// OnGestureListener
@Override
- final public boolean onDown(MotionEvent e) {
+ final public boolean onDown(@NonNull MotionEvent e) {
// Log.d(ScummVM.LOG_TAG, "SCUMMV-EVENTS-BASE - onDOWN MotionEvent");
if (_touchMode != TOUCH_MODE_GAMEPAD) {
_scummvm.pushEvent(JE_DOWN, (int)e.getX(), (int)e.getY(), 0, 0, 0, 0);
@@ -777,7 +777,7 @@ public class ScummVMEvents implements
}
@Override
- final public boolean onFling(MotionEvent e1, MotionEvent e2,
+ final public boolean onFling(MotionEvent e1, @NonNull MotionEvent e2,
float velocityX, float velocityY) {
//Log.d(ScummVM.LOG_TAG, String.format(Locale.ROOT, "onFling: %s -> %s (%.3f %.3f)",
// e1.toString(), e2.toString(),
@@ -789,12 +789,12 @@ public class ScummVMEvents implements
}
@Override
- final public void onLongPress(MotionEvent e) {
+ final public void onLongPress(@NonNull MotionEvent e) {
// disabled, interferes with drag&drop
}
@Override
- final public boolean onScroll(MotionEvent e1, MotionEvent e2,
+ final public boolean onScroll(MotionEvent e1, @NonNull MotionEvent e2,
float distanceX, float distanceY) {
_handler.removeMessages(MSG_LONG_TOUCH_EVENT);
// Log.d(ScummVM.LOG_TAG, "onScroll");
@@ -809,7 +809,7 @@ public class ScummVMEvents implements
}
@Override
- final public void onShowPress(MotionEvent e) {
+ final public void onShowPress(@NonNull MotionEvent e) {
// Log.d(ScummVM.LOG_TAG, "onShowPress");
_handler.removeMessages(MSG_LONG_TOUCH_EVENT);
if (_touchMode != TOUCH_MODE_GAMEPAD && !_doubleTapMode) {
@@ -821,7 +821,7 @@ public class ScummVMEvents implements
}
@Override
- final public boolean onSingleTapUp(MotionEvent e) {
+ final public boolean onSingleTapUp(@NonNull MotionEvent e) {
// Log.d(ScummVM.LOG_TAG, "onSingleTapUp");
_handler.removeMessages(MSG_LONG_TOUCH_EVENT);
if (_touchMode != TOUCH_MODE_GAMEPAD) {
@@ -833,7 +833,7 @@ public class ScummVMEvents implements
// OnDoubleTapListener
@Override
- final public boolean onDoubleTap(MotionEvent e) {
+ final public boolean onDoubleTap(@NonNull MotionEvent e) {
// Log.d(ScummVM.LOG_TAG, "onDoubleTap");
_doubleTapMode = true;
_handler.removeMessages(MSG_LONG_TOUCH_EVENT);
@@ -870,7 +870,7 @@ public class ScummVMEvents implements
}
@Override
- final public boolean onSingleTapConfirmed(MotionEvent e) {
+ final public boolean onSingleTapConfirmed(@NonNull MotionEvent e) {
// Note, timing thresholds for double tap detection seem to be hardcoded in the framework
// as ViewConfiguration.getDoubleTapTimeout()
// Log.d(ScummVM.LOG_TAG, "onSingleTapConfirmed - double tap failed");
@@ -968,11 +968,11 @@ public class ScummVMEvents implements
getJoystickCenteredAxis(event, inputDevice, MotionEvent.AXIS_LTRIGGER, historyPos),
getJoystickCenteredAxis(event, inputDevice, MotionEvent.AXIS_RTRIGGER, historyPos)};
- float currX = 0.0f;
- float absCurrX = 0.0f;
+ float currX;
+ float absCurrX;
float currY = 0.0f;
float absCurrY = 0.0f;
- int stoppingMovementAxisIdBitFlags = 0;
+ int stoppingMovementAxisIdBitFlags;
int prevRepeatingAxisIdBitFlags = _repeatingJoystickAxisIdBitFlags;
for (int i = 0; i < centeredAxisValuesArray.length; ++i) {
diff --git a/backends/platform/android/org/scummvm/scummvm/ShortcutCreatorActivity.java b/backends/platform/android/org/scummvm/scummvm/ShortcutCreatorActivity.java
index 207d2209c11..ddb3707573f 100644
--- a/backends/platform/android/org/scummvm/scummvm/ShortcutCreatorActivity.java
+++ b/backends/platform/android/org/scummvm/scummvm/ShortcutCreatorActivity.java
@@ -215,6 +215,7 @@ public class ShortcutCreatorActivity extends Activity implements CompatHelpers.S
FileInputStream[] ret = new FileInputStream[children.length];
int i = 0;
for (File f: children) {
+ //noinspection resource
ret[i] = openFile(f);
i += 1;
}
@@ -384,7 +385,7 @@ public class ShortcutCreatorActivity extends Activity implements CompatHelpers.S
* This kind of mimics Common::generateZipSet
*/
private final Context _context;
- private final Map<String, byte[]> _icons = new LinkedHashMap<String, byte[]>(16,0.75f, true) {
+ private final Map<String, byte[]> _icons = new LinkedHashMap<>(16,0.75f, true) {
@Override
protected boolean removeEldestEntry(Map.Entry<String, byte[]> eldest) {
return size() > 128;
diff --git a/backends/platform/android/org/scummvm/scummvm/Version.java b/backends/platform/android/org/scummvm/scummvm/Version.java
index ff13ba252a5..ca0903fecc2 100644
--- a/backends/platform/android/org/scummvm/scummvm/Version.java
+++ b/backends/platform/android/org/scummvm/scummvm/Version.java
@@ -54,6 +54,7 @@ public class Version implements Comparable<Version> {
// Here a version is considered "dirty" if it contains other characters in the description string than the expected digits (and dots) of a "clean" proper version
// eg. 2.3.0pre or 2.3.0git or 2.3.0git9272-gc71ac4748b are dirty
// 2.3.0 is NOT dirty
+ @SuppressWarnings("unused")
public boolean isDirty() {
return (versionOnlyDigits.compareTo(versionDescription) != 0);
}
diff --git a/backends/platform/android/org/scummvm/scummvm/net/HTTPRequest.java b/backends/platform/android/org/scummvm/scummvm/net/HTTPRequest.java
index f63b9677dc2..881cbee47a6 100644
--- a/backends/platform/android/org/scummvm/scummvm/net/HTTPRequest.java
+++ b/backends/platform/android/org/scummvm/scummvm/net/HTTPRequest.java
@@ -382,7 +382,7 @@ public class HTTPRequest implements Runnable {
final int responseCode = urlConnection.getResponseCode();
_manager.enqueue(() -> finished(_nativePointer, responseCode, null));
} catch (FileNotFoundException e) {
- // The server returned an error, and we didn't managed to get the error stream:
+ // The server returned an error, and we didn't manage to get the error stream:
// return the error code and no data
int responseCode = -1;
try {
diff --git a/backends/platform/android/org/scummvm/scummvm/net/LETrustManager.java b/backends/platform/android/org/scummvm/scummvm/net/LETrustManager.java
index abe1ed91398..6b90da3d199 100644
--- a/backends/platform/android/org/scummvm/scummvm/net/LETrustManager.java
+++ b/backends/platform/android/org/scummvm/scummvm/net/LETrustManager.java
@@ -21,6 +21,7 @@
package org.scummvm.scummvm.net;
+import android.annotation.SuppressLint;
import android.util.Base64;
import javax.net.ssl.SSLContext;
@@ -45,6 +46,7 @@ import java.util.Locale;
* Inspiration taken from http://blog.novoj.net/2016/02/29/how-to-make-apache-httpclient-trust-lets-encrypt-certificate-authority/
*/
+ at SuppressLint("CustomX509TrustManager")
class LETrustManager implements X509TrustManager {
private static final String[] derLECerts = {
/* ISRG Root X1 */ "MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAwTzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2VhcmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJuZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBYMTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygch77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6UA5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sWT8KOEUt+zwvo/7V3LvSye0rgTBIlDHCNAymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyHB5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ4Q7e2RCOFvu396j3x+UCB5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3QW0KtZB6awBdpUKD9jf1b0SHzUvKBds0pjBqAlkd25HN7rOrFleaJ1/ctaJxQZBKT5ZPt0m9STJEadao0xAH0ahmbWnOlFuhjuefXKnEgV4We0+UXgVCwOPjdAvBbI+e0ocS3MFEvzG6uBQE3xDk3SzynTnjh8BCNAw1FtxNrQHusEwMFxIt4I7mKZ9YIqioymCzLq9gwQbooMDQaHWBfEbwrbwqHyGO0aoSCqI3Haadr8faqU9GY/rOPNk3sgrDQoo//fb4hVC1CLQJ13hef4Y53CIrU7m2Ys6xt0nUW7/vGT1M0NPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR5tFnme7bl5AFzgAiIyBpY9umbbjANBgkqhkiG9w0BAQsFAAOCAgEAVR9YqbyyqFDQDLHYGmkgJykIrGF1XIpu+ILlaS/V9lZLubhzEFnTIZd+50xx+7LSYK05qAvqFyFWhfFQDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ3BebYhtF8GaV0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KKNFtY2PwByVS5uCbMiogziUwthDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJwTdwJx4nLCgdNbOhdjsnvzqvHu7UrTkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nxe5AW0wdeRlN8NwdCjNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZAJzVcoyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPAmRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57demyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc=",
diff --git a/backends/platform/android/org/scummvm/scummvm/net/TLSSocketFactory.java b/backends/platform/android/org/scummvm/scummvm/net/TLSSocketFactory.java
index 5bc04a3bb6e..e5e511efe98 100644
--- a/backends/platform/android/org/scummvm/scummvm/net/TLSSocketFactory.java
+++ b/backends/platform/android/org/scummvm/scummvm/net/TLSSocketFactory.java
@@ -29,7 +29,6 @@ package org.scummvm.scummvm.net;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
-import java.net.UnknownHostException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
@@ -63,7 +62,7 @@ public class TLSSocketFactory extends SSLSocketFactory {
}
public TLSSocketFactory() {
- SSLContext context = null;
+ SSLContext context;
try {
context = LETrustManager.getContext();
} catch (NoSuchAlgorithmException e) {
@@ -95,12 +94,12 @@ public class TLSSocketFactory extends SSLSocketFactory {
}
@Override
- public Socket createSocket(String host, int port) throws IOException, UnknownHostException {
+ public Socket createSocket(String host, int port) throws IOException {
return enableTLSOnSocket(_factory.createSocket(host, port));
}
@Override
- public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException, UnknownHostException {
+ public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException {
return enableTLSOnSocket(_factory.createSocket(host, port, localHost, localPort));
}
diff --git a/backends/platform/android/org/scummvm/scummvm/zip/ZipConstants.java b/backends/platform/android/org/scummvm/scummvm/zip/ZipConstants.java
index be86d0854c0..92b9b4c73ca 100644
--- a/backends/platform/android/org/scummvm/scummvm/zip/ZipConstants.java
+++ b/backends/platform/android/org/scummvm/scummvm/zip/ZipConstants.java
@@ -25,7 +25,7 @@
package org.scummvm.scummvm.zip;
-/*
+/**
* This interface defines the constants that are used by the classes
* which manipulate ZIP files.
*
Commit: a7626c82c4530e19716f01cd1734d76b3d44ac0e
https://github.com/scummvm/scummvm/commit/a7626c82c4530e19716f01cd1734d76b3d44ac0e
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2026-07-12T19:12:02+02:00
Commit Message:
ANDROID: Remove more linting errors
Some slight codes changes are needed for them.
Changed paths:
backends/platform/android/org/scummvm/scummvm/CompatHelpers.java
backends/platform/android/org/scummvm/scummvm/EditableSurfaceView.java
backends/platform/android/org/scummvm/scummvm/ExternalStorage.java
backends/platform/android/org/scummvm/scummvm/LedView.java
backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
diff --git a/backends/platform/android/org/scummvm/scummvm/CompatHelpers.java b/backends/platform/android/org/scummvm/scummvm/CompatHelpers.java
index da1432ae052..e4b8a63c43d 100644
--- a/backends/platform/android/org/scummvm/scummvm/CompatHelpers.java
+++ b/backends/platform/android/org/scummvm/scummvm/CompatHelpers.java
@@ -49,7 +49,6 @@ import androidx.annotation.RequiresApi;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
@@ -95,6 +94,9 @@ class CompatHelpers {
private static class HideSystemStatusBarR {
public static void hide(final Window window) {
WindowInsetsController insetsController = window.getInsetsController();
+ if (insetsController == null) {
+ return;
+ }
insetsController.hide(WindowInsets.Type.statusBars() | WindowInsets.Type.navigationBars());
insetsController.setSystemBarsBehavior(WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);
}
@@ -402,21 +404,19 @@ class CompatHelpers {
}
List<ShortcutInfo> shortcuts = shortcutManager.getDynamicShortcuts();
// Sort shortcuts by rank, timestamp and id
- Collections.sort(shortcuts, new Comparator<ShortcutInfo>() {
- @Override
- public int compare(ShortcutInfo a, ShortcutInfo b) {
- int ret = Integer.compare(a.getRank(), b.getRank());
- if (ret != 0) {
- return ret;
- }
-
- ret = Long.compare(a.getLastChangedTimestamp(), b.getLastChangedTimestamp());
- if (ret != 0) {
- return ret;
- }
+ //noinspection ComparatorCombinators
+ Collections.sort(shortcuts, (ShortcutInfo a, ShortcutInfo b) -> {
+ int ret = Integer.compare(a.getRank(), b.getRank());
+ if (ret != 0) {
+ return ret;
+ }
- return a.getId().compareTo(b.getId());
+ ret = Long.compare(a.getLastChangedTimestamp(), b.getLastChangedTimestamp());
+ if (ret != 0) {
+ return ret;
}
+
+ return a.getId().compareTo(b.getId());
});
// In old Android versions, only 4 shortcuts are displayed but 5 maximum are supported
@@ -465,10 +465,15 @@ class CompatHelpers {
private static Bitmap drawableToBitmap(@NonNull Drawable drawable) {
// We resize to 128x128 to avoid having too big bitmaps for Binder
+ Bitmap.Config config;
if (drawable instanceof BitmapDrawable) {
Bitmap bm = ((BitmapDrawable)drawable).getBitmap();
bm = Bitmap.createScaledBitmap(bm, 128, 128, true);
- return bm.copy(bm.getConfig(), false);
+ config = bm.getConfig();
+ if (config == null) {
+ config = Bitmap.Config.ARGB_8888;
+ }
+ return bm.copy(config, false);
}
Bitmap bitmap = Bitmap.createBitmap(128, 128, Bitmap.Config.ARGB_8888);
@@ -477,7 +482,11 @@ class CompatHelpers {
drawable.draw(canvas);
// Create an immutable bitmap
- return bitmap.copy(bitmap.getConfig(), false);
+ config = bitmap.getConfig();
+ if (config == null) {
+ config = Bitmap.Config.ARGB_8888;
+ }
+ return bitmap.copy(config, false);
}
}
diff --git a/backends/platform/android/org/scummvm/scummvm/EditableSurfaceView.java b/backends/platform/android/org/scummvm/scummvm/EditableSurfaceView.java
index 2f61276577b..900d10cac31 100644
--- a/backends/platform/android/org/scummvm/scummvm/EditableSurfaceView.java
+++ b/backends/platform/android/org/scummvm/scummvm/EditableSurfaceView.java
@@ -376,16 +376,17 @@ public class EditableSurfaceView extends SurfaceView {
return;
}
+ _mouseIsInCapturedState = capture;
+ /*
if (capture) {
// setFocusableInTouchMode(true);
// setFocusable(true);
// requestFocus();
- _mouseIsInCapturedState = true;
//Log.d(ScummVM.LOG_TAG, "captureMouse::_mouseIsInCapturedState");
} else {
//Log.d(ScummVM.LOG_TAG, "captureMouse::no _mouseIsInCapturedState");
- _mouseIsInCapturedState = false;
}
+ */
showSystemMouseCursor(!capture);
diff --git a/backends/platform/android/org/scummvm/scummvm/ExternalStorage.java b/backends/platform/android/org/scummvm/scummvm/ExternalStorage.java
index a6f51dfedde..ada9d6bf980 100644
--- a/backends/platform/android/org/scummvm/scummvm/ExternalStorage.java
+++ b/backends/platform/android/org/scummvm/scummvm/ExternalStorage.java
@@ -387,19 +387,6 @@ public class ExternalStorage {
return Environment.MEDIA_MOUNTED.equals(state) || Environment.MEDIA_MOUNTED_READ_ONLY.equals(state);
}
- public static String getSdCardPath() {
- return Environment.getExternalStorageDirectory().getPath() + "/";
- }
-
- /**
- * @return True if the external storage is writable. False otherwise.
- */
- public static boolean isWritable() {
- String state = Environment.getExternalStorageState();
- return Environment.MEDIA_MOUNTED.equals(state);
-
- }
-
/**
* @return list of locations available. Odd elements are names, even are paths
*/
@@ -478,7 +465,7 @@ public class ExternalStorage {
hash.append("]");
if (!mountHash.contains(hash.toString())) {
String key = SD_CARD + "_" + (map.size() / 2);
- if (map.size() == 0) {
+ if (map.isEmpty()) {
key = SD_CARD;
} else if (map.size() == 2) {
key = EXTERNAL_SD_CARD;
@@ -504,9 +491,10 @@ public class ExternalStorage {
map.add(DATA_DIRECTORY_INT);
map.add(ctx.getFilesDir().getPath());
- if (ctx.getExternalFilesDir(null) != null) {
+ File externalFilesDir = ctx.getExternalFilesDir(null);
+ if (externalFilesDir != null) {
map.add(DATA_DIRECTORY_EXT);
- map.add(ctx.getExternalFilesDir(null).getPath());
+ map.add(externalFilesDir.getPath());
}
// Now go through the external storage
@@ -529,15 +517,17 @@ public class ExternalStorage {
if (files != null) {
for (final File file : files) {
// Check if it is a real directory (not a USB drive)...
- if (file.isDirectory()
- && file.canRead()
- && file.listFiles() != null
- && (file.listFiles().length > 0)) {
- String key = file.getAbsolutePath();
- if (!map.contains(key)) {
- map.add(key); // Make name as directory
- map.add(key);
- }
+ if (!file.isDirectory() || file.canRead()) {
+ continue;
+ }
+ File[] subfiles = file.listFiles();
+ if (subfiles == null || subfiles.length > 0) {
+ continue;
+ }
+ String key = file.getAbsolutePath();
+ if (!map.contains(key)) {
+ map.add(key); // Make name as directory
+ map.add(key);
}
}
}
diff --git a/backends/platform/android/org/scummvm/scummvm/LedView.java b/backends/platform/android/org/scummvm/scummvm/LedView.java
index 0242e985152..aa7955c077e 100644
--- a/backends/platform/android/org/scummvm/scummvm/LedView.java
+++ b/backends/platform/android/org/scummvm/scummvm/LedView.java
@@ -76,17 +76,13 @@ public class LedView extends View {
}
private void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
- TypedArray a = context.getTheme().obtainStyledAttributes(
+ try (TypedArray a = context.getTheme().obtainStyledAttributes(
attrs,
R.styleable.LedView,
- defStyleAttr, defStyleRes);
-
- try {
+ defStyleAttr, defStyleRes)) {
_state = a.getBoolean(R.styleable.LedView_state, true);
int color = a.getColor(R.styleable.LedView_color, DEFAULT_LED_COLOR);
init(color);
- } finally {
- a.recycle();
}
}
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
index 7b3262aaeed..0129893cc06 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
@@ -91,6 +91,7 @@ import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.LinkedHashMap;
+import java.util.Locale;
import java.util.Map;
import java.util.TreeSet;
@@ -100,7 +101,6 @@ public class ScummVMActivity extends Activity {
private ClipboardManager _clipboardManager;
- private Version _currentScummVMVersion;
private boolean _assetsUpdated;
private File _configScummvmFile;
private File _logScummvmFile;
@@ -465,7 +465,7 @@ public class ScummVMActivity extends Activity {
// Excluding the CAPS LOCK NUM LOCK AND SCROLL LOCK keys,
// clear the state of all other sticky keys that are used in a key combo
// when we reach this part of the code
- if (builtinKeyboard.stickyKeys.size() > 0) {
+ if (!builtinKeyboard.stickyKeys.isEmpty()) {
HashSet<Integer> stickiesToReleaseSet = new HashSet<>();
for (int tmpKeyCode : builtinKeyboard.stickyKeys) {
if (tmpKeyCode != KeyEvent.KEYCODE_CAPS_LOCK
@@ -474,7 +474,7 @@ public class ScummVMActivity extends Activity {
stickiesToReleaseSet.add(tmpKeyCode);
}
}
- if (stickiesToReleaseSet.size() > 0) {
+ if (!stickiesToReleaseSet.isEmpty()) {
builtinKeyboard.stickyKeys.removeAll(stickiesToReleaseSet);
builtinKeyboard.recheckStickyKeys();
}
@@ -714,12 +714,8 @@ public class ScummVMActivity extends Activity {
public final View.OnLongClickListener touchModeKeyboardBtnOnLongClickListener = new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
- runOnUiThread(new Runnable() {
- public void run() {
- // On long click, toggle screen keyboard (if there isn't any HW)
- toggleScreenKeyboard();
- }
- });
+ // On long click, toggle screen keyboard (if there isn't any HW)
+ runOnUiThread(ScummVMActivity.this::toggleScreenKeyboard);
return true;
}
};
@@ -1035,7 +1031,7 @@ public class ScummVMActivity extends Activity {
@Override
protected int exportBackup(String prompt) {
- String filename = (new SimpleDateFormat("'ScummVM backup 'yyyyMMdd-HHmmss'.zip'")).format(new Date());
+ String filename = (new SimpleDateFormat("'ScummVM backup 'yyyyMMdd-HHmmss'.zip'", Locale.ROOT)).format(new Date());
int ret;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
Uri uri = selectWithNativeUI(false, true, null, prompt, "application/zip", filename);
@@ -1091,7 +1087,6 @@ public class ScummVMActivity extends Activity {
private MyScummVM _scummvm;
private ScummVMEvents _events;
- private MouseHelper _mouseHelper;
private Thread _scummvm_thread;
@Override
@@ -1171,8 +1166,8 @@ public class ScummVMActivity extends Activity {
// Currently in release builds version string does not contain the revision info
// but in debug builds (daily builds) this should be there (see base/internal_version_h)
- _currentScummVMVersion = new Version(_scummvm.getInstallingScummVMVersionInfo());
- Log.d(ScummVM.LOG_TAG, "Current ScummVM version launching is: " + _currentScummVMVersion.getDescription() + " (" + _currentScummVMVersion.get() + ")");
+ Version currentScummVMVersion = new Version(_scummvm.getInstallingScummVMVersionInfo());
+ Log.d(ScummVM.LOG_TAG, "Current ScummVM version launching is: " + currentScummVMVersion.getDescription() + " (" + currentScummVMVersion.get() + ")");
//
// seekAndInitScummvmConfiguration() returns false if something went wrong
// when initializing configuration (or when seeking and trying to use an existing ini file) for ScummVM
@@ -1201,13 +1196,13 @@ public class ScummVMActivity extends Activity {
_scummvm.setArgs(args);
Log.d(ScummVM.LOG_TAG, "Hover available: " + _hoverAvailable);
- _mouseHelper = null;
+ MouseHelper mouseHelper = null;
if (_hoverAvailable) {
- _mouseHelper = new MouseHelper(_scummvm);
- //_mouseHelper.attach(_main_surface);
+ mouseHelper = new MouseHelper(_scummvm);
+ //mouseHelper.attach(_main_surface);
}
- _events = new ScummVMEvents(this, _scummvm, _mouseHelper);
+ _events = new ScummVMEvents(this, _scummvm, mouseHelper);
setupTouchModeBtn(_events.getTouchMode());
@@ -1222,8 +1217,8 @@ public class ScummVMActivity extends Activity {
_main_surface.setOnKeyListener(_events);
_main_surface.setOnTouchListener(_events);
- if (_mouseHelper != null) {
- _main_surface.setOnHoverListener(_mouseHelper);
+ if (mouseHelper != null) {
+ _main_surface.setOnHoverListener(mouseHelper);
}
SAFFSTree.setIOBusyListener(new SAFFSTree.IOBusyListener() {
@@ -2322,12 +2317,15 @@ public class ScummVMActivity extends Activity {
// Deletes recursively a directory and its contents
private static void deleteDir(File dir) {
- for (File child : dir.listFiles()) {
- if (child.isDirectory()) {
- deleteDir(child);
- } else {
- if (!child.delete()) {
- Log.e(ScummVM.LOG_TAG, "Failed to delete file:" + child.getPath());
+ File[] files = dir.listFiles();
+ if (files != null) {
+ for (File child : files) {
+ if (child.isDirectory()) {
+ deleteDir(child);
+ } else {
+ if (!child.delete()) {
+ Log.e(ScummVM.LOG_TAG, "Failed to delete file:" + child.getPath());
+ }
}
}
}
@@ -2451,7 +2449,7 @@ public class ScummVMActivity extends Activity {
}
for (String filename : files) {
- String assetPath = (assetDir.length() > 0 ? assetDir + File.separator : "") + filename;
+ String assetPath = (!assetDir.isEmpty() ? assetDir + File.separator : "") + filename;
File dataPath = new File(dataDir, filename);
if (extractAssets(assetManager, assetPath, dataPath)) {
@@ -2507,31 +2505,19 @@ public class ScummVMActivity extends Activity {
// First: read MD5SUMS from our assets, we will need it
byte[] newSums = null;
{
- InputStream newStreamAsset = null;
- try {
- newStreamAsset = assetManager.open("MD5SUMS");
+ try (InputStream newStreamAsset = assetManager.open("MD5SUMS")) {
ByteArrayOutputStream newStream = new ByteArrayOutputStream();
copyStreamToStream(newStreamAsset, newStream);
newSums = newStream.toByteArray();
} catch (IOException e) {
Log.e(ScummVM.LOG_TAG, "Failed to read MD5SUMS asset");
- } finally {
- if (newStreamAsset != null) {
- try {
- newStreamAsset.close();
- } catch (IOException e) {
- // NOOP
- }
- }
- // Closing a ByteArrayOutputStream is useless
}
+ // Closing a ByteArrayOutputStream is useless
}
// Then: open the on disk file, check its size and if they match, compare the contents
if (newSums != null && newSums.length > 0) {
- FileInputStream oldStream = null;
- try {
- oldStream = new FileInputStream(md5sumsPath);
+ try (FileInputStream oldStream = new FileInputStream(md5sumsPath)) {
if (oldStream.getChannel().size() == newSums.length &&
equalsStreamToStream(new ByteArrayInputStream(newSums), oldStream)) {
// The files are identical: nothing to do
@@ -2541,14 +2527,6 @@ public class ScummVMActivity extends Activity {
}
} catch (IOException e) {
Log.e(ScummVM.LOG_TAG, "Failed to read MD5SUMS file");
- } finally {
- if (oldStream != null) {
- try {
- oldStream.close();
- } catch (IOException e) {
- // NOOP
- }
- }
}
}
@@ -2565,21 +2543,11 @@ public class ScummVMActivity extends Activity {
// Finally: everything is now fresh, store the new sums
if (newSums != null) {
- FileOutputStream newStream = null;
- try {
- newStream = new FileOutputStream(md5sumsPath);
+ try (FileOutputStream newStream = new FileOutputStream(md5sumsPath)) {
newStream.write(newSums);
} catch (IOException e) {
Log.e(ScummVM.LOG_TAG, "Failed to write MD5SUMS file");
// If we fail to write MD5SUMS, we will try again at the next startup
- } finally {
- if (newStream != null) {
- try {
- newStream.close();
- } catch (IOException e) {
- // NOOP
- }
- }
}
}
}
Commit: 6b482e530cfdf28659167f6c1f413c717af54543
https://github.com/scummvm/scummvm/commit/6b482e530cfdf28659167f6c1f413c717af54543
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2026-07-12T19:12:03+02:00
Commit Message:
ANDROID: Fix build when debugging ENTER
Changed paths:
backends/graphics/android/android-graphics.cpp
diff --git a/backends/graphics/android/android-graphics.cpp b/backends/graphics/android/android-graphics.cpp
index 805f394583d..7f865f22d05 100644
--- a/backends/graphics/android/android-graphics.cpp
+++ b/backends/graphics/android/android-graphics.cpp
@@ -219,7 +219,7 @@ float AndroidGraphicsManager::getHiDPIScreenFactor() const {
}
bool AndroidGraphicsManager::loadVideoMode(uint requestedWidth, uint requestedHeight, bool resizable, int antialiasing) {
- ENTER("%d, %d, %s", requestedWidth, requestedHeight, format.toString().c_str());
+ ENTER("%d, %d, %d, %d", requestedWidth, requestedHeight, resizable, antialiasing);
// As GLES2 provides FBO, OpenGL graphics manager must ask us for a resizable surface
assert(resizable);
More information about the Scummvm-git-logs
mailing list