FileDocCategorySizeDatePackage
CameraAccessException.javaAPI DocAndroid 5.1 API4855Thu Mar 12 22:22:10 GMT 2015android.hardware.camera2

CameraAccessException

public class CameraAccessException extends android.util.AndroidException

CameraAccessException is thrown if a camera device could not be queried or opened by the {@link CameraManager}, or if the connection to an opened {@link CameraDevice} is no longer valid.

see
CameraManager
see
CameraDevice

Fields Summary
public static final int
CAMERA_IN_USE
The camera device is in use already
public static final int
MAX_CAMERAS_IN_USE
The system-wide limit for number of open cameras has been reached, and more camera devices cannot be opened until previous instances are closed.
public static final int
CAMERA_DISABLED
The camera is disabled due to a device policy, and cannot be opened.
public static final int
CAMERA_DISCONNECTED
The camera device is removable and has been disconnected from the Android device, or the camera id used with {@link android.hardware.camera2.CameraManager#openCamera} is no longer valid, or the camera service has shut down the connection due to a higher-priority access request for the camera device.
public static final int
CAMERA_ERROR
The camera device is currently in the error state.

The camera has failed to open or has failed at a later time as a result of some non-user interaction. Refer to {@link CameraDevice.StateCallback#onError} for the exact nature of the error.

No further calls to the camera will succeed. Clean up the camera with {@link CameraDevice#close} and try handling the error in order to successfully re-open the camera.

public static final int
CAMERA_DEPRECATED_HAL
A deprecated HAL version is in use.
private static final long
serialVersionUID
private final int
mReason
Constructors Summary
public CameraAccessException(int problem)

        super(getDefaultMessage(problem));
        mReason = problem;
    
public CameraAccessException(int problem, String message)

        super(message);
        mReason = problem;
    
public CameraAccessException(int problem, String message, Throwable cause)

        super(message, cause);
        mReason = problem;
    
public CameraAccessException(int problem, Throwable cause)

        super(getDefaultMessage(problem), cause);
        mReason = problem;
    
Methods Summary
public static java.lang.StringgetDefaultMessage(int problem)

hide

        switch (problem) {
            case CAMERA_IN_USE:
                return "The camera device is in use already";
            case MAX_CAMERAS_IN_USE:
                return "The system-wide limit for number of open cameras has been reached, " +
                       "and more camera devices cannot be opened until previous instances " +
                       "are closed.";
            case CAMERA_DISCONNECTED:
                return "The camera device is removable and has been disconnected from the " +
                        "Android device, or the camera service has shut down the connection due " +
                        "to a higher-priority access request for the camera device.";
            case CAMERA_DISABLED:
                return "The camera is disabled due to a device policy, and cannot be opened.";
            case CAMERA_ERROR:
                return "The camera device is currently in the error state; " +
                       "no further calls to it will succeed.";
        }
        return null;
    
public final intgetReason()
The reason for the failure to access the camera.

see
#CAMERA_DISABLED
see
#CAMERA_DISCONNECTED
see
#CAMERA_ERROR


                        
        
        return mReason;