1

I'm looking for something like this:

CameraManager cameraManager = (CameraManager) getSystemService(CAMERA_SERVICE);
cameraManager.setTorchMode("0", true);
cameraManager.setTorchLevel("0", 2); //change the brightness based on the number given
Henry Twist
  • 5,666
  • 3
  • 19
  • 44
idle
  • 21
  • 2
  • There are quite a few duplicates of this question, did none of them help? – Henry Twist Apr 27 '21 at 14:09
  • there was one recent discussion about this but it was not helpful at all – idle Apr 27 '21 at 14:18
  • These seem to suggest that there isn't a way: https://stackoverflow.com/questions/5970188/can-i-change-the-led-intensity-of-an-android-device | https://stackoverflow.com/questions/15357241/flashled-intensity-controls | https://stackoverflow.com/questions/10285498/can-we-reduce-camera-flash-light-brightness-in-android | https://stackoverflow.com/questions/31167430/controlling-the-brightness-of-the-flashlight-in-android | https://stackoverflow.com/questions/20701937/is-the-flashlight-intensity-brightness-controllable-on-android – Henry Twist Apr 27 '21 at 14:29
  • but these are all old topics. I believe ability to adjust flashlight brightness was added after android oreo or pie. – idle Apr 27 '21 at 15:02
  • Where did you see that? – Henry Twist Apr 27 '21 at 15:09
  • I'm not really sure about other android manufactures except Samsung. https://android.gadgethacks.com/how-to/theres-easy-way-change-flashlight-brightness-your-galaxy-phone-0214247/ – idle Apr 27 '21 at 15:14
  • Hi, Did you manage to adjust the brightness of the flashlight ? – Walid Jun 13 '22 at 16:24

1 Answers1

0

This will work only on devices with android 13 and new version of camera hardware abstraction layer (tested on pixel 6 pro). It might also work on some samsung devices with lower android version (not tested).