MtpDeviceInfo
public
class
MtpDeviceInfo
extends Object
java.lang.Object | |
↳ | android.mtp.MtpDeviceInfo |
This class encapsulates information about an MTP device. This corresponds to the DeviceInfo Dataset described in section 5.1.1 of the MTP specification.
Summary
Public methods | |
---|---|
final
int[]
|
getEventsSupported()
Returns event code supported by the device. |
final
String
|
getManufacturer()
Returns the manufacturer's name for the MTP device |
final
String
|
getModel()
Returns the model name for the MTP device |
final
int[]
|
getOperationsSupported()
Returns operation code supported by the device. |
final
String
|
getSerialNumber()
Returns the unique serial number for the MTP device |
final
String
|
getVersion()
Returns the version string the MTP device |
boolean
|
isEventSupported(int code)
Returns if the given event is supported by the device or not. |
boolean
|
isOperationSupported(int code)
Returns if the given operation is supported by the device or not. |
Inherited methods | |
---|---|
Public methods
getEventsSupported
public final int[] getEventsSupported ()
Returns event code supported by the device.
Returns | |
---|---|
int[] |
supported event code. Can be null if device does not provide the property. |
See also:
MtpEvent.EVENT_UNDEFINED
MtpEvent.EVENT_CANCEL_TRANSACTION
MtpEvent.EVENT_OBJECT_ADDED
MtpEvent.EVENT_OBJECT_REMOVED
MtpEvent.EVENT_STORE_ADDED
MtpEvent.EVENT_STORE_REMOVED
MtpEvent.EVENT_DEVICE_PROP_CHANGED
MtpEvent.EVENT_OBJECT_INFO_CHANGED
MtpEvent.EVENT_DEVICE_INFO_CHANGED
MtpEvent.EVENT_REQUEST_OBJECT_TRANSFER
MtpEvent.EVENT_STORE_FULL
MtpEvent.EVENT_DEVICE_RESET
MtpEvent.EVENT_STORAGE_INFO_CHANGED
MtpEvent.EVENT_CAPTURE_COMPLETE
MtpEvent.EVENT_UNREPORTED_STATUS
MtpEvent.EVENT_OBJECT_PROP_CHANGED
MtpEvent.EVENT_OBJECT_PROP_DESC_CHANGED
MtpEvent.EVENT_OBJECT_REFERENCES_CHANGED
getManufacturer
public final String getManufacturer ()
Returns the manufacturer's name for the MTP device
Returns | |
---|---|
String |
the manufacturer name
This value cannot be null . |
getModel
public final String getModel ()
Returns the model name for the MTP device
Returns | |
---|---|
String |
the model name
This value cannot be null . |
getOperationsSupported
public final int[] getOperationsSupported ()
Returns operation code supported by the device.
Returns | |
---|---|
int[] |
supported operation code. Can be null if device does not provide the property. |
See also:
MtpConstants.OPERATION_GET_DEVICE_INFO
MtpConstants.OPERATION_OPEN_SESSION
MtpConstants.OPERATION_CLOSE_SESSION
MtpConstants.OPERATION_GET_STORAGE_I_DS
MtpConstants.OPERATION_GET_STORAGE_INFO
MtpConstants.OPERATION_GET_NUM_OBJECTS
MtpConstants.OPERATION_GET_OBJECT_HANDLES
MtpConstants.OPERATION_GET_OBJECT_INFO
MtpConstants.OPERATION_GET_OBJECT
MtpConstants.OPERATION_GET_THUMB
MtpConstants.OPERATION_DELETE_OBJECT
MtpConstants.OPERATION_SEND_OBJECT_INFO
MtpConstants.OPERATION_SEND_OBJECT
MtpConstants.OPERATION_INITIATE_CAPTURE
MtpConstants.OPERATION_FORMAT_STORE
MtpConstants.OPERATION_RESET_DEVICE
MtpConstants.OPERATION_SELF_TEST
MtpConstants.OPERATION_SET_OBJECT_PROTECTION
MtpConstants.OPERATION_POWER_DOWN
MtpConstants.OPERATION_GET_DEVICE_PROP_DESC
MtpConstants.OPERATION_GET_DEVICE_PROP_VALUE
MtpConstants.OPERATION_SET_DEVICE_PROP_VALUE
MtpConstants.OPERATION_RESET_DEVICE_PROP_VALUE
MtpConstants.OPERATION_TERMINATE_OPEN_CAPTURE
MtpConstants.OPERATION_MOVE_OBJECT
MtpConstants.OPERATION_COPY_OBJECT
MtpConstants.OPERATION_GET_PARTIAL_OBJECT
MtpConstants.OPERATION_INITIATE_OPEN_CAPTURE
MtpConstants.OPERATION_GET_OBJECT_PROPS_SUPPORTED
MtpConstants.OPERATION_GET_OBJECT_PROP_DESC
MtpConstants.OPERATION_GET_OBJECT_PROP_VALUE
MtpConstants.OPERATION_SET_OBJECT_PROP_VALUE
MtpConstants.OPERATION_GET_OBJECT_REFERENCES
MtpConstants.OPERATION_SET_OBJECT_REFERENCES
MtpConstants.OPERATION_SKIP
getSerialNumber
public final String getSerialNumber ()
Returns the unique serial number for the MTP device
Returns | |
---|---|
String |
the serial number
This value cannot be null . |
getVersion
public final String getVersion ()
Returns the version string the MTP device
Returns | |
---|---|
String |
the device version
This value cannot be null . |
isEventSupported
public boolean isEventSupported (int code)
Returns if the given event is supported by the device or not.
Parameters | |
---|---|
code |
int : Event code. |
Returns | |
---|---|
boolean |
If the given event is supported by the device or not. |
isOperationSupported
public boolean isOperationSupported (int code)
Returns if the given operation is supported by the device or not.
Parameters | |
---|---|
code |
int : Operation code. |
Returns | |
---|---|
boolean |
If the given operation is supported by the device or not. |