1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Fix the CAMERA permission request on HorizonOS devices

This commit is contained in:
Fredia Huya-Kouadio
2025-06-05 13:33:43 -07:00
parent 5dd76968d8
commit a0cb64569b
3 changed files with 23 additions and 10 deletions

View File

@@ -37,6 +37,16 @@ package org.godotengine.editor
*/
open class GodotEditor : BaseGodotEditor() {
override fun getExcludedPermissions(): MutableSet<String> {
val excludedPermissions = super.getExcludedPermissions().apply {
// The AVATAR_CAMERA and HEADSET_CAMERA permissions are requested when `CameraFeed.feed_is_active`
// is enabled.
add("horizonos.permission.AVATAR_CAMERA")
add("horizonos.permission.HEADSET_CAMERA")
}
return excludedPermissions
}
override fun getXRRuntimePermissions(): MutableSet<String> {
val xrRuntimePermissions = super.getXRRuntimePermissions()
xrRuntimePermissions.add("com.oculus.permission.USE_SCENE")

View File

@@ -185,16 +185,14 @@ abstract class BaseGodotEditor : GodotActivity(), GameMenuFragment.GameMenuListe
*
* The permissions in this set will be requested on demand based on use cases.
*/
private fun getExcludedPermissions(): MutableSet<String> {
@CallSuper
protected open fun getExcludedPermissions(): MutableSet<String> {
val excludedPermissions = mutableSetOf(
// The RECORD_AUDIO permission is requested when the "audio/driver/enable_input" project
// setting is enabled.
Manifest.permission.RECORD_AUDIO,
// The CAMERA permission is requested when `CameraFeed.feed_is_active` is enabled.
Manifest.permission.CAMERA,
)
excludedPermissions.add(
// The REQUEST_INSTALL_PACKAGES permission is requested the first time we attempt to
// open an apk file.
Manifest.permission.REQUEST_INSTALL_PACKAGES,