mirror of
https://github.com/godotengine/godot.git
synced 2026-05-12 22:35:35 +00:00
Merge pull request #114465 from m4gr3d/fix_editor_hybrid_app_support_detection
[Android editor] Restrict Android editor support for hybrid app projects to XR devices
This commit is contained in:
@@ -135,6 +135,8 @@ class Godot private constructor(val context: Context) {
|
||||
private val gyroscopeEnabled = AtomicBoolean(false)
|
||||
private val mGyroscope: Sensor? by lazy { mSensorManager?.getDefaultSensor(Sensor.TYPE_GYROSCOPE) }
|
||||
|
||||
val isXrRuntime: Boolean by lazy { hasFeature("xr_runtime") }
|
||||
|
||||
val tts = GodotTTS(context)
|
||||
val directoryAccessHandler = DirectoryAccessHandler(context)
|
||||
val fileAccessHandler = FileAccessHandler(context)
|
||||
|
||||
+1
-3
@@ -80,13 +80,11 @@ class GodotGLRenderView extends GLSurfaceView implements GodotRenderView {
|
||||
private final GodotInputHandler inputHandler;
|
||||
private final GodotRenderer godotRenderer;
|
||||
private final SparseArray<PointerIcon> customPointerIcons = new SparseArray<>();
|
||||
private final boolean isXrDevice;
|
||||
|
||||
public GodotGLRenderView(Godot godot, GodotInputHandler inputHandler, XRMode xrMode, boolean useDebugOpengl, boolean shouldBeTranslucent) {
|
||||
super(godot.getContext());
|
||||
|
||||
this.godot = godot;
|
||||
isXrDevice = godot.hasFeature("xr_runtime");
|
||||
this.inputHandler = inputHandler;
|
||||
this.godotRenderer = new GodotRenderer();
|
||||
setPointerIcon(PointerIcon.getSystemIcon(getContext(), PointerIcon.TYPE_DEFAULT));
|
||||
@@ -177,7 +175,7 @@ class GodotGLRenderView extends GLSurfaceView implements GodotRenderView {
|
||||
@Override
|
||||
public boolean canCapturePointer() {
|
||||
// Pointer capture is not supported on XR devices.
|
||||
return !isXrDevice && inputHandler.canCapturePointer();
|
||||
return !godot.isXrRuntime() && inputHandler.canCapturePointer();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-3
@@ -55,13 +55,11 @@ class GodotVulkanRenderView extends VkSurfaceView implements GodotRenderView {
|
||||
private final GodotInputHandler mInputHandler;
|
||||
private final VkRenderer mRenderer;
|
||||
private final SparseArray<PointerIcon> customPointerIcons = new SparseArray<>();
|
||||
private final boolean isXrDevice;
|
||||
|
||||
public GodotVulkanRenderView(Godot godot, GodotInputHandler inputHandler, boolean shouldBeTranslucent) {
|
||||
super(godot.getContext());
|
||||
|
||||
this.godot = godot;
|
||||
isXrDevice = godot.hasFeature("xr_runtime");
|
||||
mInputHandler = inputHandler;
|
||||
mRenderer = new VkRenderer();
|
||||
setPointerIcon(PointerIcon.getSystemIcon(getContext(), PointerIcon.TYPE_DEFAULT));
|
||||
@@ -156,7 +154,7 @@ class GodotVulkanRenderView extends VkSurfaceView implements GodotRenderView {
|
||||
@Override
|
||||
public boolean canCapturePointer() {
|
||||
// Pointer capture is not supported on XR devices.
|
||||
return !isXrDevice && mInputHandler.canCapturePointer();
|
||||
return !godot.isXrRuntime() && mInputHandler.canCapturePointer();
|
||||
}
|
||||
@Override
|
||||
public void requestPointerCapture() {
|
||||
|
||||
Reference in New Issue
Block a user