diff options
Diffstat (limited to 'platform/android')
-rw-r--r-- | platform/android/export/export.cpp | 16 | ||||
-rw-r--r-- | platform/android/export/gradle_export_util.h | 15 | ||||
-rw-r--r-- | platform/android/java/lib/src/org/godotengine/godot/FullScreenGodotApp.java | 24 |
3 files changed, 18 insertions, 37 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 326e513261..5f9f420b59 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -2262,8 +2262,9 @@ public: CharString command_line_argument = command_line_strings[i].utf8(); int base = r_command_line_flags.size(); int length = command_line_argument.length(); - if (length == 0) + if (length == 0) { continue; + } r_command_line_flags.resize(base + 4 + length); encode_uint32(length, &r_command_line_flags.write[base]); copymem(&r_command_line_flags.write[base + 4], command_line_argument.ptr(), length); @@ -2484,7 +2485,7 @@ public: _clear_assets_directory(); if (!apk_expansion) { print_verbose("Exporting project files.."); - err = export_project_files(p_preset, rename_and_store_file_in_gradle_project, NULL, ignore_so_file); + err = export_project_files(p_preset, rename_and_store_file_in_gradle_project, nullptr, ignore_so_file); if (err != OK) { EditorNode::add_io_error("Could not export project files to gradle project\n"); return err; @@ -2615,10 +2616,11 @@ public: } // This is the start of the Legacy build system print_verbose("Starting legacy build system.."); - if (p_debug) + if (p_debug) { src_apk = p_preset->get("custom_template/debug"); - else + } else { src_apk = p_preset->get("custom_template/release"); + } src_apk = src_apk.strip_edges(); if (src_apk == "") { if (p_debug) { @@ -2813,11 +2815,11 @@ public: zipOpenNewFileInZip(unaligned_apk, "assets/_cl_", &zipfi, - NULL, + nullptr, 0, - NULL, + nullptr, 0, - NULL, + nullptr, 0, // No compress (little size gain and potentially slower startup) Z_DEFAULT_COMPRESSION); zipWriteInFileInZip(unaligned_apk, command_line_flags.ptr(), command_line_flags.size()); diff --git a/platform/android/export/gradle_export_util.h b/platform/android/export/gradle_export_util.h index 097a2391ee..40b8e90c6f 100644 --- a/platform/android/export/gradle_export_util.h +++ b/platform/android/export/gradle_export_util.h @@ -47,20 +47,21 @@ const String godot_project_name_xml_string = R"(<?xml version="1.0" encoding="ut DisplayServer::ScreenOrientation _get_screen_orientation() { String orientation_settings = ProjectSettings::get_singleton()->get("display/window/handheld/orientation"); DisplayServer::ScreenOrientation screen_orientation; - if (orientation_settings == "portrait") + if (orientation_settings == "portrait") { screen_orientation = DisplayServer::SCREEN_PORTRAIT; - else if (orientation_settings == "reverse_landscape") + } else if (orientation_settings == "reverse_landscape") { screen_orientation = DisplayServer::SCREEN_REVERSE_LANDSCAPE; - else if (orientation_settings == "reverse_portrait") + } else if (orientation_settings == "reverse_portrait") { screen_orientation = DisplayServer::SCREEN_REVERSE_PORTRAIT; - else if (orientation_settings == "sensor_landscape") + } else if (orientation_settings == "sensor_landscape") { screen_orientation = DisplayServer::SCREEN_SENSOR_LANDSCAPE; - else if (orientation_settings == "sensor_portrait") + } else if (orientation_settings == "sensor_portrait") { screen_orientation = DisplayServer::SCREEN_SENSOR_PORTRAIT; - else if (orientation_settings == "sensor") + } else if (orientation_settings == "sensor") { screen_orientation = DisplayServer::SCREEN_SENSOR; - else + } else { screen_orientation = DisplayServer::SCREEN_LANDSCAPE; + } return screen_orientation; } diff --git a/platform/android/java/lib/src/org/godotengine/godot/FullScreenGodotApp.java b/platform/android/java/lib/src/org/godotengine/godot/FullScreenGodotApp.java index ec2ace4821..4eac2d08d1 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/FullScreenGodotApp.java +++ b/platform/android/java/lib/src/org/godotengine/godot/FullScreenGodotApp.java @@ -34,7 +34,6 @@ import android.content.Intent; import android.os.Bundle; import android.view.KeyEvent; -import androidx.annotation.CallSuper; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.FragmentActivity; @@ -63,30 +62,9 @@ public abstract class FullScreenGodotApp extends FragmentActivity implements God @Override public void onNewIntent(Intent intent) { + super.onNewIntent(intent); if (godotFragment != null) { godotFragment.onNewIntent(intent); - } else { - super.onNewIntent(intent); - } - } - - @CallSuper - @Override - public void onActivityResult(int requestCode, int resultCode, Intent data) { - if (godotFragment != null) { - godotFragment.onActivityResult(requestCode, resultCode, data); - } else { - super.onActivityResult(requestCode, resultCode, data); - } - } - - @CallSuper - @Override - public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { - if (godotFragment != null) { - godotFragment.onRequestPermissionsResult(requestCode, permissions, grantResults); - } else { - super.onRequestPermissionsResult(requestCode, permissions, grantResults); } } |