FLASH_MODE_AUTO does not work in Android on Samsung Note III

android: FLASH_MODE_AUTO does not work for the camera on Samsung Note III Android 4.4.2

I added AndroidManifest.xml permission

<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.flash" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.hardware.camera.autofocus" />

<uses-permission
android:name="android.permission.FLASHLIGHT"
android:permissionGroup="android.permission-group.HARDWARE_CONTROLS"
android:protectionLevel="normal" />

I use the following code to set the camera parameters

Camera.Parameters params = camera.getParameters();
List<String> flashModes = params.getSupportedFlashModes();
if (flashModes.contains(android.hardware.Camera.Parameters.FLASH_MODE_AUTO))
{
params.setFlashMode(Camera.Parameters.FLASH_MODE_AUTO);
}
camera.setParameters(params);

Whenever I press the capture button, flash does not appear on note III. However, on Samsung Grand, Grand II and Google Nexus and HTC Sensation it works fine

Note. If I use FLASH_MODE_TORCH, it works correctly, but always shows flash.

Please help me if someone has encountered a similar problem.

+4
source share

Source: https://habr.com/ru/post/1527306/


All Articles