[Scummvm-git-logs] scummvm master -> f7fc60d045e3a2fd6e0d4b5109fc38c36f27e1db
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:
acccb564cb ANDROID: Don't crash when fetchChildren failed in Java
113100ded2 ANDROID: Allow to set same pause status from Java several times
d97d89dc27 ANDROID: Fix onDestroy cleanup
f7fc60d045 ANDROID: Make sure ScummVMActivity is always run once
Commit: acccb564cb82abc7f3086370ff59e07a7fe27080
https://github.com/scummvm/scummvm/commit/acccb564cb82abc7f3086370ff59e07a7fe27080
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-03-18T12:01:05+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 7cd2e3b730f..c46c91491c2 100644
--- a/backends/fs/android/android-saf-fs.cpp
+++ b/backends/fs/android/android-saf-fs.cpp
@@ -386,6 +386,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: 113100ded2675d9b600c4c9dcff5ce6e1ef3d17d
https://github.com/scummvm/scummvm/commit/113100ded2675d9b600c4c9dcff5ce6e1ef3d17d
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-03-18T12:01:05+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: d97d89dc2738a8e1fa5d8ac0497a00130886d7b5
https://github.com/scummvm/scummvm/commit/d97d89dc2738a8e1fa5d8ac0497a00130886d7b5
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-03-18T12:01:05+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 1b38547de32..a8bd33e7aac 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 },
@@ -857,6 +862,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();
@@ -935,8 +942,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();
}
});
@@ -1051,9 +1058,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);
@@ -1061,6 +1072,7 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
Log.i(ScummVM.LOG_TAG, "Error while joining ScummVM thread", e);
}
+ _finishing = false;
_scummvm = null;
}
Commit: f7fc60d045e3a2fd6e0d4b5109fc38c36f27e1db
https://github.com/scummvm/scummvm/commit/f7fc60d045e3a2fd6e0d4b5109fc38c36f27e1db
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-03-18T12:01:05+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