Commit graph

1054 commits

Author SHA1 Message Date
Fredia Huya-Kouadio
3ac6b6a596 Disable threads used to check on plugins to load
The functionality is unavailable on Android (requires export capability) and unnecessarily consumes resources
2022-08-15 02:30:08 -07:00
Fredia Huya-Kouadio
30479543b0 Fix issue preventing the Android Editor from displaying the project content
The issue was causing by a bug within the logic for `FileAccessFilesystemJAndroid#eof_reached()` causing that value to remain false after the eof was reached.
This in turn caused an infinite loop in the file scanner preventing the project's content from showing up.
2022-08-15 02:21:34 -07:00
Fredia Huya-Kouadio
ef44e63f22 Fix GodotTTS native initialization 2022-08-14 22:01:31 -07:00
Fredia Huya-Kouadio
d2213f76a9 Refactor the export checking logic to improve separation of concerns 2022-08-14 08:47:09 -07:00
Rémi Verschelde
8cc8127bb1
Merge pull request #62886 from madmiraal/fix-59931-3.x 2022-08-08 15:54:39 +02:00
Rémi Verschelde
0bed7ea63f
Merge pull request #61316 from bruvzg/tts_3x
[3.x] Backport text-to-speech support.
2022-08-05 23:45:51 +02:00
Rémi Verschelde
26762a71b6
Merge pull request #58537 from winterpixelgames/feature/virtual-keyboard-types-3.x 2022-08-05 19:37:13 +02:00
Rémi Verschelde
751b16a285 File: Re-add support to skip CR (\r) in File::get_as_text
This was removed in #63481, and we confirmed that it's better like this,
but we add back the possibility to strip CR as an option, to optionally
restore the previous behavior.

For performance this is done directly in `String::parse_utf8`.

Also fixes Android `FileAccess::get_line()` as this one _should_ strip CR.

Supersedes #63717.

(cherry picked from commit 1418f97c70)
2022-08-01 00:40:55 +02:00
Rémi Verschelde
6c8d9b8401
Merge pull request #63480 from m4gr3d/fix_remaining_scoped_storage_regressions_3x
[3.x] Address remaining scoped storage regressions
2022-07-26 18:15:14 +02:00
Fredia Huya-Kouadio
fc2c202312 Address remaining scoped storage regressions
- Accelerate common path used to check the storage scope for a given path
- Update the logic for the `get_as_text()` method - previous logic loads the content of a text file one byte at a time
2022-07-26 07:42:49 -07:00
Rémi Verschelde
818f1eed31 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 14:53:37 +02:00
Marcel Admiraal
2f7de4c8ed Fix incorrect Android scancodes 2022-07-13 16:24:37 +01:00
Jan Haller
861e155543 Fix exit code of --help and --version, and test them in CI
Corrects prior regression which caused ERROR output and exit code of 1.

