GodotVR / godot_oculus_mobile

Godot Oculus mobile drivers (Oculus Go / Oculus Quest)
MIT License
169 stars 34 forks source link

Enabling hand tracking permission breaks OS.request_permissions() #102

Closed NeoSpark314 closed 4 years ago

NeoSpark314 commented 4 years ago

It appears that the presence of the hand tracking permission inside the AndroidManifest.xml throws a NameNotFound exception at https://github.com/godotengine/godot/blob/7899b3e734e5c64304e8ffb56293fb4b1912b547/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java#L117 and https://github.com/godotengine/godot/blob/7899b3e734e5c64304e8ffb56293fb4b1912b547/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java#L157

This leads to not triggering the permission request dialog and also always returns an empty array for the list of permissions.

A temp. workaround is to continue the loop at these points even when the exception is thrown instead of returning an empty list/false but I don't know the implications of this change.

m4gr3d commented 4 years ago

@NeoSpark314 I've cherry-picked the fix in https://github.com/godotengine/godot/pull/38468 into https://github.com/m4gr3d/godot/tree/fix_permissions_handling_bug_3.2. Can you check if that resolves the issue for you.

NeoSpark314 commented 4 years ago

From the code change in your PR it looks like what I did in my workaround so it should solve the issue. I can test your change this afternoon (~8 hours from now).

NeoSpark314 commented 4 years ago

Works with current master of godot 3.2.