MtpDeviceInfo
Stay organized with collections
Save and categorize content based on your preferences.
open class 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 | |
---|---|
IntArray |
Returns event code supported by the device. |
String |
Returns the manufacturer's name for the MTP device |
String |
getModel() Returns the model name for the MTP device |
IntArray |
Returns operation code supported by the device. |
String |
Returns the unique serial number for the MTP device |
String |
Returns the version string the MTP device |
open Boolean |
isEventSupported(code: Int) Returns if the given event is supported by the device or not. |
open Boolean |
isOperationSupported(code: Int) Returns if the given operation is supported by the device or not. |
Public methods
getEventsSupported
fun getEventsSupported(): IntArray
Returns event code supported by the device.
Return | |
---|---|
IntArray |
supported event code. Can be null if device does not provide the property. |
See Also
android.mtp.MtpEvent#EVENT_UNDEFINED
android.mtp.MtpEvent#EVENT_CANCEL_TRANSACTION
android.mtp.MtpEvent#EVENT_OBJECT_ADDED
android.mtp.MtpEvent#EVENT_OBJECT_REMOVED
android.mtp.MtpEvent#EVENT_STORE_ADDED
android.mtp.MtpEvent#EVENT_STORE_REMOVED
android.mtp.MtpEvent#EVENT_DEVICE_PROP_CHANGED
android.mtp.MtpEvent#EVENT_OBJECT_INFO_CHANGED
android.mtp.MtpEvent#EVENT_DEVICE_INFO_CHANGED
android.mtp.MtpEvent#EVENT_REQUEST_OBJECT_TRANSFER
android.mtp.MtpEvent#EVENT_STORE_FULL
android.mtp.MtpEvent#EVENT_DEVICE_RESET
android.mtp.MtpEvent#EVENT_STORAGE_INFO_CHANGED
android.mtp.MtpEvent#EVENT_CAPTURE_COMPLETE
android.mtp.MtpEvent#EVENT_UNREPORTED_STATUS
android.mtp.MtpEvent#EVENT_OBJECT_PROP_CHANGED
android.mtp.MtpEvent#EVENT_OBJECT_PROP_DESC_CHANGED
android.mtp.MtpEvent#EVENT_OBJECT_REFERENCES_CHANGED
getManufacturer
fun getManufacturer(): String
Returns the manufacturer's name for the MTP device
Return | |
---|---|
String |
the manufacturer name This value cannot be null . |
getModel
fun getModel(): String
Returns the model name for the MTP device
Return | |
---|---|
String |
the model name This value cannot be null . |
getOperationsSupported
fun getOperationsSupported(): IntArray
Returns operation code supported by the device.
Return | |
---|---|
IntArray |
supported operation code. Can be null if device does not provide the property. |
See Also
android.mtp.MtpConstants#OPERATION_GET_DEVICE_INFO
android.mtp.MtpConstants#OPERATION_OPEN_SESSION
android.mtp.MtpConstants#OPERATION_CLOSE_SESSION
android.mtp.MtpConstants#OPERATION_GET_STORAGE_I_DS
android.mtp.MtpConstants#OPERATION_GET_STORAGE_INFO
android.mtp.MtpConstants#OPERATION_GET_NUM_OBJECTS
android.mtp.MtpConstants#OPERATION_GET_OBJECT_HANDLES
android.mtp.MtpConstants#OPERATION_GET_OBJECT_INFO
android.mtp.MtpConstants#OPERATION_GET_OBJECT
android.mtp.MtpConstants#OPERATION_GET_THUMB
android.mtp.MtpConstants#OPERATION_DELETE_OBJECT
android.mtp.MtpConstants#OPERATION_SEND_OBJECT_INFO
android.mtp.MtpConstants#OPERATION_SEND_OBJECT
android.mtp.MtpConstants#OPERATION_INITIATE_CAPTURE
android.mtp.MtpConstants#OPERATION_FORMAT_STORE
android.mtp.MtpConstants#OPERATION_RESET_DEVICE
android.mtp.MtpConstants#OPERATION_SELF_TEST
android.mtp.MtpConstants#OPERATION_SET_OBJECT_PROTECTION
android.mtp.MtpConstants#OPERATION_POWER_DOWN
android.mtp.MtpConstants#OPERATION_GET_DEVICE_PROP_DESC
android.mtp.MtpConstants#OPERATION_GET_DEVICE_PROP_VALUE
android.mtp.MtpConstants#OPERATION_SET_DEVICE_PROP_VALUE
android.mtp.MtpConstants#OPERATION_RESET_DEVICE_PROP_VALUE
android.mtp.MtpConstants#OPERATION_TERMINATE_OPEN_CAPTURE
android.mtp.MtpConstants#OPERATION_MOVE_OBJECT
android.mtp.MtpConstants#OPERATION_COPY_OBJECT
android.mtp.MtpConstants#OPERATION_GET_PARTIAL_OBJECT
android.mtp.MtpConstants#OPERATION_INITIATE_OPEN_CAPTURE
android.mtp.MtpConstants#OPERATION_GET_OBJECT_PROPS_SUPPORTED
android.mtp.MtpConstants#OPERATION_GET_OBJECT_PROP_DESC
android.mtp.MtpConstants#OPERATION_GET_OBJECT_PROP_VALUE
android.mtp.MtpConstants#OPERATION_SET_OBJECT_PROP_VALUE
android.mtp.MtpConstants#OPERATION_GET_OBJECT_REFERENCES
android.mtp.MtpConstants#OPERATION_SET_OBJECT_REFERENCES
android.mtp.MtpConstants#OPERATION_SKIP
getSerialNumber
fun getSerialNumber(): String
Returns the unique serial number for the MTP device
Return | |
---|---|
String |
the serial number This value cannot be null . |
getVersion
fun getVersion(): String
Returns the version string the MTP device
Return | |
---|---|
String |
the device version This value cannot be null . |
isEventSupported
open fun isEventSupported(code: Int): Boolean
Returns if the given event is supported by the device or not.
Parameters | |
---|---|
code |
Int: Event code. |
Return | |
---|---|
Boolean |
If the given event is supported by the device or not. |
isOperationSupported
open fun isOperationSupported(code: Int): Boolean
Returns if the given operation is supported by the device or not.
Parameters | |
---|---|
code |
Int: Operation code. |
Return | |
---|---|
Boolean |
If the given operation is supported by the device or not. |