(cherry picked from commit d38d76d039)
2022-07-08 14:54:16 +02:00
Brian Semrau
ce24b48e50 Add support for multiple virtual keyboard types 2022-07-07 14:22:28 -04:00
Fredia Huya-Kouadio
27b63247fd Fix issue causing the Android Editor port to crash when saving a scene
In addition:
- Disable 'adb devices' query (not supported when running the editor on Android devices
- Add `move_to_trash` implementation for Android devices
2022-07-05 02:59:52 -07:00
Fredia Huya-Kouadio
0abc4ad129 Fix the directory copy bug issue
The issue was caused by a logic bug causing end of file to be reported for empty files.
2022-07-04 12:56:53 -07:00
Rémi Verschelde
f089f77c2a Android: Refactor Custom Build options in export preset
Instead of reusing the custom_template/ prefix which is actually only
used for the prebuilt APK workflow, we add a new custom_build/ prefix.

This is a slight compat breakage (users will have to redo their config)
but enables us to group the Min SDK and Target SDK options where they make
sense, and avoid reusing the previously hardcoded Target SDK 30 from
Godot 3.4.

Those two options are now strings instead of integers so that we can keep
them empty by default, and show their default value using a placeholder.
So some validation has been added to make sure they are proper ints.
The upper bound on Target SDK was also removed as it's a common use case
to use it to try to target newer released SDKs. But we warn the user that
this wasn't validated by us.

The export info dialog is now exclusive so that when it doesn't auto-close,
i.e. when it errors, you don't close it by mistake by clicking outside.

Fixes #62465.
2022-07-03 17:09:41 +02:00
bruvzg
6489fe890e
Backport text-to-speech support. 2022-07-01 11:04:50 +03:00
ne0fhyk
24e3b3b88d Add full support for Android scoped storage.
This was done by refactoring directory and file access handling for the Android platform so that any general filesystem access type go through the Android layer.
This allows us to validate whether the access is unrestricted, or whether it falls under scoped storage and thus act appropriately.
2022-06-26 16:53:02 -07:00
Rémi Verschelde
98b4a7c2da
Merge pull request #61692 from madmiraal/android-ndk-23-3.x
[3.x] Upgrade Android NDK to r23 LTS
2022-06-26 21:24:14 +02:00
Rémi Verschelde
af4e3cb931
Merge pull request #62290 from madmiraal/fix-61816-3.x
[3.x] Remove broken scroll gesture on Android
2022-06-26 08:38:08 +02:00
Marcel Admiraal
061c280873 Upgrade Android NDK to r23 LTS 2022-06-25 16:02:19 +01:00
Gustavo Maciel
a38119a746 Update android:targetSdkVersion from 30 to 31
Starting in August 2022, new apps will need to target API level 31 (Android 12) or higher and adjust for behavioral changes.

Read more here: https://developer.android.com/google/play/requirements/target-sdk

(cherry picked from commit ec6d5d6cba)
2022-06-23 15:59:15 +02:00
Marcel Admiraal
9091309ab7 Remove broken scroll gesture on Android 2022-06-21 17:04:42 +01:00
Marcel Admiraal
50bf882fcc Ensure joystick has been added or not already removed when processing input
(cherry picked from commit 806e7d18d1)
2022-06-16 20:47:49 +02:00
Fredia Huya-Kouadio
5946b4bdc6 Migrate the Godot Editor java source file to Kotlin.
(cherry picked from commit 6b9a81900e)
2022-06-10 10:25:37 +02:00
bruvzg
f5fa1ca944
Add readable export errors. Add RTL image vertical alignment support. 2022-06-08 17:56:28 +03:00
Fredia Huya-Kouadio
05fc140ee6 Misc editor tweaks and polishes:
- Using a bucketized approach to select the editor scale in order to avoid too high values
- Add default app dimensions: used on Android devices with free floating app windows to set the default app frame
- Add ability to launch the Game window in an adjacent frame when in multi window mode

(cherry picked from commit 6f7ec7f723)
2022-06-08 10:11:28 +02:00
Marcel Admiraal
9f0dba8b65 Ensure Android Java and Kotlin compile to the same version 2022-06-01 16:24:12 +01:00
Marcel Admiraal
caaaef68b4 Only use Android fullscreen theme for splash screen
(cherry picked from commit d0cb299f04)
2022-06-01 00:29:46 +02:00
Marcel Admiraal
7a782edeaa Cleanup Android C++ code 2022-05-31 17:11:44 +01:00
Rémi Verschelde
2b2a1b4c71 Android: Change export plugin poll to 300 ms
This removes the reliance on the not-so-fully-implemented Power API,
which throws an error in the HTML5 editor.

This was already changed to 200 ms in the master branch, and here I
picked 300 ms to be consistent with the iOS export plugin. All these
thread sleeps need to be re-assessed together to be made more
consistent (and possibly configurable - and most importantly battery
preserving by default).
2022-05-25 12:16:24 +02:00
Marcel Admiraal
b66b153b8c Remove duplicate Android sensor listener registrations
(cherry picked from commit cf0f967e6d)
2022-05-24 00:06:20 +02:00
Fredia Huya-Kouadio
b162e7ac39 Fix the logic to restart the Godot application 2022-05-23 13:15:25 -07:00
Haoyu Qiu
b657d0c76c Add dedicated macros for property name extraction
* Replace case-by-case extraction with PNAME & GNAME
* Fix group handling when group hint begins with property name
* Exclude properties that are PROPERTY_USAGE_NOEDITOR
2022-05-19 11:31:35 +08:00
Hugo Locurcio
0df7aa1e2c Increase compiler optimization when using target=release on iOS/Android
(cherry picked from commit 78b4ec2d4d)
2022-05-16 17:52:07 +02:00
Marcel Admiraal
fe60de2c6a Check for null when retrieving clip data item text on Android
(cherry picked from commit 5924e2b90e)
2022-05-05 13:44:00 +02:00
Rémi Verschelde
917a749964
Merge pull request #60639 from m4gr3d/support_hand_tracking_v2_3x 2022-05-02 09:51:35 +02:00
Rémi Verschelde
d8e702b010
Merge pull request #60552 from madmiraal/implement-3466-3.x
[3.x] Add a method for obtaining display cutouts on Android
2022-05-02 07:58:05 +02:00
Fredy Huya-Kouadio
32ace78a3e Update Meta hand tracking version
https://developer.oculus.com/blog/presence-platforms-hand-tracking-api-gets-an-upgrade/
2022-04-27 21:14:49 -07:00
Marcel Admiraal
9a4d4ec2d5 Remove superfluous null check
(cherry picked from commit 988432b8bb)
2022-04-27 12:25:58 +02:00
Marcel Admiraal
76b5c31433 Replace index iterators with for each loops.
(cherry picked from commit 334ebd7eb7)
2022-04-27 12:25:47 +02:00
Marcel Admiraal
23b649b673 Remove superfluous check for minimum Android SDK.
(cherry picked from commit 2f225bf2c5)
2022-04-27 12:25:34 +02:00
Marcel Admiraal
ec2270b88f Add a method for obtaining display cutouts on Android 2022-04-26 13:52:33 +02:00
Rémi Verschelde
ba21c76b46
Merge pull request #60442 from madmiraal/remove-superfluous-inputmanager-3.x 2022-04-25 15:42:06 +02:00
Fredy Huya-Kouadio
7a88d5bf28 Fix the issue causing the screen to be black after resuming when in low processor mode.
This is done by forcing a redraw and buffers swap when resuming the app.
2022-04-25 00:20:44 -07:00
Marcel Admiraal
b5402818d7 Remove superfluous Android InputManager interface and implementation 2022-04-22 19:10:01 +02:00
Fredia Huya-Kouadio
a3b445d7e8 Remove duplicate resizable settings
(cherry picked from commit f1a7caf9bb)
2022-04-13 11:43:49 +02:00
Fredia Huya-Kouadio
4ff726b933 Update resize settings:
- Unlock resizing for the Godot Editor
- Add an option to specify whether a game is resizeable for the Godot template

(cherry picked from commit 3f299e9255)
2022-04-13 11:43:49 +02:00
Fredia Huya-Kouadio
3ba0508f79 Update the editor display scale based on the device's scaled density 2022-04-04 04:18:56 -07:00
Fredia Huya-Kouadio
8ca32d1727 Fix flickering issues with low processor mode on Android 2022-03-29 12:17:25 -07:00
Fredy Huya-Kouadio
6f2442b17a Cleanup the gradle build configuration
These changes resolve the inconsistency between gradle and scons targets by configuring the gradle buildtypes to match the scons targets.
2022-03-28 08:12:55 -07:00
Fredy Huya-Kouadio
cb0b2aefc3 Android port of the Godot Editor
These set of changes focus primarily on getting the core logic and overall Godot Editor UI and functionality up and running natively on Android devices.
UI tweaks / cleanup / polish, as well configuration for Android specific functionality / restrictions will be addressed in follow-up PRs iteratively based on feedback.

Co-authored-by: thebestnom <shoval.arad@gmail.com>
2022-03-28 07:54:10 -07:00
Fredia Huya-Kouadio
b8178a7f0a Setup logic to publish the Godot Android library to MavenCentral
(cherry picked from commit a2bf47de2b)
2022-03-17 14:45:19 +01:00
Hugo Locurcio
cec7c908ca
Add get_screen_refresh_rate() to OS
This method can be used to get the refresh rate of a given screen.
It is supported on Windows, macOS, Linux, Android and iOS (but not
HTML5).
2022-03-10 22:10:48 +01:00
Rémi Verschelde
85b4848ca8
Merge pull request #54188 from Rubonnek/increase_var_arg_max_3x 2022-03-08 13:10:48 +01:00
Wilson E. Alvarez
424dbf70af
Increase VARIANT_ARG_MAX to 8 2022-03-07 10:03:49 -05:00
Haoyu Qiu
1348f868c9 Make string inside TTR() single-line 2022-02-28 20:09:34 +08:00
Fredia Huya-Kouadio
5deeb38a70 Fix XR Android manifest metadata
- Adds the parameters for supported Meta devices, which is required to access some device specific capabilities
- Remove the 'com.samsung.android.vr.application.mode' metadata when we're not using the VrApi plugin
2022-01-26 08:58:47 -08:00
Haoyu Qiu
76297e744d Add OS.has_clipboard() to check clipboard content 2022-01-19 20:19:06 +08:00
Rémi Verschelde
c938104a88
Merge pull request #56630 from Pineapple/replace-find-last 2022-01-18 16:36:52 +01:00
Marcel Admiraal
949ea2b326 Simplify InputDefault::joy_axis code by using float instead of struct JoyAxis 2022-01-14 15:36:35 +00:00
Rémi Verschelde
a627cdafc5
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-13 15:54:13 +01:00
Rémi Verschelde
123fcfaf83
Merge pull request #56676 from winterpixelgames/3.x-android-keystore-paths 2022-01-12 16:46:00 +01:00
Bastiaan Olij
4df4d72caf
Wrong call for create_offscreen_gl
We need to use `CallVoidMethod` instead of `CallBooleanMethod` to call `create_offscreen_gl`.
2022-01-12 11:01:24 +11:00
Jason Knight
39070291ef Android export plugin passes absolute file paths to gradle for keystores. 2022-01-10 15:16:00 -06:00
Bartłomiej T. Listwon
22750b1c03 Replace String::find_last with rfind where possible (backward compatible with old API) 2022-01-08 22:40:44 +01:00
ne0fhyk
0448d4e26e
Fix Android Studio builds.
(cherry picked from commit 1345e66935)
2022-01-06 00:24:42 +01:00
bruvzg
d2558bdc8c
Fix decoding UTF-8 filenames on unzipping.
(cherry picked from commit d2573c1636)
2022-01-06 00:21:37 +01:00
Marcel Admiraal
b5d325e6ff Only rotate Android sensor values for sensors that need them rotated 2021-12-15 18:15:25 +00:00
Aaron Franke
7bf7bd70ac
[3.x] Misc build system fixes 2021-12-10 12:15:16 -06:00
Rémi Verschelde
45aac0b9e9
Merge pull request #55768 from m4gr3d/config_hand_tracking_frequency_3x 2021-12-09 23:05:06 +01:00
Fredia Huya-Kouadio
4f6ce8a7ba
Enable configuration of the android:excludeFromRecents activity attribute.
(cherry picked from commit cfa81ff32a)
2021-12-09 23:03:19 +01:00
ne0fhyk
9d22ad3c9b Add support for configuring the xr hand tracking frequency mode 2021-12-09 12:26:06 -08:00
Fredia Huya-Kouadio
65cfa28cce Add configs to specify the min and target sdk versions. 2021-12-08 09:06:09 -08:00
Rémi Verschelde
451bba967a
Merge pull request #55158 from m4gr3d/add_oculus_openxr_config_3x 2021-11-22 10:29:49 +01:00
Marcel Admiraal
05744ee0e2 Fix Android get_screen_orientation() not returning valid values 2021-11-21 12:14:29 +00:00
Fredia Huya-Kouadio
9c50bcabed Add support for OpenXR export configurations. 2021-11-20 06:59:36 -08:00
Marcel Admiraal
4d3690eba5 Remove unimplemented methods 2021-11-18 12:47:36 +00:00
Pedro J. Estébanez
4f8bc77a4c Drop broken Android 32-bit framebuffer setting 2021-11-15 10:44:41 +01:00
Pedro J. Estébanez
abdf931832 Add off-screen GL context 2021-11-09 12:19:12 +01:00
Pedro J. Estébanez
25f01cb09d Implement get_cache_path() for iOS, and improve it for Android and Windows 2021-11-08 22:33:54 +01:00
Fredia Huya-Kouadio
724ef83971 Add default minSdkVersion and targetSdkVersion in the AndroidManifest.xml file 2021-11-03 21:49:22 -07:00
Rémi Verschelde
87c80f529f
clang-format: Enable BreakBeforeTernaryOperators
clang-format keeps breaking the way it handles break *after* ternary operators,
so I give up and go with the only style they seem to actually test.
2021-10-28 14:50:33 +02:00
Rémi Verschelde
1b65550ec7
clang-format: Various fixes to comments alignment from clang-format 13
All reviewed manually and occasionally rewritten to avoid bad auto formatting.
2021-10-28 14:50:32 +02:00
Rémi Verschelde
42d385b312
clang-format: Disable alignment of operands, too unreliable
Sets `AlignOperands` to `DontAlign`.

`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
2021-10-28 13:23:38 +02:00
Rémi Verschelde
c7f4e1d5dd
Android: Properly validate godot_project_name_string for Android special chars
Fixes #52659.

(cherry picked from commit 9204a3a50e)
2021-10-26 18:23:47 +02:00
Marcel Admiraal
4febf69f2a
Fix Gradle builds not excluding excluded tasks
(cherry picked from commit f80cb4dffa)
2021-10-24 01:43:44 +02:00
Rémi Verschelde
9657559b66
SCons: Set DEBUG_ENABLED and DEV_ENABLED in SConstruct
They're the same for all platforms so they don't need to be repeated in all
platform definitions.

(cherry picked from commit cd21cc683a)
2021-10-15 12:54:16 +02:00
Marcel Admiraal
fd942cd465
Upgrade Android Gradle to version 7.2
(cherry picked from commit 95b1275197)
2021-10-15 12:51:43 +02:00
ne0fhyk
754db65a1f
Pass the correct export_format argument to locate the assets directory when exporting.
(cherry picked from commit 431ccdb057)
2021-10-11 18:04:16 +02:00
Rémi Verschelde
e292d79fb3
SCons: Add DEV_ENABLED defines for target=debug builds
This will allow adding developer checks which will be fully compiled out in
user builds, unlike `DEBUG_ENABLED` which is included in debug tempates and
the editor builds.

This define is not used yet, but we'll soon add code that uses it, and change
some existing `DEBUG_ENABLED` checks to be performed only in dev builds.

Related to https://github.com/godotengine/godot-proposals/issues/3371.
2021-10-04 11:25:02 +02:00
Hugo Locurcio
8a6bc045ea
Add logo attribution for Android, HTML5 and Linux platform icons
- Tweak the Android platform logo to remove the Android wordmark,
  as it can't be used without explicit permission.

(cherry picked from commit 1513aa9b26)
2021-09-21 17:14:59 +02:00
Marcel Admiraal
cce7e6c9d6
Use current androidx Fragment library instead of legacy libraries
(cherry picked from commit 23311a6ed3)
2021-09-19 11:37:19 +02:00
PouleyKetchoupp
1454d6c670
Add support for adding plugin views behind the main view on Android
Doesn't change the default behavior, but allows plugins to add their
view behind the main view, which gives more control over what happens
with inputs and can be useful along with transparent rendering.

(cherry picked from commit 0b681d5834)
2021-09-19 11:30:21 +02:00
PouleyKetchoupp
52fdb4ece9 Window transparency support on Android
Implements per-pixel transparency feature on Android.
Allows plugins to do specific rendering and render godot UI on top
(useful for camera support with drawing on top).
2021-09-15 10:41:08 -07:00
ne0fhyk
35a98d305b Add support for Play Asset Delivery.
This only adds support for a subset of Play Asset Delivery: this causes a single install-time asset pack to always be present, but doesn't add support for dynamically downloaded asset packs.
2021-09-15 06:02:53 -07:00
Rémi Verschelde
815c16ae17
Merge pull request #52515 from m4gr3d/android_export_refactoring
[3.x] Refactor Android platform export structure
2021-09-15 14:03:53 +02:00
Marcus Brummer
128208d1d0
Check if vibration duration is > 0 on Android
(cherry picked from commit 47f338fc12)
2021-09-14 13:41:25 +02:00
ne0fhyk
0cfbe354d7 Refactor Android platform export structure. 2021-09-09 10:48:29 -07:00