Ignore failures to load openxr_forwardloader.oculus for v62+

In v62 openxr_forwardloader.oculus.so was removed.
To keep backwards compatibility with v60 there is still an attempt to load the
library, but failure to do so is no longer fatal.
This commit is contained in:
gyro 2024-01-22 18:08:16 -08:00
parent e1398b60de
commit 1412662180
2 changed files with 13 additions and 1 deletions

@ -1 +1 @@
Subproject commit c155debd3764d13544b63eda75cdc3ff910661d2
Subproject commit 820278f99f98928ac1f3d27916c4aa24c6539521

View file

@ -6,6 +6,7 @@ import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
import android.hardware.display.DisplayManager;
import android.os.Build;
import android.os.Bundle;
import android.view.Display;
import android.view.InputDevice;
@ -26,6 +27,17 @@ public class VrActivity extends EmulationActivity {
public static VrActivity currentActivity = null;
ClickRunnable clickRunnable = new ClickRunnable();
static {
if (Build.BRAND.equals("oculus")) {
try {
System.loadLibrary("openxr_forwardloader.oculus");
} catch (UnsatisfiedLinkError e) {
// This was needed before v62
// In v62 this library is deleted
}
}
}
public final ActivityResultLauncher<SoftwareKeyboard.KeyboardConfig> mVrKeyboardLauncher =
registerForActivityResult(new VrKeyboardActivity.Contract(),
result -> VrKeyboardActivity.onFinishResult(result));