setTorchEnabled

fun setTorchEnabled(enable: Boolean, torchChangedResultListener: (isSuccessful: Boolean) -> Unit? = null)

Sets the new state of the torch and optionally registers a listener to the operation result.

Parameters

torchChangedResultListener

An optional listener to receive the status of the torch change, which returns true if the torch was successfully changed or false if the operation failed.