summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-06-28 09:09:38 +0200
committerGitHub <noreply@github.com>2020-06-28 09:09:38 +0200
commite1ef3f2da6bdfe53f08aee4e154584b14f09c0aa (patch)
tree44ed8a2a25861705a6986a98656a2c14c782eeb4
parent46b36805d997b14596f5960fb5a8656f122ed24f (diff)
parent2d53b8173e051a00aa8f2a9018c8d544786975f8 (diff)
Merge pull request #39904 from m4gr3d/fix_focus_aware_option_master
Fix the logic to enable focus awareness
-rw-r--r--platform/android/export/export.cpp6
-rw-r--r--platform/android/java/app/AndroidManifest.xml4
2 files changed, 6 insertions, 4 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index a663a847c2..2f6f483edf 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -862,6 +862,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
String tname = string_table[name];
uint32_t attrcount = decode_uint32(&p_manifest[iofs + 20]);
iofs += 28;
+ bool is_focus_aware_metadata = false;
for (uint32_t i = 0; i < attrcount; i++) {
uint32_t attr_nspace = decode_uint32(&p_manifest[iofs]);
@@ -929,9 +930,9 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
}
}
- if (tname == "meta-data" && attrname == "value" && value == "oculus_focus_aware_value") {
+ if (tname == "meta-data" && attrname == "value" && is_focus_aware_metadata) {
// Update the focus awareness meta-data value
- string_table.write[attr_value] = xr_mode_index == /* XRMode.OVR */ 1 && focus_awareness ? "true" : "false";
+ encode_uint32(xr_mode_index == /* XRMode.OVR */ 1 && focus_awareness ? 0xFFFFFFFF : 0, &p_manifest.write[iofs + 16]);
}
if (tname == "meta-data" && attrname == "value" && value == "plugins_value" && !plugins_names.empty()) {
@@ -939,6 +940,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
string_table.write[attr_value] = plugins_names;
}
+ is_focus_aware_metadata = tname == "meta-data" && attrname == "name" && value == "com.oculus.vr.focusaware";
iofs += 20;
}
diff --git a/platform/android/java/app/AndroidManifest.xml b/platform/android/java/app/AndroidManifest.xml
index dbf1dc0f3c..48c09552c1 100644
--- a/platform/android/java/app/AndroidManifest.xml
+++ b/platform/android/java/app/AndroidManifest.xml
@@ -45,8 +45,8 @@
android:resizeableActivity="false"
tools:ignore="UnusedAttribute" >
- <!-- Focus awareness metadata populated at export time if the user enables it in the 'Xr Features' section. -->
- <meta-data android:name="com.oculus.vr.focusaware" android:value="oculus_focus_aware_value" />
+ <!-- Focus awareness metadata is updated at export time if the user enables it in the 'Xr Features' section. -->
+ <meta-data android:name="com.oculus.vr.focusaware" android:value="false" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />