public class CameraExceptionHandler extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
CameraExceptionHandler.CameraExceptionCallback
A callback helps to handle RuntimeException thrown by camera framework.
|
Constructor and Description |
---|
CameraExceptionHandler(CameraExceptionHandler.CameraExceptionCallback callback,
Handler handler)
Construct a new instance of
CameraExceptionHandler with a custom callback which will
be executed on a specific Handler . |
CameraExceptionHandler(Handler handler)
Construct a new instance of
CameraExceptionHandler with a default callback which will
be executed on a specific Handler . |
Modifier and Type | Method and Description |
---|---|
void |
onCameraError(int errorCode)
Invoke @{link CameraExceptionCallback} when an error is reported by Android camera framework.
|
void |
onCameraException(RuntimeException ex,
String commandHistory,
int action,
int state)
Invoke @{link CameraExceptionCallback} when a runtime exception is thrown by Android camera
framework.
|
void |
onDispatchThreadException(RuntimeException ex)
Invoke @{link CameraExceptionCallback} when a runtime exception is thrown by
|
public CameraExceptionHandler(CameraExceptionHandler.CameraExceptionCallback callback, Handler handler)
CameraExceptionHandler
with a custom callback which will
be executed on a specific Handler
.callback
- The callback which will be invoked.handler
- The handler in which the callback will be invoked in.public CameraExceptionHandler(Handler handler)
CameraExceptionHandler
with a default callback which will
be executed on a specific Handler
.handler
- The handler in which the default callback will be invoked in.public void onCameraError(int errorCode)
errorCode
- An integer to represent the error code.Camera.setErrorCallback(android.hardware.Camera.ErrorCallback)
public void onCameraException(RuntimeException ex, String commandHistory, int action, int state)
ex
- The runtime exception object.public void onDispatchThreadException(RuntimeException ex)
ex
- The runtime exception object.