[Scummvm-git-logs] scummvm master -> 52024ecfe19ddba2b08f684d2a333d631decb720

lephilousophe noreply at scummvm.org
Sun Jun 29 09:00:54 UTC 2025


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
475962c5ba ANDROID: Make removal failures clearer
52024ecfe1 ANDROID: Update Gradle & Android Gradle Plugin


Commit: 475962c5ba1a88ed2450fadfbfdbdbd7bcd58fba
    https://github.com/scummvm/scummvm/commit/475962c5ba1a88ed2450fadfbfdbdbd7bcd58fba
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-06-29T11:00:36+02:00

Commit Message:
ANDROID: Make removal failures clearer

Changed paths:
    backends/fs/android/android-fs.h
    backends/fs/android/android-posix-fs.cpp
    backends/fs/android/android-posix-fs.h
    backends/fs/android/android-saf-fs.cpp
    backends/fs/android/android-saf-fs.h
    backends/platform/android/android.cpp
    backends/platform/android/org/scummvm/scummvm/SAFFSTree.java


diff --git a/backends/fs/android/android-fs.h b/backends/fs/android/android-fs.h
index 1e88c74ffb6..5f90284cd7c 100644
--- a/backends/fs/android/android-fs.h
+++ b/backends/fs/android/android-fs.h
@@ -29,7 +29,7 @@
 class AndroidFSNode {
 public:
 	virtual ~AndroidFSNode() {}
-	virtual bool remove() = 0;
+	virtual int remove() = 0;
 };
 
 #endif
diff --git a/backends/fs/android/android-posix-fs.cpp b/backends/fs/android/android-posix-fs.cpp
index 7b8d89c41d3..d1459caaba2 100644
--- a/backends/fs/android/android-posix-fs.cpp
+++ b/backends/fs/android/android-posix-fs.cpp
@@ -21,6 +21,7 @@
 
 // For remove()
 #include <stdio.h>
+#include <errno.h>
 
 #include "backends/fs/android/android-fs-factory.h"
 #include "backends/fs/android/android-posix-fs.h"
@@ -34,10 +35,10 @@ AbstractFSNode *AndroidPOSIXFilesystemNode::makeNode(const Common::String &path)
 	return AndroidFilesystemFactory::instance().makeFileNodePath(path);
 }
 
