Lens Checking Helper
Checks if the desired camera (front or back) is available and shows an error dialog if not.
Return
CameraSelector? Returns a valid CameraSelector if the camera is available; null otherwise.
Parameters
context
The context (usually the activity) to show the dialog.
available Cameras
The list of available camera information.
is Back Camera
Flag indicating if the back camera is required.
on Error
Callback function to handle errors (e.g., finish the activity).