Commit Graph

344 Commits

Author SHA1 Message Date
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 a627cdafc5
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-13 15:54:13 +01:00
ne0fhyk 0448d4e26e
Fix Android Studio builds.
(cherry picked from commit 1345e66935)
2022-01-06 00:24:42 +01:00
Marcel Admiraal b5d325e6ff Only rotate Android sensor values for sensors that need them rotated 2021-12-15 18:15:25 +00: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
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
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
Marcel Admiraal 4febf69f2a
Fix Gradle builds not excluding excluded tasks
(cherry picked from commit f80cb4dffa)
2021-10-24 01:43:44 +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
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
Marcus Brummer 128208d1d0
Check if vibration duration is > 0 on Android
(cherry picked from commit 47f338fc12)
2021-09-14 13:41:25 +02:00
Fredia Huya-Kouadio 5b8d7752b5 Update Oculus vr configs and add support for accessing Oculus OpenXR runtime 2021-08-27 11:16:20 -07:00
Fredia Huya-Kouadio 3baf5563e8
Delegate handling and implementation of the restart functionality to the Godot host.
(cherry picked from commit f4222733ca)
2021-08-18 23:21:13 +02:00
ne0fhyk e2bcdad43b Fix possible null pointer exception. 2021-08-16 23:14:10 -07:00
ne0fhyk c88d1608ab Add partial support for Android scoped storage.
This is done by providing API access to app specific directories which don't have any limitations and allows us to bump the target sdk version to 30.
In addition, we're also bumping the min sdk version to 19 as version 18 is no longer supported by Google Play Services and only account of 0.3% of Android devices.
2021-08-13 11:04:17 -07:00
Rémi Verschelde f976cec536
Merge pull request #51584 from m4gr3d/investigate_godot_resume_stalls_3_x
[3.x] Resolve issue where the Godot app remains stuck when resuming.
2021-08-13 08:44:33 +02:00
Fredia Huya-Kouadio 336c630f51 Add support for prompting the user to retain app data on uninstall.
Supported on Android 10 and higher.
2021-08-12 22:06:13 -07:00
Fredia Huya-Kouadio 874aa1708f Resolve issue where the Godot app remains stuck when resuming.
This was caused by the fact that a new instance of Godot was created at resume while a previous instance already existed.
The previous instance would then go through its cleanup lifecycle, and would thus attempt to close the entire app, leading to the system to restart the app, thus starting the cycle anew.
The fix involves reusing the previous instance of Godot if one is available instead of creating a new one, as well as giving control to the host activity for how the process should be terminated.
2021-08-12 20:58:00 -07:00
Pedro J. Estébanez 45c2a7159e Switch to input buffering on Android
Key, touch and joystick events will be passed directly from the UI thread to Godot, so they can benefit from agile input flushing.

As another consequence of this new way of passing events, less Java object are created at runtime (`Runnable`), which is good since the garbage collector needs to run less.

`AndroidInputHandler` is introduced to have a smaller cross-thread surface. `main_loop_request_go_back()` is removed in favor just inline calling `notification()` on the `MainLoop` at the most caller's convenience.

Lastly, `get_mouse_position()` and `get_mouse_button_state()` now just call through `InputDefault` to avoid the need of sync of mouse data tracked on the UI thread.
2021-08-08 13:41:27 +02:00
ne0fhyk d1fdb60ee2 Disable resource optimizations for release builds as it breaks the legacy build system. 2021-07-20 16:36:00 -07:00
Rémi Verschelde 46c68c0fb9
Android: Fix truncated `application` attributes after #50028 cherry-pick
The `android:icon` attribute is expected to be the last one in the application
definition, as documented by the comment. cd64bcd missed that and caused some
arguments to be truncated.

Fixes #50224.
2021-07-07 00:49:07 +02:00
Rémi Verschelde 7c8cc037ad
Merge pull request #50221 from madmiraal/fix-50125-3.x
[3.x] Queue the calls to GodotLib.key when Android virtual done is pressed
2021-07-06 23:46:36 +02:00
Marcel Admiraal 2bd3cc0e16 Queue the calls to GodotLib.key when Android virtual done is pressed 2021-07-06 17:54:14 +01:00
Marcel Admiraal d40f73e3a4 Remove Android onKeyMultiple override 2021-07-06 17:37:53 +01:00
Rémi Verschelde 009aa63a57
Merge pull request #50108 from madmiraal/android-use-lambdas-3.x
[3.x] Replace single method anonymous classes with lambdas in Godot Java code
2021-07-06 18:10:45 +02:00
Marcel Admiraal 4b03e05573
Use static inner classes in Godot Java code
(cherry picked from commit 23e152040b)
2021-07-06 11:20:42 +02:00
Marcel Admiraal ab1162e918
Remove redundant explicit types in Godot Java code
(cherry picked from commit 3f95bbed73)
2021-07-06 11:10:46 +02:00
Marcel Admiraal 6a07253bb6
Use StringBuilder instead StringBuffer in Godot Java code
(cherry picked from commit 61ee51d2bf)
2021-07-06 11:10:46 +02:00
Marcel Admiraal c1abbfb605
Fix raw use of parameterized Class
(cherry picked from commit d237f7d33d)
2021-07-06 11:10:46 +02:00
Marcel Admiraal 01ecec451c
Use Java array declarations not C-style declarations in Android Java code
(cherry picked from commit 721b3d56c5)
2021-07-06 11:10:46 +02:00
Marcel Admiraal 2b78d618f4
Remove unnecessary semicolons from Android Java code
(cherry picked from commit 360447001d)
2021-07-06 11:10:45 +02:00
Rémi Verschelde cd64bcdae5
Android: Add `isGame` application attribute, default to true
It can be turned off in the export preset with `package/classify_as_game`.

Upstream definition: https://developer.android.com/guide/topics/manifest/application-element#isGame

> `android:isGame`
>
> Whether or not the application is a game. The system may group together
> applications classifed as games or display them separately from other
> applications.

Also fixes replacing `android:allowBackup` in custom builds.

(cherry picked from commit 40a594c6ea)
2021-07-06 11:10:45 +02:00
Marcel Admiraal 76c1a0e91d
Fix unchecked call to put() warning in GodotInputHandler.java
(cherry picked from commit 8270e101a7)
2021-07-06 11:10:44 +02:00
Marcel Admiraal 4108dd0145 Replace single method anonymous classes with lambdas in Godot Java code 2021-07-03 05:13:08 +01:00
Marcel Admiraal 1ed89353b0 Remove unused imports from Android Java code 2021-07-02 14:41:57 +01:00
Marcel Admiraal 96e56af9b9 Remove redundant interface modifiers from Android Java code 2021-07-02 09:41:09 +01:00