CameraAccessExceptionpublic 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.
|
Fields Summary |
---|
public static final int | CAMERA_IN_USEThe camera device is in use already | public static final int | MAX_CAMERAS_IN_USEThe 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_DISABLEDThe camera is disabled due to a device policy, and cannot be opened. | public static final int | CAMERA_DISCONNECTEDThe 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_ERRORThe 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_HALA 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.String | getDefaultMessage(int problem)
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 int | getReason()The reason for the failure to access the camera.
return mReason;
|
|