1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-19 14:31:59 +00:00

Merge pull request #108243 from m4gr3d/fix_android_plugin_init

Android: Fix Android plugins regression
This commit is contained in:
Thaddeus Crews
2025-07-04 10:09:06 -05:00
3 changed files with 5 additions and 3 deletions

View File

@@ -204,7 +204,7 @@ class Godot private constructor(val context: Context) {
* @throws IllegalArgumentException exception if the specified expansion pack (if any) * @throws IllegalArgumentException exception if the specified expansion pack (if any)
* is invalid. * is invalid.
*/ */
fun initEngine(commandLineParams: List<String>, hostPlugins: Set<GodotPlugin>): Boolean { fun initEngine(host: GodotHost?, commandLineParams: List<String>, hostPlugins: Set<GodotPlugin> = Collections.emptySet()): Boolean {
if (isNativeInitialized()) { if (isNativeInitialized()) {
Log.d(TAG, "Engine already initialized") Log.d(TAG, "Engine already initialized")
return true return true
@@ -216,6 +216,8 @@ class Godot private constructor(val context: Context) {
beginBenchmarkMeasure("Startup", "Godot::initEngine") beginBenchmarkMeasure("Startup", "Godot::initEngine")
try { try {
this.primaryHost = host
Log.v(TAG, "Initializing Godot plugin registry") Log.v(TAG, "Initializing Godot plugin registry")
val runtimePlugins = mutableSetOf<GodotPlugin>(AndroidRuntimePlugin(this)) val runtimePlugins = mutableSetOf<GodotPlugin>(AndroidRuntimePlugin(this))
runtimePlugins.addAll(hostPlugins) runtimePlugins.addAll(hostPlugins)

View File

@@ -174,7 +174,7 @@ public class GodotFragment extends Fragment implements IDownloaderClient, GodotH
private void performEngineInitialization() { private void performEngineInitialization() {
try { try {
if (!godot.initEngine(getCommandLine(), getHostPlugins(godot))) { if (!godot.initEngine(this, getCommandLine(), getHostPlugins(godot))) {
throw new IllegalStateException("Unable to initialize Godot engine"); throw new IllegalStateException("Unable to initialize Godot engine");
} }

View File

@@ -321,7 +321,7 @@ open class GodotService : Service() {
Log.d(TAG, "Performing engine initialization") Log.d(TAG, "Performing engine initialization")
try { try {
// Initialize the Godot instance // Initialize the Godot instance
if (!godot.initEngine(godotHost.commandLine, godotHost.getHostPlugins(godot))) { if (!godot.initEngine(godotHost, godotHost.commandLine, godotHost.getHostPlugins(godot))) {
throw IllegalStateException("Unable to initialize Godot engine layer") throw IllegalStateException("Unable to initialize Godot engine layer")
} }