Skip to content

Commit 74d80f4

Browse files
committed
Disable Android devices mirroring for the Android editor
1 parent 7ed0b61 commit 74d80f4

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

platform/android/export/export_plugin.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2264,6 +2264,7 @@ bool EditorExportPlatformAndroid::should_update_export_options() {
22642264
return false;
22652265
}
22662266

2267+
#ifndef ANDROID_ENABLED
22672268
bool EditorExportPlatformAndroid::poll_export() {
22682269
bool dc = devices_changed.is_set();
22692270
if (dc) {
@@ -2589,6 +2590,7 @@ Error EditorExportPlatformAndroid::run(const Ref<EditorExportPreset> &p_preset,
25892590
CLEANUP_AND_RETURN(OK);
25902591
#undef CLEANUP_AND_RETURN
25912592
}
2593+
#endif // ANDROID_ENABLED
25922594

25932595
Ref<Texture2D> EditorExportPlatformAndroid::get_run_icon() const {
25942596
return run_icon;
@@ -4369,18 +4371,18 @@ void EditorExportPlatformAndroid::initialize() {
43694371
ImageLoaderSVG::create_image_from_string(img, _android_run_icon_svg, EDSCALE, upsample, false);
43704372
run_icon = ImageTexture::create_from_image(img);
43714373

4372-
devices_changed.set();
43734374
#ifndef DISABLE_DEPRECATED
43744375
android_plugins_changed.set();
43754376
#endif // DISABLE_DEPRECATED
43764377
#ifndef ANDROID_ENABLED
4378+
devices_changed.set();
43774379
_create_editor_debug_keystore_if_needed();
43784380
_update_preset_status();
43794381
check_for_changes_thread.start(_check_for_changes_poll_thread, this);
4380-
#else
4381-
android_editor_gradle_runner = memnew(AndroidEditorGradleRunner);
4382-
#endif
43834382
use_scrcpy = EditorSettings::get_singleton()->get_project_metadata("android", "use_scrcpy", false);
4383+
#else // ANDROID_ENABLED
4384+
android_editor_gradle_runner = memnew(AndroidEditorGradleRunner);
4385+
#endif // ANDROID_ENABLED
43844386
}
43854387
}
43864388

platform/android/export/export_plugin.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,20 +97,21 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
9797
uint64_t last_gradle_build_time = 0;
9898
String last_gradle_build_dir;
9999

100+
#ifndef ANDROID_ENABLED
100101
bool use_scrcpy = false;
101102
Vector<Device> devices;
102103
SafeFlag devices_changed;
103104
Mutex device_lock;
104-
#ifndef ANDROID_ENABLED
105+
105106
Thread check_for_changes_thread;
106107
SafeFlag quit_request;
107108
SafeFlag has_runnable_preset;
108109

109110
static void _check_for_changes_poll_thread(void *ud);
110111
void _update_preset_status();
111-
#else
112+
#else // ANDROID_ENABLED
112113
AndroidEditorGradleRunner *android_editor_gradle_runner = nullptr;
113-
#endif
114+
#endif // ANDROID_ENABLED
114115

115116
String get_project_name(const Ref<EditorExportPreset> &p_preset, const String &p_name) const;
116117

@@ -223,6 +224,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
223224

224225
virtual bool should_update_export_options() override;
225226

227+
#ifndef ANDROID_ENABLED
226228
virtual bool poll_export() override;
227229

228230
virtual int get_options_count() const override;
@@ -240,6 +242,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
240242
virtual String get_device_architecture(int p_index) const override;
241243

242244
virtual Error run(const Ref<EditorExportPreset> &p_preset, int p_device, BitField<EditorExportPlatform::DebugFlags> p_debug_flags) override;
245+
#endif // ANDROID_ENABLED
243246

244247
virtual Ref<Texture2D> get_run_icon() const override;
245248

0 commit comments

Comments
 (0)