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's result.
Interacting with this API disables the auto torch functionality.
Parameters
enable
A Boolean that indicates in which state to set to the torch, if it's true the torch will be turned on, if it's false the torch will be turned off.
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.