Skip to content

Commit eb2625c

Browse files
committed
Merge pull request #108243 from m4gr3d/fix_android_plugin_init
Android: Fix Android plugins regression
2 parents 8f81661 + bbf22a3 commit eb2625c

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

platform/android/java/lib/src/org/godotengine/godot/Godot.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class Godot private constructor(val context: Context) {
204204
* @throws IllegalArgumentException exception if the specified expansion pack (if any)
205205
* is invalid.
206206
*/
207-
fun initEngine(commandLineParams: List<String>, hostPlugins: Set<GodotPlugin>): Boolean {
207+
fun initEngine(host: GodotHost?, commandLineParams: List<String>, hostPlugins: Set<GodotPlugin> = Collections.emptySet()): Boolean {
208208
if (isNativeInitialized()) {
209209
Log.d(TAG, "Engine already initialized")
210210
return true
@@ -216,6 +216,8 @@ class Godot private constructor(val context: Context) {
216216

217217
beginBenchmarkMeasure("Startup", "Godot::initEngine")
218218
try {
219+
this.primaryHost = host
220+
219221
Log.v(TAG, "Initializing Godot plugin registry")
220222
val runtimePlugins = mutableSetOf<GodotPlugin>(AndroidRuntimePlugin(this))
221223
runtimePlugins.addAll(hostPlugins)

platform/android/java/lib/src/org/godotengine/godot/GodotFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public void onCreate(Bundle icicle) {
174174

175175
private void performEngineInitialization() {
176176
try {
177-
if (!godot.initEngine(getCommandLine(), getHostPlugins(godot))) {
177+
if (!godot.initEngine(this, getCommandLine(), getHostPlugins(godot))) {
178178
throw new IllegalStateException("Unable to initialize Godot engine");
179179
}
180180

platform/android/java/lib/src/org/godotengine/godot/service/GodotService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ open class GodotService : Service() {
321321
Log.d(TAG, "Performing engine initialization")
322322
try {
323323
// Initialize the Godot instance
324-
if (!godot.initEngine(godotHost.commandLine, godotHost.getHostPlugins(godot))) {
324+
if (!godot.initEngine(godotHost, godotHost.commandLine, godotHost.getHostPlugins(godot))) {
325325
throw IllegalStateException("Unable to initialize Godot engine layer")
326326
}
327327

0 commit comments

Comments
 (0)