public class LegacyExceptionUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
LegacyExceptionUtils.BufferQueueAbandonedException
Checked exception thrown when a BufferQueue has been abandoned by its consumer.
|
Modifier and Type | Field and Description |
---|---|
static int |
ALREADY_EXISTS |
static int |
BAD_VALUE |
static int |
DEAD_OBJECT |
static int |
INVALID_OPERATION |
static int |
NO_ERROR |
static int |
PERMISSION_DENIED |
static int |
TIMED_OUT |
Modifier and Type | Method and Description |
---|---|
static int |
throwOnError(int errorFlag)
Throw error codes used by legacy device methods as exceptions.
|
static void |
throwOnServiceError(int errorFlag)
Throw error codes returned by the camera service as exceptions.
|
public static final int NO_ERROR
public static final int PERMISSION_DENIED
public static final int ALREADY_EXISTS
public static final int BAD_VALUE
public static final int DEAD_OBJECT
public static final int INVALID_OPERATION
public static final int TIMED_OUT
public static int throwOnError(int errorFlag) throws LegacyExceptionUtils.BufferQueueAbandonedException
Non-negative return values are passed through, negative return values are thrown as exceptions.
errorFlag
- error to throw as an exception.errorFlag
if the value was non-negative, throws otherwise.{@link
- BufferQueueAbandonedException} for -ENODEV.{@link
- UnsupportedOperationException} for an unknown negative error code.LegacyExceptionUtils.BufferQueueAbandonedException
public static void throwOnServiceError(int errorFlag)
errorFlag
- error to throw as an exception.