From 32ace78a3e734371036943506a7c1cbe6501c16e Mon Sep 17 00:00:00 2001 From: Fredy Huya-Kouadio Date: Wed, 27 Apr 2022 20:56:24 -0700 Subject: [PATCH] Update Meta hand tracking version https://developer.oculus.com/blog/presence-platforms-hand-tracking-api-gets-an-upgrade/ --- platform/android/export/export_plugin.cpp | 29 +++++++++++-------- .../android/export/gradle_export_util.cpp | 2 ++ platform/android/java/app/AndroidManifest.xml | 7 +++++ 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index 3a88ed7a4355..b35518b32848 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -990,30 +990,35 @@ void EditorExportPlatformAndroid::_fix_manifest(const Ref &p encode_uint32(min_gles3 ? 0x00030000 : 0x00020000, &p_manifest.write[iofs + 16]); } - if (tname == "meta-data" && attrname == "name" && value == "xr_mode_metadata_name") { - // Update the meta-data 'android:name' attribute based on the selected XR mode. - if (xr_mode_index == XR_MODE_OVR) { + if (xr_mode_index == XR_MODE_OVR) { + if (tname == "meta-data" && attrname == "name" && value == "xr_mode_metadata_name") { + // Update the meta-data 'android:name' attribute based on the selected XR mode. string_table.write[attr_value] = "com.samsung.android.vr.application.mode"; } - } - if (tname == "meta-data" && attrname == "value" && value == "xr_mode_metadata_value") { - // Update the meta-data 'android:value' attribute based on the selected XR mode. - if (xr_mode_index == XR_MODE_OVR) { + if (tname == "meta-data" && attrname == "value" && value == "xr_mode_metadata_value") { + // Update the meta-data 'android:value' attribute based on the selected XR mode. string_table.write[attr_value] = "vr_only"; } } - if (tname == "meta-data" && attrname == "name" && value == "xr_hand_tracking_metadata_name") { - if ((xr_mode_index == XR_MODE_OVR || xr_mode_index == XR_MODE_OPENXR) && hand_tracking_index > XR_HAND_TRACKING_NONE) { + // Hand tracking related configurations + if ((xr_mode_index == XR_MODE_OVR || xr_mode_index == XR_MODE_OPENXR) && hand_tracking_index > XR_HAND_TRACKING_NONE) { + if (tname == "meta-data" && attrname == "name" && value == "xr_hand_tracking_metadata_name") { string_table.write[attr_value] = "com.oculus.handtracking.frequency"; } - } - if (tname == "meta-data" && attrname == "value" && value == "xr_hand_tracking_metadata_value") { - if ((xr_mode_index == XR_MODE_OVR || xr_mode_index == XR_MODE_OPENXR) && hand_tracking_index > XR_HAND_TRACKING_NONE) { + if (tname == "meta-data" && attrname == "value" && value == "xr_hand_tracking_metadata_value") { string_table.write[attr_value] = (hand_tracking_frequency_index == XR_HAND_TRACKING_FREQUENCY_LOW ? "LOW" : "HIGH"); } + + if (tname == "meta-data" && attrname == "name" && value == "xr_hand_tracking_version_name") { + string_table.write[attr_value] = "com.oculus.handtracking.version"; + } + + if (tname == "meta-data" && attrname == "name" && value == "xr_hand_tracking_version_value") { + string_table.write[attr_value] = "V2.0"; + } } iofs += 20; diff --git a/platform/android/export/gradle_export_util.cpp b/platform/android/export/gradle_export_util.cpp index 2ab1107aff41..f29f7a135a30 100644 --- a/platform/android/export/gradle_export_util.cpp +++ b/platform/android/export/gradle_export_util.cpp @@ -282,6 +282,7 @@ String _get_application_tag(const Ref &p_preset, bool p_has_ " tools:ignore=\"GoogleAppIndexingWarning\"\n" " android:icon=\"@mipmap/icon\" >\n\n" " \n" + " \n" " \n", bool_to_string(p_preset->get("user_data_backup/allow")), bool_to_string(p_preset->get("package/classify_as_game")), @@ -300,6 +301,7 @@ String _get_application_tag(const Ref &p_preset, bool p_has_ manifest_application_text += vformat( " \n", hand_tracking_frequency); + manifest_application_text += " \n"; } } else { manifest_application_text += " \n"; diff --git a/platform/android/java/app/AndroidManifest.xml b/platform/android/java/app/AndroidManifest.xml index 4b2bbd489acb..00138ae93d1f 100644 --- a/platform/android/java/app/AndroidManifest.xml +++ b/platform/android/java/app/AndroidManifest.xml @@ -50,6 +50,13 @@ android:name="xr_hand_tracking_metadata_name" android:value="xr_hand_tracking_metadata_value"/> + + + + +