CameraUnavailableException
public class CameraUnavailableException extends Exception
| java.lang.Object | |||
| ↳ | kotlin.Throwable | ||
| ↳ | java.lang.Exception | ||
| ↳ | androidx.camera.core.CameraUnavailableException |
CameraUnavailableException is thrown when a camera device could not be queried or opened or if the connection to an opened camera device is no longer valid.
Summary
Constants |
|
|---|---|
static final int |
CAMERA_DISABLED = 1The camera is disabled due to a device policy, and cannot be opened. |
static final int |
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. |
static final int |
CAMERA_ERROR = 3The camera device is currently in the error state. |
static final int |
CAMERA_IN_USE = 4The camera device is in use already. |
static final int |
The system-wide limit for number of open cameras or camera resources has been reached, and more camera devices cannot be opened. |
static final int |
The camera is unavailable due to |
static final int |
Some other error occurred. |
Public constructors |
|---|
CameraUnavailableException(int reason) |
CameraUnavailableException(int reason, @Nullable Throwable cause) |
CameraUnavailableException(int reason, @Nullable String message) |
CameraUnavailableException( |
Public methods |
|
|---|---|
int |
The reason the camera is unavailable. |
Inherited methods |
|---|
Constants
CAMERA_DISABLED
public static final int CAMERA_DISABLED = 1
The camera is disabled due to a device policy, and cannot be opened.
CAMERA_DISCONNECTED
public static final int CAMERA_DISCONNECTED = 2
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.
CAMERA_ERROR
public static final int CAMERA_ERROR = 3
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.
CAMERA_IN_USE
public static final int CAMERA_IN_USE = 4
The camera device is in use already.
CAMERA_MAX_IN_USE
public static final int CAMERA_MAX_IN_USE = 5
The system-wide limit for number of open cameras or camera resources has been reached, and more camera devices cannot be opened.
CAMERA_UNAVAILABLE_DO_NOT_DISTURB
public static final int CAMERA_UNAVAILABLE_DO_NOT_DISTURB = 6
The camera is unavailable due to NotificationManager.Policy. Some API 28 devices cannot access the camera when the device is in "Do Not Disturb" mode. The camera will not be accessible until "Do Not Disturb" mode is disabled.
CAMERA_UNKNOWN_ERROR
public static final int CAMERA_UNKNOWN_ERROR = 0
Some other error occurred.
Public constructors
CameraUnavailableException
public CameraUnavailableException(int reason, @Nullable Throwable cause)
CameraUnavailableException
public CameraUnavailableException(int reason, @Nullable String message)