Skip to content
com.iristick.smartglass.support.camera2

Class CameraAccessException

All Implemented Interfaces:
Serializable

Deprecated. 
Not maintained anymore. Please use the com.iristick.smartglass.core.camera package instead.

@Deprecated
public class CameraAccessException
extends Exception

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

Compatibility Information Whenever the underlying Android Camera2 api throws a CameraAccessException, that exception will be wrapped in an exception of this type. The original exception will be accessible through the Throwable.getCause() method. Whenever the underlying Iristick Camera api throws an exception, that exception will be wrapped in an exception of this type and the correct reason will be derived from it. The original exception will be accessible through the Throwable.getCause() method.

Since:
Android API level 21
See Also:
CameraManager, CameraDevice, Serialized Form

Field Summary

Modifier and Type Field and Description
static int CAMERA_DISABLED
Deprecated. 
The camera is disabled due to a device policy, and cannot be opened.
static int CAMERA_DISCONNECTED
Deprecated. 
The camera device is removable and has been disconnected from the Android device, or the camera id used with CameraManager.openCamera(java.lang.String, android.hardware.camera2.CameraDevice.StateCallback, android.os.Handler) is no longer valid, or the camera service has shut down the connection due to a higher-priority access request for the camera device.
static int CAMERA_ERROR
Deprecated. 
The camera device is currently in the error state.
static int CAMERA_IN_USE
Deprecated. 
The camera device is in use already.
static int MAX_CAMERAS_IN_USE
Deprecated. 
The system-wide limit for number of open cameras or camera resources has been reached, and more camera devices cannot be opened or torch mode cannot be turned on until previous instances are closed.
static int UNSUPPORTED_OPERATION
Deprecated. 
The camera device does not support this particular operation.

Constructor Summary

Constructor and Description
CameraAccessException(CameraAccessException cause)
Deprecated. 
 
CameraAccessException(int problem)
Deprecated. 
 
CameraAccessException(int problem, String message)
Deprecated. 
 
CameraAccessException(int problem, String message, Throwable cause)
Deprecated. 
 
CameraAccessException(int problem, Throwable cause)
Deprecated. 
 

Method Summary

Modifier and Type Method and Description
int getReason()
Deprecated. 
The reason for the failure to access the camera.

Methods inherited from class java.lang.Throwable

addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

CAMERA_DISABLED

public static final int CAMERA_DISABLED
Deprecated. 
The camera is disabled due to a device policy, and cannot be opened.
See Also:
DevicePolicyManager.setCameraDisabled(android.content.ComponentName, boolean)

CAMERA_DISCONNECTED

public static final int CAMERA_DISCONNECTED
Deprecated. 
The camera device is removable and has been disconnected from the Android device, or the camera id used with CameraManager.openCamera(java.lang.String, android.hardware.camera2.CameraDevice.StateCallback, android.os.Handler) is no longer valid, or the camera service has shut down the connection due to a higher-priority access request for the camera device.

CAMERA_ERROR

public static final int CAMERA_ERROR
Deprecated. 
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 CameraDevice.StateCallback.onError(com.iristick.smartglass.support.camera2.CameraDevice, int) for the exact nature of the error.

No further calls to the camera will succeed. Clean up the camera with CameraDevice.close() and try handling the error in order to successfully re-open the camera.

CAMERA_IN_USE

public static final int CAMERA_IN_USE
Deprecated. 
The camera device is in use already.

MAX_CAMERAS_IN_USE

public static final int MAX_CAMERAS_IN_USE
Deprecated. 
The system-wide limit for number of open cameras or camera resources has been reached, and more camera devices cannot be opened or torch mode cannot be turned on until previous instances are closed.

UNSUPPORTED_OPERATION

public static final int UNSUPPORTED_OPERATION
Deprecated. 
The camera device does not support this particular operation.

Constructor Detail

CameraAccessException

public CameraAccessException(int problem)
Deprecated. 

CameraAccessException

public CameraAccessException(int problem,
                             String message)
Deprecated. 

CameraAccessException

public CameraAccessException(int problem,
                             String message,
                             Throwable cause)
Deprecated. 

CameraAccessException

public CameraAccessException(int problem,
                             Throwable cause)
Deprecated. 

CameraAccessException

public CameraAccessException(CameraAccessException cause)
Deprecated. 

Method Detail

getReason

public final int getReason()
Deprecated. 
The reason for the failure to access the camera.
Returns:
A reason code.
See Also:
CAMERA_DISABLED, CAMERA_DISCONNECTED, CAMERA_ERROR, CAMERA_IN_USE, MAX_CAMERAS_IN_USE, UNSUPPORTED_OPERATION