-bool AndroidPOSIXFilesystemNode::remove() {
+int AndroidPOSIXFilesystemNode::remove() {
 	if (::remove(_path.c_str()) != 0)
-		return false;
+		return errno;
 
 	setFlags();
-	return true;
+	return 0;
 }
diff --git a/backends/fs/android/android-posix-fs.h b/backends/fs/android/android-posix-fs.h
index 4628a1e9a50..9ffbd2ccddd 100644
--- a/backends/fs/android/android-posix-fs.h
+++ b/backends/fs/android/android-posix-fs.h
@@ -33,7 +33,7 @@ protected:
 	AbstractFSNode *makeNode() const override;
 	AbstractFSNode *makeNode(const Common::String &path) const override;
 
-	bool remove() override;
+	int remove() override;
 
 public:
 	AndroidPOSIXFilesystemNode(const Common::String &path, const Config &config)
diff --git a/backends/fs/android/android-saf-fs.cpp b/backends/fs/android/android-saf-fs.cpp
index 38d5fa8bf40..cce887a8f8e 100644
--- a/backends/fs/android/android-saf-fs.cpp
+++ b/backends/fs/android/android-saf-fs.cpp
@@ -42,6 +42,7 @@
 
 // Allow calling of close system call
 #include <unistd.h>
+#include <errno.h> // For remove error codes
 
 #include "backends/platform/android/android.h"
 #include "backends/platform/android/jni-android.h"
@@ -132,7 +133,7 @@ void AndroidSAFFilesystemNode::initJNI() {
 	FIND_METHOD(, createFile, "(JLjava/lang/String;)" SAFFSNodeSig);
 	FIND_METHOD(, createReadStream, "(J)I");
 	FIND_METHOD(, createWriteStream, "(J)I");
-	FIND_METHOD(, removeNode, "(J)Z");
+	FIND_METHOD(, removeNode, "(J)I");
 	FIND_METHOD(, removeTree, "()V");
 
 	FIND_FIELD(, _treeName, "Ljava/lang/String;");
@@ -660,26 +661,26 @@ bool AndroidSAFFilesystemNode::createDirectory() {
 	return true;
 }
 
-bool AndroidSAFFilesystemNode::remove() {
+int AndroidSAFFilesystemNode::remove() {
 	assert(_safTree != nullptr);
 
 	if (!_safNode) {
-		return false;
+		return ENOENT;
 	}
 
 	if (!_safParent) {
 		// It's the root of the tree: we can't delete it
-		return false;
+		return EPERM;
 	}
 
 	if (isDirectory()) {
 		// Don't delete folders (yet?)
-		return false;
+		return EPERM;
 	}
 
 	JNIEnv *env = JNI::getEnv();
 
-	bool result = env->CallBooleanMethod(_safTree, _MID_removeNode, _safNode.get());
+	jint result = env->CallIntMethod(_safTree, _MID_removeNode, _safNode.get());
 
 	if (env->ExceptionCheck()) {
 		LOGE("SAFFSTree::removeNode failed");
@@ -687,11 +688,11 @@ bool AndroidSAFFilesystemNode::remove() {
 		env->ExceptionDescribe();
 		env->ExceptionClear();
 
-		return false;
+		return EIO;
 	}
 
-	if (!result) {
-		return false;
+	if (result) {
+		return result;
 	}
 
 	_safNode.reset();
@@ -700,7 +701,7 @@ bool AndroidSAFFilesystemNode::remove() {
 
 	jobject jparent = _safParent.localRef(env);
 	if (!jparent)
-		return false;
+		return EIO;
 
 	AndroidSAFFilesystemNode *parent = new AndroidSAFFilesystemNode(_safTree, jparent);
 	env->DeleteLocalRef(jparent);
@@ -715,7 +716,7 @@ bool AndroidSAFFilesystemNode::remove() {
 
 	delete parent;
 
-	return true;
+	return 0;
 }
 
 void AndroidSAFFilesystemNode::removeTree() {
@@ -908,6 +909,10 @@ bool AddSAFFakeNode::isWritable() const {
 	return _proxied->isWritable();
 }
 
+int AddSAFFakeNode::remove() {
+	return EPERM;
+}
+
 void AddSAFFakeNode::makeProxySAF() const {
 	assert(!_fromPath);
 
diff --git a/backends/fs/android/android-saf-fs.h b/backends/fs/android/android-saf-fs.h
index 765e878cc34..8619951c513 100644
--- a/backends/fs/android/android-saf-fs.h
+++ b/backends/fs/android/android-saf-fs.h
@@ -193,7 +193,7 @@ public:
 	Common::SeekableWriteStream *createWriteStream(bool atomic) override;
 	bool createDirectory() override;
 
-	bool remove() override;
+	int remove() override;
 
 	/**
 	 * Removes the SAF tree.
@@ -262,7 +262,7 @@ public:
 	Common::SeekableWriteStream *createWriteStream(bool atomic) override { return nullptr; }
 
 	bool createDirectory() override { return false; }
-	bool remove() override { return false; }
+	int remove() override;
 
 private:
 	void makeProxySAF() const;
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp
index e09506a6d5f..c9e4cf04840 100644
--- a/backends/platform/android/android.cpp
+++ b/backends/platform/android/android.cpp
@@ -47,6 +47,7 @@
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <sys/system_properties.h>
+#include <errno.h> // For remove error codes
 #include <time.h>
 #include <unistd.h>
 #include <dlfcn.h>
@@ -164,11 +165,19 @@ public:
 			return Common::kUnknownError;
 		}
 
-		bool ret = anode->remove();
-
+		int err = anode->remove();
 		delete anode;
 
-		return ret ? Common::kNoError : Common::kUnknownError;
+		switch (err) {
+		case 0:
+			return Common::kNoError;
+		case EACCES:
+			return Common::kWritePermissionDenied;
+		case ENOENT:
+			return Common::kPathDoesNotExist;
+		default:
+			return Common::kUnknownError;
+		}
 	}
 };
 
diff --git a/backends/platform/android/org/scummvm/scummvm/SAFFSTree.java b/backends/platform/android/org/scummvm/scummvm/SAFFSTree.java
index f27f05a467c..24c2f2fa796 100644
--- a/backends/platform/android/org/scummvm/scummvm/SAFFSTree.java
+++ b/backends/platform/android/org/scummvm/scummvm/SAFFSTree.java
@@ -9,6 +9,7 @@ import android.net.Uri;
 import android.os.Build;
 import android.os.ParcelFileDescriptor;
 import android.provider.DocumentsContract;
+import android.system.OsConstants;
 import android.util.Log;
 
 import androidx.annotation.RequiresApi;
@@ -566,7 +567,7 @@ public class SAFFSTree {
 		return createWriteStream(node);
 	}
 
-	public boolean removeNode(SAFFSNode node) {
+	public int removeNode(SAFFSNode node) {
 		final ContentResolver resolver = _context.getContentResolver();
 		final Uri uri = DocumentsContract.buildDocumentUriUsingTree(_treeUri, node._documentId);
 
@@ -577,10 +578,10 @@ public class SAFFSTree {
 
 			try {
 				if (!DocumentsContract.removeDocument(resolver, uri, parentUri)) {
-					return false;
+					return OsConstants.EIO;
 				}
 			} catch(FileNotFoundException e) {
-				return false;
+				return OsConstants.ENOENT;
 			} finally {
 				long endIO = System.currentTimeMillis();
 				reportIO(startIO, endIO);
@@ -590,27 +591,27 @@ public class SAFFSTree {
 
 			try {
 				if (!DocumentsContract.deleteDocument(resolver, uri)) {
-					return false;
+					return OsConstants.EIO;
 				}
 			} catch(FileNotFoundException e) {
-				return false;
+				return OsConstants.ENOENT;
 			} finally {
 				long endIO = System.currentTimeMillis();
 				reportIO(startIO, endIO);
 			}
 		} else {
-			return false;
+			return OsConstants.EPERM;
 		}
 
 		// Cleanup node
 		node._parent._dirty = true;
 		node.reset(null, null, null, 0);
 
-		return true;
+		return 0;
 	}
 
 	// This version is used by the C++ side
-	public boolean removeNode(long nodeId) {
+	public int removeNode(long nodeId) {
 		SAFFSNode node = _nodes.get(nodeId);
 		assert(node != null);
 


Commit: 52024ecfe19ddba2b08f684d2a333d631decb720
    https://github.com/scummvm/scummvm/commit/52024ecfe19ddba2b08f684d2a333d631decb720
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-06-29T11:00:36+02:00

Commit Message:
ANDROID: Update Gradle & Android Gradle Plugin

Changed paths:
    dists/android/build.gradle
    dists/android/gradle/wrapper/gradle-wrapper.jar
    dists/android/gradle/wrapper/gradle-wrapper.properties
    dists/android/gradlew


diff --git a/dists/android/build.gradle b/dists/android/build.gradle
index d46d9b72198..cfa6c9c3934 100644
--- a/dists/android/build.gradle
+++ b/dists/android/build.gradle
@@ -5,7 +5,7 @@ buildscript {
         mavenCentral()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:8.10.0'
+        classpath 'com.android.tools.build:gradle:8.11.0'
     }
 }
 
diff --git a/dists/android/gradle/wrapper/gradle-wrapper.jar b/dists/android/gradle/wrapper/gradle-wrapper.jar
index a4b76b9530d..9bbc975c742 100644
Binary files a/dists/android/gradle/wrapper/gradle-wrapper.jar and b/dists/android/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/dists/android/gradle/wrapper/gradle-wrapper.properties b/dists/android/gradle/wrapper/gradle-wrapper.properties
index 37f853b1c84..ff23a68d70f 100644
--- a/dists/android/gradle/wrapper/gradle-wrapper.properties
+++ b/dists/android/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
 networkTimeout=10000
 validateDistributionUrl=true
 zipStoreBase=GRADLE_USER_HOME
diff --git a/dists/android/gradlew b/dists/android/gradlew
index f5feea6d6b1..faf93008b77 100755
--- a/dists/android/gradlew
+++ b/dists/android/gradlew
@@ -86,8 +86,7 @@ done
 # shellcheck disable=SC2034
 APP_BASE_NAME=${0##*/}
 # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
-APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
-' "$PWD" ) || exit
+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
 
 # Use the maximum available, or set MAX_FD != -1 to use that value.
 MAX_FD=maximum
@@ -206,7 +205,7 @@ fi
 DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
 
 # Collect all arguments for the java command:
-#   * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
 #     and any embedded shellness will be escaped.
 #   * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
 #     treated as '${Hostname}' itself on the command line.




More information about the Scummvm-git-logs mailing list