Skip to content
This repository has been archived by the owner on Jul 30, 2023. It is now read-only.

Looks like android front flash is not supported ! [FEATURE-REQUEST] #33

Open
mwshubham opened this issue Nov 8, 2017 · 2 comments
Open

Comments

@mwshubham
Copy link

mwshubham commented Nov 8, 2017

I checked the source code. and found

@Override
    public void initializeCameraManager(ConfigurationProvider configurationProvider, Context context) {
        super.initializeCameraManager(configurationProvider, context);

        this.manager = (CameraManager) context.getSystemService(Context.CAMERA_SERVICE);

        WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
        Display display = windowManager.getDefaultDisplay();
        Point size = new Point();
        display.getSize(size);
        windowSize = new Size(size.x, size.y);

        try {
            String[] ids = manager.getCameraIdList();
            numberOfCameras = ids.length;
            for (String id : ids) {
                CameraCharacteristics characteristics = manager.getCameraCharacteristics(id);

                int orientation = characteristics.get(CameraCharacteristics.LENS_FACING);
                if (orientation == CameraCharacteristics.LENS_FACING_FRONT) {
                    faceFrontCameraId = id;
                    faceFrontCameraOrientation = characteristics.get(CameraCharacteristics.SENSOR_ORIENTATION);
                    frontCameraCharacteristics = characteristics;
                } else {
                    faceBackCameraId = id;
                    faceBackCameraOrientation = characteristics.get(CameraCharacteristics.SENSOR_ORIENTATION);
                    backCameraCharacteristics = characteristics;
                }
            }
        } catch (Exception e) {
            Log.e(TAG, "Error during camera init");
        }
    }

looks like it is checking the lens orientation/facing, but did not find usage of FLASH_INFO_AVAILABLE anywhere.

@arpitgandhi9
Copy link
Member

Are you looking for screen flash when in front camera mode?

@mwshubham
Copy link
Author

no, there are some devices which support front flash as well. However, the current version of the library does not support it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants