From 74d80f485c053209b9978eb761a36a758dc22f19 Mon Sep 17 00:00:00 2001 From: Fredia Huya-Kouadio Date: Sun, 30 Nov 2025 21:57:51 -0800 Subject: [PATCH] Disable Android devices mirroring for the Android editor --- platform/android/export/export_plugin.cpp | 10 ++++++---- platform/android/export/export_plugin.h | 9 ++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index 8c4c94885fd..6c956ccc22f 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -2264,6 +2264,7 @@ bool EditorExportPlatformAndroid::should_update_export_options() { return false; } +#ifndef ANDROID_ENABLED bool EditorExportPlatformAndroid::poll_export() { bool dc = devices_changed.is_set(); if (dc) { @@ -2589,6 +2590,7 @@ Error EditorExportPlatformAndroid::run(const Ref &p_preset, CLEANUP_AND_RETURN(OK); #undef CLEANUP_AND_RETURN } +#endif // ANDROID_ENABLED Ref EditorExportPlatformAndroid::get_run_icon() const { return run_icon; @@ -4369,18 +4371,18 @@ void EditorExportPlatformAndroid::initialize() { ImageLoaderSVG::create_image_from_string(img, _android_run_icon_svg, EDSCALE, upsample, false); run_icon = ImageTexture::create_from_image(img); - devices_changed.set(); #ifndef DISABLE_DEPRECATED android_plugins_changed.set(); #endif // DISABLE_DEPRECATED #ifndef ANDROID_ENABLED + devices_changed.set(); _create_editor_debug_keystore_if_needed(); _update_preset_status(); check_for_changes_thread.start(_check_for_changes_poll_thread, this); -#else - android_editor_gradle_runner = memnew(AndroidEditorGradleRunner); -#endif use_scrcpy = EditorSettings::get_singleton()->get_project_metadata("android", "use_scrcpy", false); +#else // ANDROID_ENABLED + android_editor_gradle_runner = memnew(AndroidEditorGradleRunner); +#endif // ANDROID_ENABLED } } diff --git a/platform/android/export/export_plugin.h b/platform/android/export/export_plugin.h index c27b7dd0ed3..527b9e9023d 100644 --- a/platform/android/export/export_plugin.h +++ b/platform/android/export/export_plugin.h @@ -97,20 +97,21 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { uint64_t last_gradle_build_time = 0; String last_gradle_build_dir; +#ifndef ANDROID_ENABLED bool use_scrcpy = false; Vector devices; SafeFlag devices_changed; Mutex device_lock; -#ifndef ANDROID_ENABLED + Thread check_for_changes_thread; SafeFlag quit_request; SafeFlag has_runnable_preset; static void _check_for_changes_poll_thread(void *ud); void _update_preset_status(); -#else +#else // ANDROID_ENABLED AndroidEditorGradleRunner *android_editor_gradle_runner = nullptr; -#endif +#endif // ANDROID_ENABLED String get_project_name(const Ref &p_preset, const String &p_name) const; @@ -223,6 +224,7 @@ public: virtual bool should_update_export_options() override; +#ifndef ANDROID_ENABLED virtual bool poll_export() override; virtual int get_options_count() const override; @@ -240,6 +242,7 @@ public: virtual String get_device_architecture(int p_index) const override; virtual Error run(const Ref &p_preset, int p_device, BitField p_debug_flags) override; +#endif // ANDROID_ENABLED virtual Ref get_run_icon() const override;