[Scummvm-git-logs] scummvm branch-2-7 -> 2eb8536fc317bfc37983cbcdd09eba8bb31c1f1c
lephilousophe
noreply at scummvm.org
Sat Mar 18 11:02:50 UTC 2023
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
0df602e029 ANDROID: Don't crash when fetchChildren failed in Java
8eaf219e85 ANDROID: Allow to set same pause status from Java several times
dfb465dd05 ANDROID: Fix onDestroy cleanup
2eb8536fc3 ANDROID: Make sure ScummVMActivity is always run once
Commit: 0df602e0296c62446b33620388aa864224c97bf0
https://github.com/scummvm/scummvm/commit/0df602e0296c62446b33620388aa864224c97bf0
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-03-18T12:00:21+01:00
Commit Message:
ANDROID: Don't crash when fetchChildren failed in Java
Changed paths:
backends/fs/android/android-saf-fs.cpp
diff --git a/backends/fs/android/android-saf-fs.cpp b/backends/fs/android/android-saf-fs.cpp
index ea315d3ed5f..bd148519331 100644
--- a/backends/fs/android/android-saf-fs.cpp
+++ b/backends/fs/android/android-saf-fs.cpp
@@ -385,6 +385,11 @@ bool AndroidSAFFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode
return false;
}
+ if (!array) {
+ // Fetching children failed: a log error has already been produced in Java code
+ return false;
+ }
+
myList.clear();
jsize size = env->GetArrayLength(array);
Commit: 8eaf219e856135141e748f1f80e7b69110eb33a5
https://github.com/scummvm/scummvm/commit/8eaf219e856135141e748f1f80e7b69110eb33a5
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-03-18T12:00:21+01:00
Commit Message:
ANDROID: Allow to set same pause status from Java several times
Changed paths:
backends/platform/android/jni-android.cpp
diff --git a/backends/platform/android/jni-android.cpp b/backends/platform/android/jni-android.cpp
index f87baaf0ca0..bc38d630c63 100644
--- a/backends/platform/android/jni-android.cpp
+++ b/backends/platform/android/jni-android.cpp
@@ -910,16 +910,18 @@ void JNI::setPause(JNIEnv *env, jobject self, jboolean value) {
if (value)
JNI::_pauseToken = g_engine->pauseEngine();
- else
+ else if (JNI::_pauseToken.isActive())
JNI::_pauseToken.clear();
}
- pause = value;
+ if (pause != value) {
+ pause = value;
- if (!pause) {
- // wake up all threads
- for (uint i = 0; i < 3; ++i)
- sem_post(&pause_sem);
+ if (!pause) {
+ // wake up all threads
+ for (uint i = 0; i < 3; ++i)
+ sem_post(&pause_sem);
+ }
}
}
Commit: dfb465dd05a9f05ecd3ae749ee399f4b7697e386
https://github.com/scummvm/scummvm/commit/dfb465dd05a9f05ecd3ae749ee399f4b7697e386
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-03-18T12:00:21+01:00
Commit Message:
ANDROID: Fix onDestroy cleanup
onDestroy could never work before as it was sending a quit event to a
paused C++ code.
Make sure C++ code is unpaused.
In addition don't call finish in termination callback if finish was
responsibile of the termination. Else, finish events get queued in
Android and a new ScummVMActivity gets killed immediately.
Changed paths:
backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
index 56bf41b8aed..6c9561949ef 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
@@ -131,6 +131,11 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
// boolean _isPaused = false;
private InputMethodManager _inputManager = null;
+ // Set to true in onDestroy
+ // This avoids that when C++ terminates we call finish() a second time
+ // This second finish causes termination when we are launched again
+ boolean _finishing = false;
+
private final int[][] TextInputKeyboardList =
{
{ 0, R.xml.qwerty },
@@ -854,6 +859,8 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
@Override
public void onCreate(Bundle savedInstanceState) {
+// Log.d(ScummVM.LOG_TAG, "onCreate");
+
super.onCreate(savedInstanceState);
safSyncObject = new Object();
@@ -932,8 +939,8 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
@Override
public void handle(int exitResult) {
Log.d(ScummVM.LOG_TAG, "Via callback: ScummVM native terminated with code: " + exitResult);
- // call onDestroy()
- finish();
+ // call onDestroy() only we we aren't already in it
+ if (!_finishing) finish();
}
});
@@ -1048,9 +1055,13 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
super.onDestroy();
if (_events != null) {
+ _finishing = true;
+
_events.clearEventHandler();
_events.sendQuitEvent();
+ // Make sure the thread is actively polling for events
+ _scummvm.setPause(false);
try {
// 1s timeout
_scummvm_thread.join(1000);
@@ -1058,6 +1069,7 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
Log.i(ScummVM.LOG_TAG, "Error while joining ScummVM thread", e);
}
+ _finishing = false;
_scummvm = null;
}
Commit: 2eb8536fc317bfc37983cbcdd09eba8bb31c1f1c
https://github.com/scummvm/scummvm/commit/2eb8536fc317bfc37983cbcdd09eba8bb31c1f1c
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-03-18T12:00:21+01:00
Commit Message:
ANDROID: Make sure ScummVMActivity is always run once
We don't support having multiple instances of ScummVMActivity running at
the same time (because of the system singleton in C++).
Changed paths:
dists/android/AndroidManifest.xml
diff --git a/dists/android/AndroidManifest.xml b/dists/android/AndroidManifest.xml
index 5f9a99af9ce..701758ffe31 100644
--- a/dists/android/AndroidManifest.xml
+++ b/dists/android/AndroidManifest.xml
@@ -61,6 +61,7 @@
android:exported="false"
android:banner="@drawable/leanback_icon"
android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
+ android:launchMode="singleInstance"
android:screenOrientation="landscape"
android:theme="@style/AppTheme"
android:windowSoftInputMode="adjustResize">
More information about the Scummvm-git-logs
mailing list