Can't enable flash on an android device

so you’re saying Android will not let you affect the flash at all, while OpenCV APIs hold the camera?

maybe there is a way but I don’t know it.

in your place, I’d use Android APIs to use the camera, including getting frames from it. you can then convert the data to OpenCV Mat objects (wrapping, no copy).