Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] Update Meta hand tracking version #60639

Merged
merged 1 commit into from
May 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions platform/android/export/export_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -990,30 +990,35 @@ void EditorExportPlatformAndroid::_fix_manifest(const Ref<EditorExportPreset> &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;
Expand Down
2 changes: 2 additions & 0 deletions platform/android/export/gradle_export_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ String _get_application_tag(const Ref<EditorExportPreset> &p_preset, bool p_has_
" tools:ignore=\"GoogleAppIndexingWarning\"\n"
" android:icon=\"@mipmap/icon\" >\n\n"
" <meta-data tools:node=\"remove\" android:name=\"xr_mode_metadata_name\" />\n"
" <meta-data tools:node=\"remove\" android:name=\"xr_hand_tracking_version_name\" />\n"
" <meta-data tools:node=\"remove\" android:name=\"xr_hand_tracking_metadata_name\" />\n",
bool_to_string(p_preset->get("user_data_backup/allow")),
bool_to_string(p_preset->get("package/classify_as_game")),
Expand All @@ -300,6 +301,7 @@ String _get_application_tag(const Ref<EditorExportPreset> &p_preset, bool p_has_
manifest_application_text += vformat(
" <meta-data tools:node=\"replace\" android:name=\"com.oculus.handtracking.frequency\" android:value=\"%s\" />\n",
hand_tracking_frequency);
manifest_application_text += " <meta-data tools:node=\"replace\" android:name=\"com.oculus.handtracking.version\" android:value=\"V2.0\" />\n";
}
} else {
manifest_application_text += " <meta-data tools:node=\"remove\" android:name=\"com.oculus.supportedDevices\" />\n";
Expand Down
7 changes: 7 additions & 0 deletions platform/android/java/app/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@
android:name="xr_hand_tracking_metadata_name"
android:value="xr_hand_tracking_metadata_value"/>

<!-- XR hand tracking version -->
<!-- This is modified by the exporter based on the selected xr mode. DO NOT CHANGE the values here. -->
<!-- Removed at export time if the xr mode is not VR or hand tracking is disabled. -->
<meta-data
android:name="xr_hand_tracking_version_name"
android:value="xr_hand_tracking_version_value"/>

<!-- Supported Meta devices -->
<!-- This is removed by the exporter if the xr mode is not VR. -->
<meta-data
Expand Down