Repository: godotengine/godot
File: platform/android/java/lib/src/main/java/org/godotengine/godot/Godot.kt (Kotlin)

Code before:
	}

	/**
	 * Queue a runnable to be run on the render thread.
	 *
	 * This must be called after the render thread has started.
	 */
	fun runOnRenderThread(action: Runnable) {
		renderView?.queueOnRenderThread(action)
	}

	/**
	 * Runs the specified action on the host thread.
	 */
	fun runOnHostThread(action: Runnable) {
		primaryHost?.runOnHostThread(action)
	}

	/**
	 * Returns true if the call is being made on the Ui thread.
	 */
	private fun isOnUiThread() = Looper.myLooper() == Looper.getMainLooper()

	/**
	 * Returns true if `Vulkan` is used for rendering.
	 */
	private fun getNativeRenderer(): String {
		val rendererInfo = GodotLib.getRendererInfo(meetsVulkanRequirements(context.packageManager))
		var renderingDriverChosen = rendererInfo[0]
		var renderingDriverOriginal = rendererInfo[1]
		var renderingMethod = rendererInfo[2]
		var renderingDriverSource = rendererInfo[3]
		var renderingMethodSource = rendererInfo[4]
		Log.d(TAG, """renderingDevice: ${renderingDriverChosen} (${renderingDriverSource})
			renderer: ${renderingMethod} (${renderingMethodSource})""")

		if (renderingDriverOriginal == "vulkan" && renderingDriverChosen == "") {
			// Throw the exception for the case where Vulkan failed to create and no fallback was available.
			throw IllegalStateException(context.getString(R.string.error_missing_vulkan_requirements_message))
		}

		return renderingDriverChosen;
	}

	/**
	 * Returns true if can fallback to OpenGL.
	 */
	private fun canFallbackToOpenGL(): Boolean {
		return java.lang.Boolean.parseBoolean(GodotLib.getGlobal("rendering/rendering_device/fallback_to_opengl3"))
	}


Review comment (suggestion):
```suggestion
/**
	 * Returns the native rendering driver.
	 */
```

Code after:
	}

	/**
	 * Queue a runnable to be run on the render thread.
	 *
	 * This must be called after the render thread has started.
	 */
	fun runOnRenderThread(action: Runnable) {
		renderView?.queueOnRenderThread(action)
	}

	/**
	 * Runs the specified action on the host thread.
	 */
	fun runOnHostThread(action: Runnable) {
		primaryHost?.runOnHostThread(action)
	}

	/**
	 * Returns true if the call is being made on the Ui thread.
	 */
	private fun isOnUiThread() = Looper.myLooper() == Looper.getMainLooper()

/**
	 * Returns the native rendering driver.
	 */
	private fun getNativeRenderer(): String {
		val rendererInfo = GodotLib.getRendererInfo(meetsVulkanRequirements(context.packageManager))
		var renderingDriverChosen = rendererInfo[0]
		var renderingDriverOriginal = rendererInfo[1]
		var renderingMethod = rendererInfo[2]
		var renderingDriverSource = rendererInfo[3]
		var renderingMethodSource = rendererInfo[4]
		Log.d(TAG, """renderingDevice: ${renderingDriverChosen} (${renderingDriverSource})
			renderer: ${renderingMethod} (${renderingMethodSource})""")

		if (renderingDriverOriginal == "vulkan" && renderingDriverChosen == "") {
			// Throw the exception for the case where Vulkan failed to create and no fallback was available.
			throw IllegalStateException(context.getString(R.string.error_missing_vulkan_requirements_message))
		}

		return renderingDriverChosen;
	}

	/**
	 * Returns true if can fallback to OpenGL.
	 */
	private fun canFallbackToOpenGL(): Boolean {
		return java.lang.Boolean.parseBoolean(GodotLib.getGlobal("rendering/rendering_device/fallback_to_opengl3"))
	}