getHostPlugins(Godot engine) {
+ return Collections.emptySet();
+ }
}
diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotService.kt b/platform/android/java/lib/src/org/godotengine/godot/GodotService.kt
index 68cd2c13586e..795dc921c7fa 100644
--- a/platform/android/java/lib/src/org/godotengine/godot/GodotService.kt
+++ b/platform/android/java/lib/src/org/godotengine/godot/GodotService.kt
@@ -8,8 +8,10 @@ import android.util.Log
/**
* Godot service responsible for hosting the Godot engine instance.
+ *
+ * Note: Still in development, so it's made private and inaccessible until completed.
*/
-class GodotService : Service() {
+private class GodotService : Service() {
companion object {
private val TAG = GodotService::class.java.simpleName
diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java b/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java
index c8b222254e60..38c115ad7f6a 100644
--- a/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java
+++ b/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java
@@ -95,7 +95,7 @@ public void enableLongPress(boolean enable) {
/**
* Enable multi-fingers pan & scale gestures. This is false by default.
- *
+ *
* Note: This may interfere with multi-touch handling / support.
*/
public void enablePanningAndScalingGestures(boolean enable) {
diff --git a/platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPluginRegistry.java b/platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPluginRegistry.java
index d338b724418e..711bca02e7d8 100644
--- a/platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPluginRegistry.java
+++ b/platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPluginRegistry.java
@@ -42,8 +42,8 @@
import androidx.annotation.Nullable;
import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
+import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
/**
@@ -64,9 +64,8 @@ public final class GodotPluginRegistry {
private static GodotPluginRegistry instance;
private final ConcurrentHashMap registry;
- private GodotPluginRegistry(Godot godot) {
+ private GodotPluginRegistry() {
registry = new ConcurrentHashMap<>();
- loadPlugins(godot);
}
/**
@@ -93,12 +92,14 @@ public Collection getAllPlugins() {
* documentation.
*
* @param godot Godot instance
+ * @param runtimePlugins Set of plugins provided at runtime for registration
* @return A singleton instance of {@link GodotPluginRegistry}. This ensures that only one instance
* of each Godot Android plugins is available at runtime.
*/
- public static GodotPluginRegistry initializePluginRegistry(Godot godot) {
+ public static GodotPluginRegistry initializePluginRegistry(Godot godot, Set runtimePlugins) {
if (instance == null) {
- instance = new GodotPluginRegistry(godot);
+ instance = new GodotPluginRegistry();
+ instance.loadPlugins(godot, runtimePlugins);
}
return instance;
@@ -108,7 +109,7 @@ public static GodotPluginRegistry initializePluginRegistry(Godot godot) {
* Return the plugin registry if it's initialized.
* Throws a {@link IllegalStateException} exception if not.
*
- * @throws IllegalStateException if {@link GodotPluginRegistry#initializePluginRegistry(Godot)} has not been called prior to calling this method.
+ * @throws IllegalStateException if {@link GodotPluginRegistry#initializePluginRegistry(Godot, Set)} has not been called prior to calling this method.
*/
public static GodotPluginRegistry getPluginRegistry() throws IllegalStateException {
if (instance == null) {
@@ -118,7 +119,16 @@ public static GodotPluginRegistry getPluginRegistry() throws IllegalStateExcepti
return instance;
}
- private void loadPlugins(Godot godot) {
+ private void loadPlugins(Godot godot, Set runtimePlugins) {
+ // Register the runtime plugins
+ if (runtimePlugins != null && !runtimePlugins.isEmpty()) {
+ for (GodotPlugin plugin : runtimePlugins) {
+ Log.i(TAG, "Registering runtime plugin " + plugin.getPluginName());
+ registry.put(plugin.getPluginName(), plugin);
+ }
+ }
+
+ // Register the manifest plugins
try {
final Activity activity = godot.getActivity();
ApplicationInfo appInfo = activity